From 7fe21f8acfee5070a2e8ad9dcaef6942fd8a9be4 Mon Sep 17 00:00:00 2001 From: Jeff Billimek Date: Wed, 1 Aug 2018 23:18:07 -0400 Subject: [PATCH] syncronizing with helm chart PR --- home-assistant/Chart.yaml | 7 +-- home-assistant/README.md | 14 +---- home-assistant/templates/_helpers.tpl | 17 ------- .../templates/configurator-deployment.yaml | 25 +++++---- .../templates/configurator-ingress.yaml | 8 +-- .../templates/configurator-secret.yaml | 11 ++-- .../templates/configurator-svc.yaml | 8 +-- home-assistant/templates/deployment.yaml | 10 ++-- home-assistant/templates/ingress.yaml | 2 +- home-assistant/templates/pvc.yaml | 2 +- home-assistant/templates/service.yaml | 6 ++- home-assistant/values.yaml | 51 ++++--------------- 12 files changed, 56 insertions(+), 105 deletions(-) diff --git a/home-assistant/Chart.yaml b/home-assistant/Chart.yaml index e63ed8cc..d1828282 100644 --- a/home-assistant/Chart.yaml +++ b/home-assistant/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v1 -appVersion: 0.72.1 +appVersion: 0.74.2 description: Home Assistant name: home-assistant -version: 0.1.25 +version: 0.1.45 keywords: - home-assistant - hass @@ -11,6 +11,7 @@ home: https://github.com/home-assistant/home-assistant icon: https://upload.wikimedia.org/wikipedia/commons/thumb/6/6e/Home_Assistant_Logo.svg/519px-Home_Assistant_Logo.svg.png sources: - https://github.com/home-assistant/home-assistant +- https://github.com/danielperna84/hass-configurator maintainers: - name: billimek - email: jeff@billimek.com \ No newline at end of file + email: jeff@billimek.com diff --git a/home-assistant/README.md b/home-assistant/README.md index 76169a63..403548ca 100644 --- a/home-assistant/README.md +++ b/home-assistant/README.md @@ -38,7 +38,6 @@ The following tables lists the configurable parameters of the Sentry chart and t | `image.repository` | Image repository | `homeassistant/home-assistant` | | `image.tag` | Image tag. Possible values listed [here](https://hub.docker.com/r/jacobalberty/home-assistant/tags/).| `0.72.1`| | `image.pullPolicy` | Image pull policy | `IfNotPresent` | -| `name` | Default name | `home-assistant` | | `service.type` | Kubernetes service type for the home-assistant GUI | `ClusterIP` | | `service.port` | Kubernetes port where the home-assistant GUI is exposed| `8123` | | `service.annotations` | Service annotations for the home-assistant GUI | `{}` | @@ -58,17 +57,7 @@ The following tables lists the configurable parameters of the Sentry chart and t | `persistence.storageClass` | Type of persistent volume claim | `-` | | `persistence.accessMode` | Persistence access modes | `ReadWriteMany` | | `extraEnv` | Extra ENV vars to pass to the home-assistant container | `{}` | -| `mqttService.enabled` | Enable the mqtt service port for home-assistant | `false` | -| `mqttService.type` | Kubernetes service type for the mqtt service | `NodePort` | -| `mqttService.port` | Kubernetes port where the mqtt service is exposed| `1883` | -| `mqttService.annotations` | Service annotations for the mqtt service | `{}` | -| `mqttService.clusterIP` | Cluster IP for the mqtt service | `` | -| `mqttService.externalIPs` | External IPs for the mqtt service | `[]` | -| `mqttService.loadBalancerIP` | Loadbalance IP for the mqtt service | `` | -| `mqttService.loadBalancerSourceRanges` | Loadbalance client IP restriction range for the mqtt service | `[]` | -| `mqttService.nodePort` | nodePort to listen on for the mqtt service | `` | | `configurator.enabled` | Enable the optional [configuration UI](https://github.com/danielperna84/hass-configurator) | `false` | -| `configurator.name` | Default name for the configurator UI | `configurator` | | `configurator.image.repository` | Image repository | `billimek/hass-configurator-docker` | | `configurator.image.tag` | Image tag | `x86_64-0.3.0`| | `configurator.image.pullPolicy` | Image pull policy | `IfNotPresent` | @@ -76,7 +65,8 @@ The following tables lists the configurable parameters of the Sentry chart and t | `configurator.hassApiPassword` | Home Assistant API Password | `` | | `configurator.basepath` | Base path of the home assistant configuration files | `/config` | | `configurator.enforceBasepath` | If set to true, will prevent navigation to other directories in the configurator UI | `true` | -| `configurator.credentials` | If set, will require basic auth to access the configurator UI using the format 'username:password' | `` | +| `configurator.username` | If this and password (below) are set, will require basic auth to access the configurator UI | `` | +| `configurator.password` | If this and username (above) are set, will require basic auth to access the configurator UI. password is in the format of a sha256 hash (e.g. "test" would be "{sha256}9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08") | `` | | `configurator.extraEnv` | Extra ENV vars to pass to the configuration UI | `{}` | | `configurator.ingress.enabled` | Enables Ingress for the configurator UI | `false` | | `configurator.ingress.annotations` | Ingress annotations for the configurator UI | `{}` | diff --git a/home-assistant/templates/_helpers.tpl b/home-assistant/templates/_helpers.tpl index 5f99d9c4..d277f82d 100644 --- a/home-assistant/templates/_helpers.tpl +++ b/home-assistant/templates/_helpers.tpl @@ -24,23 +24,6 @@ If release name contains chart name it will be used as a full name. {{- end -}} {{- end -}} -{{/* -Create a fully qualified configurator name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -*/}} -{{- define "home-assistant.configurator.fullname" -}} -{{- if .Values.configurator.fullnameOverride -}} -{{- .Values.configurator.fullnameOverride | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- $name := default .Chart.Name .Values.nameOverride -}} -{{- if contains $name .Release.Name -}} -{{- printf "%s-%s" .Release.Name .Values.configurator.name | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- printf "%s-%s-%s" .Release.Name $name .Values.configurator.name | trunc 63 | trimSuffix "-" -}} -{{- end -}} -{{- end -}} -{{- end -}} - {{/* Create chart name and version as used by the chart label. */}} diff --git a/home-assistant/templates/configurator-deployment.yaml b/home-assistant/templates/configurator-deployment.yaml index 5080bae5..9f543380 100644 --- a/home-assistant/templates/configurator-deployment.yaml +++ b/home-assistant/templates/configurator-deployment.yaml @@ -3,11 +3,11 @@ apiVersion: apps/v1beta2 kind: Deployment metadata: - name: {{ template "home-assistant.configurator.fullname" . }} + name: {{ template "home-assistant.fullname" . }}-configurator labels: app: {{ template "home-assistant.name" . }} chart: {{ template "home-assistant.chart" . }} - component: "{{ .Release.Name }}-{{ .Values.configurator.name }}" + component: configurator release: {{ .Release.Name }} heritage: {{ .Release.Service }} spec: @@ -16,16 +16,16 @@ spec: matchLabels: app: {{ template "home-assistant.name" . }} release: {{ .Release.Name }} + component: configurator template: metadata: labels: app: {{ template "home-assistant.name" . }} - component: "{{ .Values.configurator.name }}" + component: configurator release: {{ .Release.Name }} - component: "{{ .Release.Name }}-{{ .Values.configurator.name }}" spec: containers: - - name: {{ template "home-assistant.name" . }}-{{ .Values.configurator.name }} + - name: {{ template "home-assistant.name" . }}-configurator image: "{{ .Values.configurator.image.repository }}:{{ .Values.configurator.image.tag }}" imagePullPolicy: {{ .Values.configurator.image.pullPolicy }} ports: @@ -45,15 +45,20 @@ spec: - name: HC_HASS_API_PASSWORD valueFrom: secretKeyRef: - name: {{ template "home-assistant.configurator.fullname" . }} + name: {{ template "home-assistant.fullname" . }}-configurator key: hass-api-password {{- end }} - {{- if .Values.configurator.credentials }} - - name: HC_CREDENTIALS + {{- if (.Values.configurator.username) and (.Values.configurator.password) }} + - name: HC_USERNAME valueFrom: secretKeyRef: - name: {{ template "home-assistant.configurator.fullname" . }} - key: credentials + 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 diff --git a/home-assistant/templates/configurator-ingress.yaml b/home-assistant/templates/configurator-ingress.yaml index c91eab60..33c3217b 100644 --- a/home-assistant/templates/configurator-ingress.yaml +++ b/home-assistant/templates/configurator-ingress.yaml @@ -1,15 +1,15 @@ {{- if and .Values.configurator.enabled .Values.configurator.ingress.enabled -}} -{{- $fullName := include "home-assistant.configurator.fullname" . -}} +{{- $fullName := include "home-assistant.fullname" . -}} {{- $servicePort := .Values.configurator.service.port -}} {{- $ingressPath := .Values.configurator.ingress.path -}} apiVersion: extensions/v1beta1 kind: Ingress metadata: - name: {{ $fullName }} + name: {{ $fullName }}-configurator labels: app: {{ template "home-assistant.name" . }} chart: {{ template "home-assistant.chart" . }} - component: "{{ .Release.Name }}-{{ .Values.configurator.name }}" + component: configurator release: {{ .Release.Name }} heritage: {{ .Release.Service }} {{- with .Values.configurator.ingress.annotations }} @@ -34,7 +34,7 @@ spec: paths: - path: {{ $ingressPath }} backend: - serviceName: {{ $fullName }} + serviceName: {{ $fullName }}-configurator servicePort: {{ $servicePort }} {{- end }} {{- end }} diff --git a/home-assistant/templates/configurator-secret.yaml b/home-assistant/templates/configurator-secret.yaml index 6f24f4da..3305d62b 100644 --- a/home-assistant/templates/configurator-secret.yaml +++ b/home-assistant/templates/configurator-secret.yaml @@ -1,11 +1,11 @@ apiVersion: v1 kind: Secret metadata: - name: {{ template "home-assistant.configurator.fullname" . }} + name: {{ template "home-assistant.fullname" . }}-configurator labels: app: {{ template "home-assistant.name" . }} chart: {{ template "home-assistant.chart" . }} - component: "{{ .Release.Name }}-{{ .Values.configurator.name }}" + component: configurator release: {{ .Release.Name }} heritage: {{ .Release.Service }} type: Opaque @@ -13,6 +13,9 @@ data: {{- if .Values.configurator.hassApiPassword }} hass-api-password: {{ .Values.configurator.hassApiPassword | b64enc | quote }} {{- end }} - {{- if .Values.configurator.credentials }} - credentials: {{ .Values.configurator.credentials | b64enc | quote }} + {{- if .Values.configurator.username }} + username: {{ .Values.configurator.username | b64enc | quote }} + {{- end }} + {{- if .Values.configurator.password }} + password: {{ .Values.configurator.password | b64enc | quote }} {{- end }} diff --git a/home-assistant/templates/configurator-svc.yaml b/home-assistant/templates/configurator-svc.yaml index 4309db06..faeea5cf 100644 --- a/home-assistant/templates/configurator-svc.yaml +++ b/home-assistant/templates/configurator-svc.yaml @@ -2,11 +2,11 @@ apiVersion: v1 kind: Service metadata: - name: {{ template "home-assistant.configurator.fullname" . }} + name: {{ template "home-assistant.fullname" . }}-configurator labels: app: {{ template "home-assistant.name" . }} chart: {{ template "home-assistant.chart" . }} - component: "{{ .Release.Name }}-{{ .Values.configurator.name }}" + component: configurator release: {{ .Release.Name }} heritage: {{ .Release.Service }} {{- if .Values.configurator.service.labels }} @@ -47,5 +47,7 @@ spec: nodePort: {{.Values.configurator.service.nodePort}} {{ end }} selector: - component: "{{ .Release.Name }}-{{ .Values.configurator.name }}" + app: {{ template "home-assistant.name" . }} + release: {{ .Release.Name }} + component: configurator {{- end }} \ No newline at end of file diff --git a/home-assistant/templates/deployment.yaml b/home-assistant/templates/deployment.yaml index f4ae4c22..82349ced 100644 --- a/home-assistant/templates/deployment.yaml +++ b/home-assistant/templates/deployment.yaml @@ -5,7 +5,7 @@ metadata: labels: app: {{ template "home-assistant.name" . }} chart: {{ template "home-assistant.chart" . }} - component: "{{ .Release.Name }}-{{ .Values.name }}" + component: server release: {{ .Release.Name }} heritage: {{ .Release.Service }} spec: @@ -14,12 +14,13 @@ spec: matchLabels: app: {{ template "home-assistant.name" . }} release: {{ .Release.Name }} + component: server template: metadata: labels: app: {{ template "home-assistant.name" . }} release: {{ .Release.Name }} - component: "{{ .Release.Name }}-{{ .Values.name }}" + component: server spec: containers: - name: {{ .Chart.Name }} @@ -29,11 +30,6 @@ spec: - name: http containerPort: {{ .Values.service.port }} protocol: TCP - {{- if .Values.mqttService.enabled }} - - name: mqtt - containerPort: {{ .Values.mqttService.port }} - protocol: TCP - {{- end }} livenessProbe: httpGet: path: / diff --git a/home-assistant/templates/ingress.yaml b/home-assistant/templates/ingress.yaml index 607a0f75..a7b5e697 100644 --- a/home-assistant/templates/ingress.yaml +++ b/home-assistant/templates/ingress.yaml @@ -9,7 +9,7 @@ metadata: labels: app: {{ template "home-assistant.name" . }} chart: {{ template "home-assistant.chart" . }} - component: "{{ .Release.Name }}-{{ .Values.name }}" + component: server release: {{ .Release.Name }} heritage: {{ .Release.Service }} {{- with .Values.ingress.annotations }} diff --git a/home-assistant/templates/pvc.yaml b/home-assistant/templates/pvc.yaml index 9d4c5362..f6317f08 100644 --- a/home-assistant/templates/pvc.yaml +++ b/home-assistant/templates/pvc.yaml @@ -6,7 +6,7 @@ metadata: labels: app: {{ template "home-assistant.fullname" . }} chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - component: "{{ .Release.Name }}-{{ .Values.name }}" + component: server release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" spec: diff --git a/home-assistant/templates/service.yaml b/home-assistant/templates/service.yaml index dc6ecfa0..04df3c23 100644 --- a/home-assistant/templates/service.yaml +++ b/home-assistant/templates/service.yaml @@ -5,7 +5,7 @@ metadata: labels: app: {{ template "home-assistant.name" . }} chart: {{ template "home-assistant.chart" . }} - component: "{{ .Values.name }}" + component: server release: {{ .Release.Name }} heritage: {{ .Release.Service }} {{- if .Values.service.labels }} @@ -46,4 +46,6 @@ spec: nodePort: {{.Values.service.nodePort}} {{ end }} selector: - component: "{{ .Release.Name }}-{{ .Values.name }}" \ No newline at end of file + app: {{ template "home-assistant.name" . }} + release: {{ .Release.Name }} + component: server \ No newline at end of file diff --git a/home-assistant/values.yaml b/home-assistant/values.yaml index e8f39eb1..b1fbb7e2 100644 --- a/home-assistant/values.yaml +++ b/home-assistant/values.yaml @@ -6,11 +6,9 @@ replicaCount: 1 image: repository: homeassistant/home-assistant - tag: 0.72.1 + tag: 0.74.2 pullPolicy: IfNotPresent -name: home-assistant - service: type: ClusterIP port: 8123 @@ -60,56 +58,29 @@ persistence: ## extraEnv: {} - -## service to leverage the MQTT broker service if it is enabled within Home Assistant -mqttService: - enabled: false - type: NodePort - port: 1883 - ## 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: "" - ## List of IP addresses at which the hass-configurator service is available - ## Ref: https://kubernetes.io/docs/user-guide/services/#external-ips - ## - externalIPs: [] - ## Use loadBalancerIP to request a specific static IP, - ## otherwise leave blank - ## - loadBalancerIP: - loadBalancerSourceRanges: [] - # nodePort: 30000 - - configurator: enabled: false - name: configurator ## hass-configurator container image ## image: - repository: billimek/hass-configurator-docker - tag: x86_64-0.3.0 + repository: causticlab/hass-configurator-docker + tag: x86_64-0.3.1 pullPolicy: IfNotPresent ## URL for the home assistant API endpoint # hassApiUrl: http://home-assistant:8123/api/ ## home assistant API password - # hassApiPassword: + # hassApiPassword: ## path where the home assistant configuration is stored basepath: /config ## don't allow switching out of the base path enforceBasepath: true - ## enforce basic auth for accessing the configurator - # credentials: + ## username for basic auth for accessing the configurator + # username: + ## password (sha256-hash) for basic auth for accessing the configurator + ## For example "test" would be "{sha256}9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08" + # password: ## Additional hass-configurator container environment variable ## For instance to add a http_proxy @@ -138,7 +109,7 @@ configurator: ## Secrets must be manually created in the namespace ## tls: [] - # - secretName: prometheus-alerts-tls + # - secretName: hass-configurator-tls # hosts: # - hass-configurator.domain.com @@ -210,8 +181,6 @@ configurator: loadBalancerIP: loadBalancerSourceRanges: [] - - resources: {} # We usually recommend not to specify default resources and to leave this as a conscious # choice for the user. This also increases chances charts run on environments with little