[stable/home-assistant] OWNERS and convert configurator to sidecar (#7448)

* adding OWNERS file

Signed-off-by: Jeff Billimek <jeff@billimek.com>

* changes to make configurator run as a sidecar

Signed-off-by: Jeff Billimek <jeff@billimek.com>

* making chart version semver

Signed-off-by: Jeff Billimek <jeff@billimek.com>

* removing ready and live checks to see if this fixes failing E2E tests

Signed-off-by: Jeff Billimek <jeff@billimek.com>

* Revert "removing ready and live checks to see if this fixes failing E2E tests"

This reverts commit 22d99d60f1.

Signed-off-by: Jeff Billimek <jeff@billimek.com>

* correcting syntax issue with pvc template

Signed-off-by: Jeff Billimek <jeff@billimek.com>

* do not need ReadWriteMany anymore

Signed-off-by: Jeff Billimek <jeff@billimek.com>
This commit is contained in:
Jeff Billimek
2018-09-16 10:53:33 -07:00
committed by k8s-ci-robot
parent d0d95fc130
commit cef293ea4e
12 changed files with 103 additions and 259 deletions
+2
View File
@@ -19,3 +19,5 @@
.project
.idea/
*.tmproj
# OWNERS file for Kubernetes
OWNERS
+2 -2
View File
@@ -1,8 +1,8 @@
apiVersion: v1
appVersion: 0.74.2
appVersion: 0.77.1
description: Home Assistant
name: home-assistant
version: 0.1.45
version: 0.2.0
keywords:
- home-assistant
- hass
+4
View File
@@ -0,0 +1,4 @@
approvers:
- billimek
reviewers:
- billimek
@@ -1,107 +0,0 @@
{{- if .Values.configurator.enabled -}}
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: {{ template "home-assistant.fullname" . }}-configurator
labels:
app: {{ template "home-assistant.name" . }}
chart: {{ template "home-assistant.chart" . }}
component: configurator
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
replicas: {{ .Values.configurator.replicaCount }}
selector:
matchLabels:
app: {{ template "home-assistant.name" . }}
release: {{ .Release.Name }}
component: configurator
template:
metadata:
labels:
app: {{ template "home-assistant.name" . }}
component: configurator
release: {{ .Release.Name }}
spec:
containers:
- name: {{ template "home-assistant.name" . }}-configurator
image: "{{ .Values.configurator.image.repository }}:{{ .Values.configurator.image.tag }}"
imagePullPolicy: {{ .Values.configurator.image.pullPolicy }}
ports:
- name: http
containerPort: {{ .Values.configurator.service.port }}
protocol: TCP
livenessProbe:
tcpSocket:
port: http
initialDelaySeconds: 30
readinessProbe:
tcpSocket:
port: http
initialDelaySeconds: 15
env:
{{- if .Values.configurator.hassApiPassword }}
- name: HC_HASS_API_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "home-assistant.fullname" . }}-configurator
key: hass-api-password
{{- end }}
{{- if (.Values.configurator.username) and (.Values.configurator.password) }}
- name: HC_USERNAME
valueFrom:
secretKeyRef:
name: {{ template "home-assistant.fullname" . }}-configurator
key: username
- name: HC_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "home-assistant.fullname" . }}-configurator
key: password
{{- end }}
{{- if .Values.configurator.hassApiUrl }}
- name: HC_HASS_API
value: "{{ .Values.configurator.hassApiUrl }}"
{{- else }}
- name: HC_HASS_API
value: "http://{{ template "home-assistant.fullname" . }}:{{ .Values.service.port }}/api/"
{{- end }}
{{- if .Values.configurator.basepath }}
- name: HC_BASEPATH
value: "{{ .Values.configurator.basepath }}"
{{- end }}
{{- if .Values.configurator.enforceBasepath }}
- name: HC_ENFORCE_BASEPATH
value: "{{ .Values.configurator.enforceBasepath }}"
{{- end }}
{{- range $key, $value := .Values.configurator.extraEnv }}
- name: {{ $key }}
value: {{ $value }}
{{- end }}
volumeMounts:
- mountPath: /config
name: config
resources:
{{ toYaml .Values.configurator.resources | indent 12 }}
volumes:
- name: config
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ template "home-assistant.fullname" . }}{{- end }}
{{- else }}
emptyDir: {}
{{ end }}
{{- with .Values.configurator.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.configurator.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.configurator.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}
{{- end }}
@@ -1,4 +1,4 @@
{{- if and .Values.configurator.enabled .Values.configurator.ingress.enabled -}}
{{- if (.Values.configurator.enabled) and (.Values.configurator.ingress.enabled) }}
{{- $fullName := include "home-assistant.fullname" . -}}
{{- $servicePort := .Values.configurator.service.port -}}
{{- $ingressPath := .Values.configurator.ingress.path -}}
@@ -9,7 +9,6 @@ metadata:
labels:
app: {{ template "home-assistant.name" . }}
chart: {{ template "home-assistant.chart" . }}
component: configurator
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- with .Values.configurator.ingress.annotations }}
@@ -34,7 +33,7 @@ spec:
paths:
- path: {{ $ingressPath }}
backend:
serviceName: {{ $fullName }}-configurator
serviceName: {{ $fullName }}
servicePort: {{ $servicePort }}
{{- end }}
{{- end }}
@@ -1,53 +0,0 @@
{{- if .Values.configurator.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ template "home-assistant.fullname" . }}-configurator
labels:
app: {{ template "home-assistant.name" . }}
chart: {{ template "home-assistant.chart" . }}
component: configurator
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- if .Values.configurator.service.labels }}
{{ toYaml .Values.configurator.service.labels | indent 4 }}
{{- end }}
{{- with .Values.configurator.service.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{- if (or (eq .Values.configurator.service.type "ClusterIP") (empty .Values.configurator.service.type)) }}
type: ClusterIP
{{- if .Values.configurator.service.clusterIP }}
clusterIP: {{ .Values.configurator.service.clusterIP }}
{{end}}
{{- else if eq .Values.configurator.service.type "LoadBalancer" }}
type: {{ .Values.configurator.service.type }}
{{- if .Values.configurator.service.loadBalancerIP }}
loadBalancerIP: {{ .Values.configurator.service.loadBalancerIP }}
{{- end }}
{{- if .Values.configurator.service.loadBalancerSourceRanges }}
loadBalancerSourceRanges:
{{ toYaml .Values.configurator.service.loadBalancerSourceRanges | indent 4 }}
{{- end -}}
{{- else }}
type: {{ .Values.configurator.service.type }}
{{- end }}
{{- if .Values.configurator.service.externalIPs }}
externalIPs:
{{ toYaml .Values.configurator.service.externalIPs | indent 4 }}
{{- end }}
ports:
- name: http
port: {{ .Values.configurator.service.port }}
protocol: TCP
targetPort: 3218
{{ if (and (eq .Values.configurator.service.type "NodePort") (not (empty .Values.configurator.service.nodePort))) }}
nodePort: {{.Values.configurator.service.nodePort}}
{{ end }}
selector:
app: {{ template "home-assistant.name" . }}
release: {{ .Release.Name }}
component: configurator
{{- end }}
@@ -5,7 +5,6 @@ metadata:
labels:
app: {{ template "home-assistant.name" . }}
chart: {{ template "home-assistant.chart" . }}
component: server
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
@@ -14,31 +13,29 @@ spec:
matchLabels:
app: {{ template "home-assistant.name" . }}
release: {{ .Release.Name }}
component: server
template:
metadata:
labels:
app: {{ template "home-assistant.name" . }}
release: {{ .Release.Name }}
component: server
spec:
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
- name: api
containerPort: {{ .Values.service.port }}
protocol: TCP
livenessProbe:
httpGet:
path: /
port: http
port: api
initialDelaySeconds: 30
readinessProbe:
httpGet:
path: /
port: http
port: api
initialDelaySeconds: 15
env:
{{- range $key, $value := .Values.extraEnv }}
@@ -50,6 +47,67 @@ spec:
name: config
resources:
{{ toYaml .Values.resources | indent 12 }}
{{- if .Values.configurator.enabled }}
- name: configurator
image: "{{ .Values.configurator.image.repository }}:{{ .Values.configurator.image.tag }}"
imagePullPolicy: {{ .Values.configurator.image.pullPolicy }}
ports:
- name: http
containerPort: {{ .Values.configurator.service.port }}
protocol: TCP
livenessProbe:
tcpSocket:
port: http
initialDelaySeconds: 30
readinessProbe:
tcpSocket:
port: http
initialDelaySeconds: 15
env:
{{- if .Values.configurator.hassApiPassword }}
- name: HC_HASS_API_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "home-assistant.fullname" . }}-configurator
key: hass-api-password
{{- end }}
{{- if (.Values.configurator.username) and (.Values.configurator.password) }}
- name: HC_USERNAME
valueFrom:
secretKeyRef:
name: {{ template "home-assistant.fullname" . }}-configurator
key: username
- name: HC_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "home-assistant.fullname" . }}-configurator
key: password
{{- end }}
{{- if .Values.configurator.hassApiUrl }}
- name: HC_HASS_API
value: "{{ .Values.configurator.hassApiUrl }}"
{{- else }}
- name: HC_HASS_API
value: "http://{{ template "home-assistant.fullname" . }}:{{ .Values.service.port }}/api/"
{{- end }}
{{- if .Values.configurator.basepath }}
- name: HC_BASEPATH
value: "{{ .Values.configurator.basepath }}"
{{- end }}
{{- if .Values.configurator.enforceBasepath }}
- name: HC_ENFORCE_BASEPATH
value: "{{ .Values.configurator.enforceBasepath }}"
{{- end }}
{{- range $key, $value := .Values.configurator.extraEnv }}
- name: {{ $key }}
value: {{ $value }}
{{- end }}
volumeMounts:
- mountPath: /config
name: config
resources:
{{ toYaml .Values.configurator.resources | indent 12 }}
{{- end }}
volumes:
- name: config
{{- if .Values.persistence.enabled }}
+1 -2
View File
@@ -9,7 +9,6 @@ metadata:
labels:
app: {{ template "home-assistant.name" . }}
chart: {{ template "home-assistant.chart" . }}
component: server
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- with .Values.ingress.annotations }}
@@ -35,6 +34,6 @@ spec:
- path: {{ $ingressPath }}
backend:
serviceName: {{ $fullName }}
servicePort: http
servicePort: {{ $servicePort }}
{{- end }}
{{- end }}
+3 -2
View File
@@ -1,4 +1,5 @@
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
{{- if .Values.persistence.enabled -}}
{{- if not .Values.persistence.existingClaim -}}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
@@ -6,7 +7,6 @@ metadata:
labels:
app: {{ template "home-assistant.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
component: server
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
spec:
@@ -22,4 +22,5 @@ spec:
storageClassName: "{{ .Values.persistence.storageClass }}"
{{- end }}
{{- end }}
{{- end -}}
{{- end -}}
@@ -1,3 +1,4 @@
{{- if .Values.configurator.enabled }}
apiVersion: v1
kind: Secret
metadata:
@@ -5,7 +6,6 @@ metadata:
labels:
app: {{ template "home-assistant.name" . }}
chart: {{ template "home-assistant.chart" . }}
component: configurator
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
type: Opaque
@@ -19,3 +19,4 @@ data:
{{- if .Values.configurator.password }}
password: {{ .Values.configurator.password | b64enc | quote }}
{{- end }}
{{- end }}
+11 -4
View File
@@ -5,7 +5,6 @@ metadata:
labels:
app: {{ template "home-assistant.name" . }}
chart: {{ template "home-assistant.chart" . }}
component: server
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- if .Values.service.labels }}
@@ -38,14 +37,22 @@ spec:
{{ toYaml .Values.service.externalIPs | indent 4 }}
{{- end }}
ports:
- name: http
- name: api
port: {{ .Values.service.port }}
protocol: TCP
targetPort: 8123
{{ if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePort))) }}
nodePort: {{.Values.service.nodePort}}
{{ end }}
{{- if .Values.configurator.enabled }}
- name: http
port: {{ .Values.configurator.service.port }}
protocol: TCP
targetPort: 3218
{{ if (and (eq .Values.configurator.service.type "NodePort") (not (empty .Values.configurator.service.nodePort))) }}
nodePort: {{.Values.configurator.service.nodePort}}
{{ end }}
{{- end }}
selector:
app: {{ template "home-assistant.name" . }}
release: {{ .Release.Name }}
component: server
release: {{ .Release.Name }}
+12 -79
View File
@@ -6,7 +6,7 @@ replicaCount: 1
image:
repository: homeassistant/home-assistant
tag: 0.74.2
tag: 0.77.1
pullPolicy: IfNotPresent
service:
@@ -50,7 +50,7 @@ persistence:
## If you want to reuse an existing claim, you can pass the name of the PVC using
## the existingClaim variable
# existingClaim: your-claim
accessMode: ReadWriteMany
accessMode: ReadWriteOnce
size: 5Gi
## Additional hass-configurator container environment variable
@@ -88,86 +88,21 @@ configurator:
extraEnv: {}
ingress:
## If true, hass-configurator Ingress will be created
##
enabled: false
## hass-configurator Ingress annotations
##
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: 'true'
## hass-configurator Ingress hostnames with optional path
## Must be provided if Ingress is enabled
##
hosts: []
# - hass-configurator.domain.com
# - domain.com/hass-configurator
## hass-configurator Ingress TLS configuration
## Secrets must be manually created in the namespace
##
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
path: /
hosts:
- home-assistant.local
tls: []
# - secretName: hass-configurator-tls
# hosts:
# - hass-configurator.domain.com
## hass-configurator Deployment Strategy type
# strategy:
# type: Recreate
## Node tolerations for hass-configurator scheduling to nodes with taints
## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
##
tolerations: []
# - key: "key"
# operator: "Equal|Exists"
# value: "value"
# effect: "NoSchedule|PreferNoSchedule|NoExecute(1.6 only)"
## Node labels for hass-configurator pod assignment
## Ref: https://kubernetes.io/docs/user-guide/node-selection/
##
nodeSelector: {}
## Use an alternate scheduler, e.g. "stork".
## ref: https://kubernetes.io/docs/tasks/administer-cluster/configure-multiple-schedulers/
##
# schedulerName:
## Annotations to be added to hass-configurator pods
##
podAnnotations: {}
replicaCount: 1
## hass-configurator resource requests and limits
## Ref: http://kubernetes.io/docs/user-guide/compute-resources/
##
resources: {}
# limits:
# cpu: 10m
# memory: 32Mi
# requests:
# cpu: 10m
# memory: 32Mi
## Security context to be added to hass-configurator pods
##
securityContext: {}
# - secretName: home-assistant-tls
# hosts:
# - home-assistant.local
service:
type: ClusterIP
port: 3218
## Specify the nodePort value for the LoadBalancer and NodePort service types.
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport
##
# nodePort:
## Provide any additional annotations which may be required. This can be used to
## set the LoadBalancer service type to internal only.
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer
##
annotations: {}
labels: {}
clusterIP: ""
@@ -175,11 +110,9 @@ configurator:
## Ref: https://kubernetes.io/docs/user-guide/services/#external-ips
##
externalIPs: []
## Use loadBalancerIP to request a specific static IP,
## otherwise leave blank
##
loadBalancerIP:
loadBalancerIP: ""
loadBalancerSourceRanges: []
# nodePort: 30000
resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious