Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

Commit

Permalink
fix conflicintg port names and make password env value a secret
Browse files Browse the repository at this point in the history
Signed-off-by: Jeff Billimek <jeff@billimek.com>
  • Loading branch information
billimek committed May 6, 2019
1 parent f0b132e commit 12bf773
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 7 deletions.
21 changes: 16 additions & 5 deletions stable/home-assistant/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,16 @@ spec:
image: "{{ .Values.configurator.image.repository }}:{{ .Values.configurator.image.tag }}"
imagePullPolicy: {{ .Values.configurator.image.pullPolicy }}
ports:
- name: http
- name: configurator
containerPort: {{ .Values.configurator.service.port }}
protocol: TCP
livenessProbe:
tcpSocket:
port: http
port: configurator
initialDelaySeconds: 30
readinessProbe:
tcpSocket:
port: http
port: configurator
initialDelaySeconds: 15
env:
{{- if .Values.configurator.hassApiPassword }}
Expand Down Expand Up @@ -194,13 +194,24 @@ spec:
- --user-data-dir={{ .Values.vscode.vscodePath }}
{{- end }}
ports:
- name: http
- name: vscode
containerPort: {{ .Values.vscode.service.port }}
protocol: TCP
livenessProbe:
tcpSocket:
port: vscode
initialDelaySeconds: 30
readinessProbe:
tcpSocket:
port: vscode
initialDelaySeconds: 15
env:
{{- if .Values.vscode.password }}
- name: PASSWORD
value: {{ .Values.vscode.password }}
valueFrom:
secretKeyRef:
name: {{ template "home-assistant.fullname" . }}-vscode
key: password
{{- end }}
{{- range $key, $value := .Values.vscode.extraEnv }}
- name: {{ $key }}
Expand Down
17 changes: 17 additions & 0 deletions stable/home-assistant/templates/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,21 @@ data:
{{- if .Values.configurator.password }}
password: {{ .Values.configurator.password | b64enc | quote }}
{{- end }}
{{- end }}
---
{{- if .Values.vscode.enabled }}
apiVersion: v1
kind: Secret
metadata:
name: {{ template "home-assistant.fullname" . }}-vscode
labels:
app.kubernetes.io/name: {{ include "home-assistant.name" . }}
helm.sh/chart: {{ include "home-assistant.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
type: Opaque
data:
{{- if .Values.vscode.password }}
password: {{ .Values.vscode.password | b64enc | quote }}
{{- end }}
{{- end }}
4 changes: 2 additions & 2 deletions stable/home-assistant/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ spec:
nodePort: {{.Values.service.nodePort}}
{{ end }}
{{- if .Values.configurator.enabled }}
- name: http
- name: configurator
port: {{ .Values.configurator.service.port }}
protocol: TCP
targetPort: 3218
Expand All @@ -54,7 +54,7 @@ spec:
{{ end }}
{{- end }}
{{- if .Values.vscode.enabled }}
- name: http
- name: vscode
port: {{ .Values.vscode.service.port }}
protocol: TCP
targetPort: 80
Expand Down

0 comments on commit 12bf773

Please sign in to comment.