Skip to content

Commit

Permalink
Merge pull request #11 from mittwald/feature/helm-chart
Browse files Browse the repository at this point in the history
add helm-chart
  • Loading branch information
Hermsi1337 committed Apr 24, 2019
2 parents ab26d4d + 4970d8a commit 1cb0ccc
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 1 deletion.
22 changes: 22 additions & 0 deletions deploy/chart/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
5 changes: 5 additions & 0 deletions deploy/chart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v1
appVersion: "1.0"
description: A Helm chart for the Kubernetes secret generator
name: secret-generator
version: 0.1.0
32 changes: 32 additions & 0 deletions deploy/chart/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "secret-generator.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "secret-generator.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "secret-generator.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: mittwald:secret-generator
labels:
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
rules:
- apiGroups: [""] # "" indicates the core API group
resources: ["secrets"]
Expand All @@ -11,6 +15,10 @@ kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: mittwald:secret-generator
labels:
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
roleRef:
kind: ClusterRole
name: mittwald:secret-generator
Expand All @@ -24,4 +32,8 @@ kind: ServiceAccount
apiVersion: v1
metadata:
name: secret-generator
namespace: kube-system
namespace: kube-system
labels:
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ kind: Deployment
metadata:
name: secret-generator-deployment
namespace: kube-system
labels:
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
replicas: 1
template:
Expand Down

3 comments on commit 1cb0ccc

@yinzara
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pull request inadvertently broke the installation directions in the readme. The original template yaml files should probably be restored and duplicates made for the helm chart or alternative install instructions must be provided

@martin-helmich
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yinzara You're absolutely right, thanks for the hint. I've updated the deployment instructions to use the provided Helm chart.

@yinzara
Copy link
Contributor

@yinzara yinzara commented on 1cb0ccc May 8, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I appreciate the update to the readme, there are probably people who use the prior method of installation in their build scripts and it's going to cause a lot of people to fail. Additionally now the installation requires git when previously it only required helm. Until this helm chart is published somewhere, maybe a symbolic link?

Please sign in to comment.