Skip to content

Commit 609ed25

Browse files
committed
Update env variables in helm deployment.
1 parent 89dca07 commit 609ed25

File tree

4 files changed

+37
-20
lines changed

4 files changed

+37
-20
lines changed

helm/templates/_helpers.tpl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
{{- define "ssoGateway.name" -}}
2+
{{- define "kilnAPI.name" -}}
33
{{- default .Chart.Name .Values.global.nameOverride | trunc 63 | trimSuffix "-" }}
44
{{- end }}
55

@@ -9,7 +9,7 @@ Create a default fully qualified app name.
99
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
1010
If release name contains chart name it will be used as a full name.
1111
*/}}
12-
{{- define "ssoGateway.fullname" -}}
12+
{{- define "kilnAPI.fullname" -}}
1313
{{- $name := default .Chart.Name .Values.global.nameOverride }}
1414
{{- if contains $name .Release.Name }}
1515
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
@@ -21,16 +21,16 @@ If release name contains chart name it will be used as a full name.
2121
{{/*
2222
Create chart name and version as used by the chart label.
2323
*/}}
24-
{{- define "ssoGateway.chart" -}}
24+
{{- define "kilnAPI.chart" -}}
2525
{{- printf "%s-%s" .Chart.Name $.Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
2626
{{- end }}
2727

2828
{{/*
2929
Common labels
3030
*/}}
31-
{{- define "ssoGateway.labels" -}}
32-
helm.sh/chart: {{ include "ssoGateway.chart" . }}
33-
{{ include "ssoGateway.selectorLabels" . }}
31+
{{- define "kilnAPI.labels" -}}
32+
helm.sh/chart: {{ include "kilnAPI.chart" . }}
33+
{{ include "kilnAPI.selectorLabels" . }}
3434
{{- if $.Chart.AppVersion }}
3535
app.kubernetes.io/version: {{ $.Chart.AppVersion | quote }}
3636
{{- end }}
@@ -40,7 +40,7 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
4040
{{/*
4141
Selector labels
4242
*/}}
43-
{{- define "ssoGateway.selectorLabels" -}}
44-
app.kubernetes.io/name: {{ include "ssoGateway.name" . }}
43+
{{- define "kilnAPI.selectorLabels" -}}
44+
app.kubernetes.io/name: {{ include "kilnAPI.name" . }}
4545
app.kubernetes.io/instance: {{ .Release.Name }}
4646
{{- end }}

helm/templates/deployment.yaml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
apiVersion: apps/v1
22
kind: Deployment
33
metadata:
4-
name: {{ include "ssoGateway.fullname" . }}-client
4+
name: {{ include "kilnAPI.fullname" . }}-client
55
labels:
6-
{{- include "ssoGateway.labels" . | nindent 4 }}
6+
{{- include "kilnAPI.labels" . | nindent 4 }}
77
spec:
88
{{- if not .Values.kilnAPI.autoscaling.enabled }}
99
replicas: {{ .Values.kilnAPI.replicaCount }}
1010
{{- end }}
1111
revisionHistoryLimit: 1
1212
selector:
1313
matchLabels:
14-
{{- include "ssoGateway.selectorLabels" . | nindent 6 }}
14+
{{- include "kilnAPI.selectorLabels" . | nindent 6 }}
1515
template:
1616
metadata:
1717
# annotations:
@@ -45,7 +45,7 @@ spec:
4545
{{- toYaml . | nindent 8 }}
4646
{{- end }}
4747
labels:
48-
{{- include "ssoGateway.labels" . | nindent 8 }}
48+
{{- include "kilnAPI.labels" . | nindent 8 }}
4949
{{- with .Values.kilnAPI.podLabels }}
5050
{{- toYaml . | nindent 8 }}
5151
{{- end }}
@@ -116,13 +116,17 @@ spec:
116116
- name: SSO_CLIENT_PORT
117117
value: {{ .Values.kilnAPI.service.port | quote }}
118118
- name: NGINX_PROXY_URL
119-
value: http://{{ include "ssoGateway.fullname" . }}-nginx-svc
119+
value: http://{{ include "kilnAPI.fullname" . }}-nginx-svc
120120
- name: REDIS_STORE_URL
121-
value: redis://{{ include "ssoGateway.fullname" . }}-redis-svc:{{ .Values.redis.service.port }}
121+
value: redis://{{ include "kilnAPI.fullname" . }}-redis-svc:{{ .Values.redis.service.port }}
122122
- name: REDIRECT_URL
123-
value: http://{{ include "ssoGateway.fullname" . }}-client-svc:{{ .Values.kilnAPI.service.port }}/authn/callback
123+
value: http://{{ include "kilnAPI.fullname" . }}-client-svc:{{ .Values.kilnAPI.service.port }}/authn/callback
124124
- name: VAULT_CONFIG_PATH
125125
value: {{ .Values.global.vault.containerPath | quote }}
126+
- name: SESSION_SECRET
127+
valueFrom:
128+
secretKeyRef:
129+
name: {{ .Values.kilnAPI.session.secretName }}
126130
envFrom:
127131
{{- toYaml .Values.kilnAPI.envFrom | nindent 12 }}
128132
{{- with .Values.kilnAPI.volumeMounts }}

helm/templates/service.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
apiVersion: v1
22
kind: Service
33
metadata:
4-
name: {{ include "ssoGateway.fullname" . }}-client-svc
4+
name: {{ include "kilnAPI.fullname" . }}-client-svc
55
labels:
6-
{{- include "ssoGateway.labels" . | nindent 4 }}
6+
{{- include "kilnAPI.labels" . | nindent 4 }}
77
spec:
88
type: {{ .Values.kilnAPI.service.type | default "ClusterIP" }}
99
ports:
@@ -12,4 +12,4 @@ spec:
1212
targetPort: {{ .Values.kilnAPI.service.port }}
1313
protocol: TCP
1414
selector:
15-
{{- include "ssoGateway.selectorLabels" . | nindent 4 }}
15+
{{- include "kilnAPI.selectorLabels" . | nindent 4 }}

helm/values.yaml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,21 @@ kilnAPI:
5858
capabilities:
5959
drop:
6060
- ALL
61-
62-
env: {}
61+
env:
62+
- name: APP_ID
63+
value: "kiln-api-test"
64+
- name: PORT
65+
value: "3000"
66+
- name: LOG_LEVEL
67+
value: "debug"
68+
- name: REQUEST_LIMIT
69+
value: "100kb"
70+
- name: SWAGGER_API_SPEC
71+
value: "/api/spec"
72+
73+
session:
74+
# Secret name for session secret
75+
secretName: "kiln-api-secrets"
6376

6477
service:
6578
type: ClusterIP

0 commit comments

Comments
 (0)