File tree Expand file tree Collapse file tree 6 files changed +42
-12
lines changed Expand file tree Collapse file tree 6 files changed +42
-12
lines changed Original file line number Diff line number Diff line change 11apiVersion : v2
22name : sendgrid-stats-exporter
3- description : A Helm chart for chatwork/sendgrid-stats-exporter (It's till private for now, but will make it public soon)
3+ description : A Helm chart for chatwork/sendgrid-stats-exporter
44type : application
55version : 0.0.1
66appVersion : 0.0.3
Original file line number Diff line number Diff line change @@ -6,17 +6,7 @@ A Helm chart for [chatwork/sendgrid-stats-exporter](https://github.com/chatwork/
66## Installing the Chart
77
88```
9- $ cat configmap.yaml
10- apiVersion: v1
11- kind: ConfigMap
12- metadata:
13- name: sendgrid-config
14- data:
15- SENDGRID_API_KEY: 'secret'
16- $ kubectl apply -f configmap.yaml
17- configmap/sendgrid-config created
18-
19- $ helm install --set 'envFrom[0].configMapRef.name=sendgrid-config' sendgrid-stats-exporter ./
9+ $ helm install --set 'deployment.secret.apiKey=secret' --set 'deployment.secret.username=username' sendgrid-stats-exporter ./
2010```
2111
2212```
@@ -49,6 +39,8 @@ The following table lists the configurable parameters of the Sendgrid-stats-expo
4939| ` podSecurityContext ` | Security context for the pod | ` {} ` |
5040| ` securityContext ` | Security context for container | ` {} ` |
5141| ` envFrom ` | Extra custom environment variables from ConfigMaps | ` [] ` |
42+ | ` deployment.secret.apiKey ` | SendGrid api token | ` {} ` |
43+ | ` deployment.secret.username ` | SendGrid username | ` [] ` |
5244| ` service.type ` | Service Type | ` "ClusterIP" ` |
5345| ` service.port ` | Service port | ` 9154 ` |
5446| ` ingress.enabled ` | If true, enable Ingress | ` false ` |
Original file line number Diff line number Diff line change @@ -60,3 +60,14 @@ Create the name of the service account to use
6060{ {- default " default" .Values.serviceAccount.name } }
6161{ {- end } }
6262{ {- end } }
63+
64+ { {/*
65+ Return secret name to be used based on provided values.
66+ */} }
67+ { {- define " sendgrid-stats-exporter.secretName" -} }
68+ { {- if not .Values.deployment.secret.existingSecretName -} }
69+ { { default (printf " %s-secret" (include " sendgrid-stats-exporter.fullname" . )) } }
70+ { {- else -} }
71+ { { .Values.deployment.secret.existingSecretName } }
72+ { {- end -} }
73+ { {- end -} }
Original file line number Diff line number Diff line change 3535 imagePullPolicy : {{ .Values.image.pullPolicy }}
3636 envFrom :
3737 {{- toYaml .Values.envFrom | nindent 12 }}
38+ env :
39+ - name : SENDGRID_USER_NAME
40+ valueFrom :
41+ secretKeyRef :
42+ name : {{ include "sendgrid-stats-exporter.secretName" . }}
43+ key : username
44+ - name : SENDGRID_API_KEY
45+ valueFrom :
46+ secretKeyRef :
47+ name : {{ include "sendgrid-stats-exporter.secretName" . }}
48+ key : apiKey
3849 ports :
3950 - name : http
4051 containerPort : 9154
Original file line number Diff line number Diff line change 1+ apiVersion : v1
2+ kind : Secret
3+ metadata :
4+ name : {{ include "sendgrid-stats-exporter.secretName" . }}
5+ labels :
6+ {{- include "sendgrid-stats-exporter.labels" . | nindent 4 }}
7+ type : Opaque
8+ data :
9+ username : {{ .Values.deployment.secret.username | b64enc | quote }}
10+ apiKey : {{ .Values.deployment.secret.apiKey | b64enc | quote }}
Original file line number Diff line number Diff line change @@ -29,6 +29,12 @@ securityContext: {}
2929
3030envFrom : []
3131
32+ deployment :
33+ secret :
34+ existingSecretName :
35+ username : " "
36+ apiKey : " "
37+
3238service :
3339 type : ClusterIP
3440 port : 9154
You can’t perform that action at this time.
0 commit comments