mirror of
https://github.com/k8s-at-home/charts.git
synced 2025-02-03 07:49:03 +00:00
[esphome] use common (#303)
Co-authored-by: Ryan Holt <ryan@ryanholt.net>
This commit is contained in:
parent
ab9a0fda18
commit
6ad3ba062a
@ -19,5 +19,6 @@
|
|||||||
.project
|
.project
|
||||||
.idea/
|
.idea/
|
||||||
*.tmproj
|
*.tmproj
|
||||||
|
.vscode/
|
||||||
# OWNERS file for Kubernetes
|
# OWNERS file for Kubernetes
|
||||||
OWNERS
|
OWNERS
|
||||||
|
@ -1,14 +1,19 @@
|
|||||||
apiVersion: v2
|
apiVersion: v2
|
||||||
appVersion: 1.15.3
|
appVersion: 1.15.3
|
||||||
description: ESPHome
|
description: ESPHome is a system to control your ESP8266/ESP32 by simple yet powerful configuration files and control them remotely through Home Automation systems.
|
||||||
name: esphome
|
name: esphome
|
||||||
version: 2.3.0
|
version: 3.0.0
|
||||||
keywords:
|
keywords:
|
||||||
- esphome
|
- esphome
|
||||||
|
- home-automation
|
||||||
home: https://github.com/k8s-at-home/charts/tree/master/charts/esphome
|
home: https://github.com/k8s-at-home/charts/tree/master/charts/esphome
|
||||||
icon: https://esphome.io/_images/logo-text.svg
|
icon: https://esphome.io/_images/logo-text.svg
|
||||||
sources:
|
sources:
|
||||||
- https://github.com/esphome/esphome
|
- https://github.com/esphome/esphome
|
||||||
maintainers:
|
maintainers:
|
||||||
- name: billimek
|
- name: billimek
|
||||||
email: jeff@billimek.com
|
email: jeff@billimek.com
|
||||||
|
dependencies:
|
||||||
|
- name: common
|
||||||
|
repository: https://k8s-at-home.com/charts/
|
||||||
|
version: 1.7.0
|
||||||
|
@ -1,4 +1,8 @@
|
|||||||
approvers:
|
approvers:
|
||||||
- billimek
|
- billimek
|
||||||
|
- onedr0p
|
||||||
|
- bjw-s
|
||||||
reviewers:
|
reviewers:
|
||||||
- billimek
|
- billimek
|
||||||
|
- onedr0p
|
||||||
|
- bjw-s
|
||||||
|
@ -1,120 +1,78 @@
|
|||||||
# ESPHome
|
# esphome
|
||||||
|
|
||||||
This is a helm chart for [ESPHome](https://esphome.io)
|
This is a helm chart for [esphome](https://github.com/esphome/esphome).
|
||||||
|
|
||||||
|
**This chart is not maintained by the upstream project and any issues with the chart should be raised [here](https://github.com/k8s-at-home/charts/issues/new/choose)**
|
||||||
|
|
||||||
## TL;DR;
|
## TL;DR;
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
helm repo add k8s-at-home https://k8s-at-home.com/charts/
|
$ helm repo add k8s-at-home https://k8s-at-home.com/charts/
|
||||||
helm install k8s-at-home/esphome
|
$ helm install k8s-at-home/esphome
|
||||||
```
|
```
|
||||||
|
|
||||||
## Introduction
|
|
||||||
|
|
||||||
This code is adapted for [the official esphome docker image](https://hub.docker.com/r/esphome/esphome/)
|
|
||||||
|
|
||||||
## Installing the Chart
|
## Installing the Chart
|
||||||
|
|
||||||
To install the chart with the release name `my-release`:
|
To install the chart with the release name `my-release`:
|
||||||
|
|
||||||
```shell
|
```console
|
||||||
helm install --name my-release k8s-at-home/esphome
|
helm install --name my-release k8s-at-home/esphome
|
||||||
```
|
```
|
||||||
|
|
||||||
## Uninstalling the Chart
|
## Uninstalling the Chart
|
||||||
|
|
||||||
To uninstall/delete the `my-release` deployment:
|
To uninstall/delete the `my-release` deployment:
|
||||||
|
|
||||||
```shell
|
```console
|
||||||
helm delete my-release --purge
|
helm delete my-release --purge
|
||||||
```
|
```
|
||||||
|
|
||||||
The command removes all the Kubernetes components associated with the chart and deletes the release.
|
The command removes all the Kubernetes components associated with the chart and deletes the release.
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
Read through the charts [values.yaml](https://github.com/k8s-at-home/charts/blob/master/charts/esphome/values.yaml)
|
||||||
The following tables lists the configurable parameters of the ESPHome chart and their default values.
|
file. It has several commented out suggested values.
|
||||||
|
Additionally you can take a look at the common library [values.yaml](https://github.com/k8s-at-home/charts/blob/master/charts/common/values.yaml) for more (advanced) configuration options.
|
||||||
| Parameter | Description | Default |
|
|
||||||
|----------------------------------------|--------------------------------------------------------------------------------------------------------------------|-----------------------|
|
|
||||||
| `image.repository` | Image repository | `esphome/esphome` |
|
|
||||||
| `image.tag` | Image tag. Possible values listed [here](https://hub.docker.com/r/esphome/esphome/tags/). | `0.14.5` |
|
|
||||||
| `image.pullPolicy` | Image pull policy | `IfNotPresent` |
|
|
||||||
| `image.pullSecrets` | Secrets to use when pulling the image | `[]` |
|
|
||||||
| `strategyType` | Specifies the strategy used to replace old Pods by new ones | `Recreate` |
|
|
||||||
| `probes.liveness.enabled` | Use the livenessProbe? | `true` |
|
|
||||||
| `probes.liveness.scheme ` | Specify liveness `scheme` parameter for the deployment | `HTTP` |
|
|
||||||
| `probes.liveness.initialDelaySeconds` | Specify liveness `initialDelaySeconds` parameter for the deployment | `60` |
|
|
||||||
| `probes.liveness.failureThreshold` | Specify liveness `failureThreshold` parameter for the deployment | `5` |
|
|
||||||
| `probes.liveness.timeoutSeconds` | Specify liveness `timeoutSeconds` parameter for the deployment | `10` |
|
|
||||||
| `probes.readiness.enabled` | Use the readinessProbe? | `true` |
|
|
||||||
| `probes.readiness.scheme ` | Specify readiness `scheme` parameter for the deployment | `HTTP` |
|
|
||||||
| `probes.readiness.initialDelaySeconds` | Specify readiness `initialDelaySeconds` parameter for the deployment | `60` |
|
|
||||||
| `probes.readiness.failureThreshold` | Specify readiness `failureThreshold` parameter for the deployment | `5` |
|
|
||||||
| `probes.readiness.timeoutSeconds` | Specify readiness `timeoutSeconds` parameter for the deployment | `10` |
|
|
||||||
| `probes.startup.enabled` | Use the startupProbe? (new in kubernetes 1.16) | `false` |
|
|
||||||
| `probes.startup.scheme ` | Specify startup `scheme` parameter for the deployment | `HTTP` |
|
|
||||||
| `probes.startup.failureThreshold` | Specify startup `failureThreshold` parameter for the deployment | `5` |
|
|
||||||
| `probes.startup.periodSeconds` | Specify startup `periodSeconds` parameter for the deployment | `10` |
|
|
||||||
| `service.type` | Kubernetes service type for the esphome GUI | `ClusterIP` |
|
|
||||||
| `service.port` | Kubernetes port where the esphome GUI is exposed | `6052` |
|
|
||||||
| `service.portName` | Kubernetes port name where the esphome GUI is exposed | `api` |
|
|
||||||
| `service.additionalPorts` | Add additional ports exposed by the esphome container integrations. Example homematic needs to expose a proxy port | `{}` |
|
|
||||||
| `service.annotations` | Service annotations for the esphome GUI | `{}` |
|
|
||||||
| `service.clusterIP` | Cluster IP for the esphom GUI | `` |
|
|
||||||
| `service.externalIPs` | External IPs for the esphome GUI | `[]` |
|
|
||||||
| `service.loadBalancerIP` | Loadbalancer IP for the esphome GUI | `` |
|
|
||||||
| `service.loadBalancerSourceRanges` | Loadbalancer client IP restriction range for the esphome GUI | `[]` |
|
|
||||||
| `service.publishNotReadyAddresses` | Set to true if the notReadyAddresses should be published | `false` |
|
|
||||||
| `service.externalTrafficPolicy` | Loadbalancer externalTrafficPolicy | `` |
|
|
||||||
| `hostNetwork` | Enable hostNetwork - might be needed for discovery to work | `false` |
|
|
||||||
| `service.nodePort` | nodePort to listen on for the esphome GUI | `` |
|
|
||||||
| `ingress.enabled` | Enables Ingress | `false` |
|
|
||||||
| `ingress.annotations` | Ingress annotations | `{}` |
|
|
||||||
| `ingress.path` | Ingress path | `/` |
|
|
||||||
| `ingress.hosts` | Ingress accepted hostnames | `chart-example.local` |
|
|
||||||
| `ingress.tls` | Ingress TLS configuration | `[]` |
|
|
||||||
| `persistence.enabled` | Use persistent volume to store data | `true` |
|
|
||||||
| `persistence.size` | Size of persistent volume claim | `5Gi` |
|
|
||||||
| `persistence.existingClaim` | Use an existing PVC to persist data | `nil` |
|
|
||||||
| `persistence.hostPath` | The path to the config directory on the host, instead of a PVC | `nil` |
|
|
||||||
| `persistence.storageClass` | Type of persistent volume claim | `-` |
|
|
||||||
| `persistence.accessMode` | Persistence access modes | `ReadWriteMany` |
|
|
||||||
| `git.enabled` | Use git-sync in init container | `false` |
|
|
||||||
| `git.secret` | Git secret to use for git-sync | `git-creds` |
|
|
||||||
| `git.syncPath` | Git sync path | `/config` |
|
|
||||||
| `git.keyPath` | Git ssh key path | `/root/.ssh` |
|
|
||||||
| `git.user.name` | Human-readable name in the “committer” and “author” fields | `` |
|
|
||||||
| `git.user.email` | Email address for the “committer” and “author” fields | `` |
|
|
||||||
| `hostMounts` | Array of host directories to mount; can be used for devices | [] |
|
|
||||||
| `hostMounts.name` | Name of the volume | `nil` |
|
|
||||||
| `hostMounts.hostPath` | The path on the host machine | `nil` |
|
|
||||||
| `hostMounts.mountPath` | The path at which to mount (optional; assumed same as hostPath) | `nil` |
|
|
||||||
| `hostMounts.type` | The type to mount (optional, i.e., `Directory`) | `nil` |
|
|
||||||
| `extraEnv` | Extra ENV vars to pass to the esphome container | `{}` |
|
|
||||||
| `extraEnvSecrets` | Extra env vars to pass to the esphome container from k8s secrets - see `values.yaml` for an example | `{}` |
|
|
||||||
| `resources` | CPU/Memory resource requests/limits or the esphome GUI | `{}` |
|
|
||||||
| `nodeSelector` | Node labels for pod assignment or the esphome GUI | `{}` |
|
|
||||||
| `tolerations` | Toleration labels for pod assignment or the esphome GUI | `[]` |
|
|
||||||
| `affinity` | Affinity settings for pod assignment or the esphome GUI | `{}` |
|
|
||||||
| `podAnnotations` | Key-value pairs to add as pod annotations | `{}` |
|
|
||||||
| `extraVolumes` | Any extra volumes to define for the pod | `{}` |
|
|
||||||
| `extraVolumeMounts` | Any extra volumes mounts to define for each container of the pod | `{}` |
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
|
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
|
||||||
|
```console
|
||||||
```shell
|
helm install esphome \
|
||||||
helm install --name my-release \
|
--set env.TZ="America/New_York" \
|
||||||
--set image.tag=latest \
|
|
||||||
k8s-at-home/esphome
|
k8s-at-home/esphome
|
||||||
```
|
```
|
||||||
|
Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the
|
||||||
Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example,
|
chart. For example,
|
||||||
|
```console
|
||||||
```shell
|
helm install esphome k8s-at-home/esphome --values values.yaml
|
||||||
helm install --name my-release -f values.yaml k8s-at-home/esphome
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Read through the [values.yaml](values.yaml) file. It has several commented out suggested values.
|
```yaml
|
||||||
|
image:
|
||||||
|
tag: ...
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
**NOTE**
|
||||||
|
|
||||||
|
If you get
|
||||||
|
```console
|
||||||
|
Error: rendered manifests contain a resource that already exists. Unable to continue with install: existing resource conflict: ...`
|
||||||
|
```
|
||||||
|
it may be because you uninstalled the chart with `skipuninstall` enabled, you need to manually delete the pvc or use `existingClaim`.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Upgrading an existing Release to a new major version
|
||||||
|
|
||||||
|
A major chart version change (like 4.0.1 -> 5.0.0) indicates that there is an incompatible breaking change potentially needing manual actions.
|
||||||
|
|
||||||
|
### Upgrading from 2.x.x to 3.x.x
|
||||||
|
|
||||||
|
Due to migrating to a centralized common library some values in `values.yaml` have changed.
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
|
||||||
|
* `service.port` has been moved to `service.port.port`.
|
||||||
|
* `persistence.type` has been moved to `controllerType`.
|
||||||
|
|
||||||
|
Refer to the library values.yaml for more configuration options.
|
||||||
|
4
charts/esphome/ci/ct-values.yaml
Normal file
4
charts/esphome/ci/ct-values.yaml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
env:
|
||||||
|
ESPHOME_DASHBOARD_USE_PING: true
|
||||||
|
ingress:
|
||||||
|
enabled: true
|
@ -1,19 +1 @@
|
|||||||
1. Get the application URL by running these commands:
|
{{- include "common.notes.defaultNotes" . -}}
|
||||||
{{- if .Values.ingress.enabled }}
|
|
||||||
{{- range .Values.ingress.hosts }}
|
|
||||||
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ . }}{{ $.Values.ingress.path }}
|
|
||||||
{{- end }}
|
|
||||||
{{- else if contains "NodePort" .Values.service.type }}
|
|
||||||
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "esphome.fullname" . }})
|
|
||||||
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
|
|
||||||
echo http://$NODE_IP:$NODE_PORT
|
|
||||||
{{- else if contains "LoadBalancer" .Values.service.type }}
|
|
||||||
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
|
|
||||||
You can watch the status of by running 'kubectl get svc -w {{ template "esphome.fullname" . }}'
|
|
||||||
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "esphome.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
|
|
||||||
echo http://$SERVICE_IP:{{ .Values.service.port }}
|
|
||||||
{{- else if contains "ClusterIP" .Values.service.type }}
|
|
||||||
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "esphome.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
|
|
||||||
echo "Visit http://127.0.0.1:8080 to use your application"
|
|
||||||
kubectl port-forward $POD_NAME 8080:80
|
|
||||||
{{- end }}
|
|
||||||
|
@ -1,32 +0,0 @@
|
|||||||
{{/* vim: set filetype=mustache: */}}
|
|
||||||
{{/*
|
|
||||||
Expand the name of the chart.
|
|
||||||
*/}}
|
|
||||||
{{- define "esphome.name" -}}
|
|
||||||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
|
|
||||||
{{- end -}}
|
|
||||||
|
|
||||||
{{/*
|
|
||||||
Create a default fully qualified app name.
|
|
||||||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
|
||||||
If release name contains chart name it will be used as a full name.
|
|
||||||
*/}}
|
|
||||||
{{- define "esphome.fullname" -}}
|
|
||||||
{{- if .Values.fullnameOverride -}}
|
|
||||||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
|
|
||||||
{{- else -}}
|
|
||||||
{{- $name := default .Chart.Name .Values.nameOverride -}}
|
|
||||||
{{- if contains $name .Release.Name -}}
|
|
||||||
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
|
|
||||||
{{- else -}}
|
|
||||||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
|
|
||||||
{{- end -}}
|
|
||||||
{{- end -}}
|
|
||||||
{{- end -}}
|
|
||||||
|
|
||||||
{{/*
|
|
||||||
Create chart name and version as used by the chart label.
|
|
||||||
*/}}
|
|
||||||
{{- define "esphome.chart" -}}
|
|
||||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
|
|
||||||
{{- end -}}
|
|
1
charts/esphome/templates/common.yaml
Normal file
1
charts/esphome/templates/common.yaml
Normal file
@ -0,0 +1 @@
|
|||||||
|
{{ include "common.all" . }}
|
@ -1,216 +0,0 @@
|
|||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
metadata:
|
|
||||||
name: {{ template "esphome.fullname" . }}
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/name: {{ include "esphome.name" . }}
|
|
||||||
helm.sh/chart: {{ include "esphome.chart" . }}
|
|
||||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
||||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
|
||||||
spec:
|
|
||||||
replicas: 1
|
|
||||||
strategy:
|
|
||||||
type: {{ .Values.strategyType }}
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
app.kubernetes.io/name: {{ include "esphome.name" . }}
|
|
||||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/name: {{ include "esphome.name" . }}
|
|
||||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
||||||
{{- if .Values.podAnnotations }}
|
|
||||||
annotations:
|
|
||||||
{{- range $key, $value := .Values.podAnnotations }}
|
|
||||||
{{ $key }}: {{ $value | quote }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
spec:
|
|
||||||
{{- with .Values.image.pullSecrets }}
|
|
||||||
imagePullSecrets:
|
|
||||||
{{- range . }}
|
|
||||||
- name: {{ . }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
{{- if .Values.hostNetwork }}
|
|
||||||
hostNetwork: {{ .Values.hostNetwork }}
|
|
||||||
dnsPolicy: ClusterFirstWithHostNet
|
|
||||||
{{- end }}
|
|
||||||
initContainers:
|
|
||||||
{{- if .Values.git.enabled }}
|
|
||||||
- name: git-sync
|
|
||||||
image: "{{ .Values.git.image.repository }}:{{ .Values.git.image.tag }}"
|
|
||||||
imagePullPolicy: {{ .Values.git.image.pullPolicy }}
|
|
||||||
{{- if .Values.git.command }}
|
|
||||||
command:
|
|
||||||
{{- range .Values.git.command }}
|
|
||||||
- {{ . | quote }}
|
|
||||||
{{- end }}
|
|
||||||
{{- else }}
|
|
||||||
command: ["/bin/sh", "-c"]
|
|
||||||
args:
|
|
||||||
- set -e;
|
|
||||||
if [ -d "{{ .Values.git.syncPath }}/.git" ];
|
|
||||||
then
|
|
||||||
git -C "{{ .Values.git.syncPath }}" pull || true;
|
|
||||||
else
|
|
||||||
if [ "$(ls -A {{ .Values.git.syncPath }})" ];
|
|
||||||
then
|
|
||||||
git clone --depth 2 "{{ .Values.git.repo }}" /tmp/repo;
|
|
||||||
cp -rf /tmp/repo/.git "{{ .Values.git.syncPath }}";
|
|
||||||
cd "{{ .Values.git.syncPath }}";
|
|
||||||
git checkout -f;
|
|
||||||
else
|
|
||||||
git clone --depth 2 "{{ .Values.git.repo }}" "{{ .Values.git.syncPath }}";
|
|
||||||
fi;
|
|
||||||
fi;
|
|
||||||
if [ -f "{{ .Values.git.keyPath }}/git-crypt-key" ];
|
|
||||||
then
|
|
||||||
cd {{ .Values.git.syncPath }};
|
|
||||||
git-crypt unlock "{{ .Values.git.keyPath }}/git-crypt-key";
|
|
||||||
fi;
|
|
||||||
{{- end }}
|
|
||||||
volumeMounts:
|
|
||||||
- mountPath: /config
|
|
||||||
name: config
|
|
||||||
- mountPath: {{ .Values.git.keyPath }}
|
|
||||||
name: git-secret
|
|
||||||
{{- if .Values.extraVolumeMounts }}{{ toYaml .Values.extraVolumeMounts | trim | nindent 8 }}{{ end }}
|
|
||||||
{{- if .Values.usePodSecurityContext }}
|
|
||||||
securityContext:
|
|
||||||
runAsUser: {{ default 0 .Values.runAsUser }}
|
|
||||||
{{- if and (.Values.runAsUser) (.Values.fsGroup) }}
|
|
||||||
{{- if not (eq .Values.runAsUser 0.0) }}
|
|
||||||
fsGroup: {{ .Values.fsGroup }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
containers:
|
|
||||||
- name: {{ .Chart.Name }}
|
|
||||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
|
||||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
||||||
ports:
|
|
||||||
- name: api
|
|
||||||
containerPort: {{ .Values.service.port }}
|
|
||||||
protocol: TCP
|
|
||||||
{{- range .Values.service.additionalPorts }}
|
|
||||||
- name: {{ .name }}
|
|
||||||
containerPort: {{ .targetPort }}
|
|
||||||
{{- end }}
|
|
||||||
{{- if .Values.probes.liveness.enabled }}
|
|
||||||
livenessProbe:
|
|
||||||
httpGet:
|
|
||||||
path: /ping
|
|
||||||
port: api
|
|
||||||
scheme: {{ .Values.probes.liveness.scheme }}
|
|
||||||
initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }}
|
|
||||||
failureThreshold: {{ .Values.probes.liveness.failureThreshold }}
|
|
||||||
timeoutSeconds: {{ .Values.probes.liveness.timeoutSeconds }}
|
|
||||||
{{- end }}
|
|
||||||
{{- if .Values.probes.readiness.enabled }}
|
|
||||||
readinessProbe:
|
|
||||||
httpGet:
|
|
||||||
path: /ping
|
|
||||||
port: api
|
|
||||||
scheme: {{ .Values.probes.readiness.scheme }}
|
|
||||||
initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }}
|
|
||||||
failureThreshold: {{ .Values.probes.readiness.failureThreshold }}
|
|
||||||
timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }}
|
|
||||||
{{- end }}
|
|
||||||
{{- if .Values.probes.startup.enabled }}
|
|
||||||
startupProbe:
|
|
||||||
httpGet:
|
|
||||||
path: /ping
|
|
||||||
port: api
|
|
||||||
scheme: {{ .Values.probes.startup.scheme }}
|
|
||||||
failureThreshold: {{ .Values.probes.startup.failureThreshold }}
|
|
||||||
periodSeconds: {{ .Values.probes.startup.periodSeconds }}
|
|
||||||
{{- end }}
|
|
||||||
env:
|
|
||||||
{{- range $key, $value := .Values.extraEnv }}
|
|
||||||
- name: {{ $key | quote }}
|
|
||||||
value: {{ $value | quote }}
|
|
||||||
{{- end }}
|
|
||||||
{{- range $name, $opts := .Values.extraEnvSecrets }}
|
|
||||||
- name: {{ $name }}
|
|
||||||
valueFrom:
|
|
||||||
secretKeyRef:
|
|
||||||
name: {{ $opts.secret }}
|
|
||||||
key: {{ $opts.key }}
|
|
||||||
{{- end }}
|
|
||||||
envFrom:
|
|
||||||
{{- range .Values.extraSecretForEnvFrom }}
|
|
||||||
- secretRef:
|
|
||||||
name: {{ . }}
|
|
||||||
{{- end }}
|
|
||||||
volumeMounts:
|
|
||||||
- mountPath: /config
|
|
||||||
name: config
|
|
||||||
{{- range .Values.hostMounts }}
|
|
||||||
{{- if .mountPath }}
|
|
||||||
- mountPath: {{ .mountPath }}
|
|
||||||
{{- else }}
|
|
||||||
- mountPath: {{ .hostPath }}
|
|
||||||
{{- end }}
|
|
||||||
name: {{ .name }}
|
|
||||||
{{- end }}
|
|
||||||
{{- if .Values.extraVolumeMounts }}{{ toYaml .Values.extraVolumeMounts | trim | nindent 10 }}{{ end }}
|
|
||||||
{{- if .Values.usePodSecurityContext }}
|
|
||||||
securityContext:
|
|
||||||
runAsUser: {{ default 0 .Values.runAsUser }}
|
|
||||||
{{- if and (.Values.runAsUser) (.Values.fsGroup) }}
|
|
||||||
{{- if not (eq .Values.runAsUser 0.0) }}
|
|
||||||
fsGroup: {{ .Values.fsGroup }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
resources:
|
|
||||||
{{ toYaml .Values.resources | indent 12 }}
|
|
||||||
{{- if .Values.hostMounts }}
|
|
||||||
securityContext:
|
|
||||||
privileged: true
|
|
||||||
{{- end }}
|
|
||||||
volumes:
|
|
||||||
- name: config
|
|
||||||
{{- if .Values.persistence.enabled }}
|
|
||||||
{{- if .Values.persistence.hostPath }}
|
|
||||||
hostPath:
|
|
||||||
path: {{.Values.persistence.hostPath}}
|
|
||||||
type: Directory
|
|
||||||
{{- else }}
|
|
||||||
persistentVolumeClaim:
|
|
||||||
claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ template "esphome.fullname" . }}{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
{{- else }}
|
|
||||||
emptyDir: {}
|
|
||||||
{{ end }}
|
|
||||||
{{- range .Values.hostMounts }}
|
|
||||||
- name: {{ .name }}
|
|
||||||
hostPath:
|
|
||||||
path: {{.hostPath}}
|
|
||||||
{{- if .type }}
|
|
||||||
type: {{ .type }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
{{- if .Values.git.enabled }}
|
|
||||||
- name: git-secret
|
|
||||||
secret:
|
|
||||||
defaultMode: 256
|
|
||||||
secretName: {{ .Values.git.secret }}
|
|
||||||
optional: true
|
|
||||||
{{ end }}
|
|
||||||
{{- if .Values.extraVolumes }}{{ toYaml .Values.extraVolumes | trim | nindent 6 }}{{ end }}
|
|
||||||
{{- with .Values.nodeSelector }}
|
|
||||||
nodeSelector:
|
|
||||||
{{ toYaml . | indent 8 }}
|
|
||||||
{{- end }}
|
|
||||||
{{- with .Values.affinity }}
|
|
||||||
affinity:
|
|
||||||
{{ toYaml . | indent 8 }}
|
|
||||||
{{- end }}
|
|
||||||
{{- with .Values.tolerations }}
|
|
||||||
tolerations:
|
|
||||||
{{ toYaml . | indent 8 }}
|
|
||||||
{{- end }}
|
|
@ -1,39 +0,0 @@
|
|||||||
{{- if .Values.ingress.enabled -}}
|
|
||||||
{{- $fullName := include "esphome.fullname" . -}}
|
|
||||||
{{- $servicePort := .Values.service.port -}}
|
|
||||||
{{- $ingressPath := .Values.ingress.path -}}
|
|
||||||
apiVersion: extensions/v1beta1
|
|
||||||
kind: Ingress
|
|
||||||
metadata:
|
|
||||||
name: {{ $fullName }}
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/name: {{ include "esphome.name" . }}
|
|
||||||
helm.sh/chart: {{ include "esphome.chart" . }}
|
|
||||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
||||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
|
||||||
{{- with .Values.ingress.annotations }}
|
|
||||||
annotations:
|
|
||||||
{{ toYaml . | indent 4 }}
|
|
||||||
{{- end }}
|
|
||||||
spec:
|
|
||||||
{{- if .Values.ingress.tls }}
|
|
||||||
tls:
|
|
||||||
{{- range .Values.ingress.tls }}
|
|
||||||
- hosts:
|
|
||||||
{{- range .hosts }}
|
|
||||||
- {{ . | quote }}
|
|
||||||
{{- end }}
|
|
||||||
secretName: {{ .secretName }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
rules:
|
|
||||||
{{- range .Values.ingress.hosts }}
|
|
||||||
- host: {{ . }}
|
|
||||||
http:
|
|
||||||
paths:
|
|
||||||
- path: {{ $ingressPath }}
|
|
||||||
backend:
|
|
||||||
serviceName: {{ $fullName }}
|
|
||||||
servicePort: {{ $servicePort }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
@ -1,26 +0,0 @@
|
|||||||
{{- if .Values.persistence.enabled -}}
|
|
||||||
{{- if not .Values.persistence.existingClaim -}}
|
|
||||||
kind: PersistentVolumeClaim
|
|
||||||
apiVersion: v1
|
|
||||||
metadata:
|
|
||||||
name: {{ template "esphome.fullname" . }}
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/name: {{ include "esphome.name" . }}
|
|
||||||
helm.sh/chart: {{ include "esphome.chart" . }}
|
|
||||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
||||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
|
||||||
spec:
|
|
||||||
accessModes:
|
|
||||||
- {{ .Values.persistence.accessMode | quote }}
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
storage: {{ .Values.persistence.size | quote }}
|
|
||||||
{{- if .Values.persistence.storageClass }}
|
|
||||||
{{- if (eq "-" .Values.persistence.storageClass) }}
|
|
||||||
storageClassName: ""
|
|
||||||
{{- else }}
|
|
||||||
storageClassName: "{{ .Values.persistence.storageClass }}"
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end -}}
|
|
||||||
{{- end -}}
|
|
@ -1,56 +0,0 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: Service
|
|
||||||
metadata:
|
|
||||||
name: {{ template "esphome.fullname" . }}
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/name: {{ include "esphome.name" . }}
|
|
||||||
helm.sh/chart: {{ include "esphome.chart" . }}
|
|
||||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
||||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
|
||||||
{{- if .Values.service.labels }}
|
|
||||||
{{ toYaml .Values.service.labels | indent 4 }}
|
|
||||||
{{- end }}
|
|
||||||
{{- with .Values.service.annotations }}
|
|
||||||
annotations:
|
|
||||||
{{ toYaml . | indent 4 }}
|
|
||||||
{{- end }}
|
|
||||||
spec:
|
|
||||||
{{- if (or (eq .Values.service.type "ClusterIP") (empty .Values.service.type)) }}
|
|
||||||
type: ClusterIP
|
|
||||||
{{- if .Values.service.clusterIP }}
|
|
||||||
clusterIP: {{ .Values.service.clusterIP }}
|
|
||||||
{{end}}
|
|
||||||
{{- else if eq .Values.service.type "LoadBalancer" }}
|
|
||||||
type: {{ .Values.service.type }}
|
|
||||||
{{- if .Values.service.loadBalancerIP }}
|
|
||||||
loadBalancerIP: {{ .Values.service.loadBalancerIP }}
|
|
||||||
{{- end }}
|
|
||||||
{{- if .Values.service.externalTrafficPolicy }}
|
|
||||||
externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy }}
|
|
||||||
{{- end }}
|
|
||||||
{{- if .Values.service.loadBalancerSourceRanges }}
|
|
||||||
loadBalancerSourceRanges:
|
|
||||||
{{ toYaml .Values.service.loadBalancerSourceRanges | indent 4 }}
|
|
||||||
{{- end -}}
|
|
||||||
{{- else }}
|
|
||||||
type: {{ .Values.service.type }}
|
|
||||||
{{- end }}
|
|
||||||
{{- if .Values.service.externalIPs }}
|
|
||||||
externalIPs:
|
|
||||||
{{ toYaml .Values.service.externalIPs | indent 4 }}
|
|
||||||
{{- end }}
|
|
||||||
publishNotReadyAddresses: {{ .Values.service.publishNotReadyAddresses }}
|
|
||||||
ports:
|
|
||||||
- name: {{ .Values.service.portName }}
|
|
||||||
port: {{ .Values.service.port }}
|
|
||||||
protocol: TCP
|
|
||||||
targetPort: 6052
|
|
||||||
{{ if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePort))) }}
|
|
||||||
nodePort: {{.Values.service.nodePort}}
|
|
||||||
{{ end }}
|
|
||||||
{{- if .Values.service.additionalPorts }}
|
|
||||||
{{- .Values.service.additionalPorts | toYaml | indent 4 }}
|
|
||||||
{{- end }}
|
|
||||||
selector:
|
|
||||||
app.kubernetes.io/name: {{ include "esphome.name" . }}
|
|
||||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
@ -1,176 +1,39 @@
|
|||||||
# Default values for esphome.
|
# Default values for Bazarr.
|
||||||
# This is a YAML-formatted file.
|
|
||||||
# Declare variables to be passed into your templates.
|
|
||||||
|
|
||||||
image:
|
image:
|
||||||
repository: esphome/esphome
|
repository: esphome/esphome
|
||||||
tag: 1.15.3
|
|
||||||
pullPolicy: IfNotPresent
|
pullPolicy: IfNotPresent
|
||||||
pullSecrets: []
|
tag: 1.15.3
|
||||||
|
|
||||||
# upgrade strategy type (e.g. Recreate or RollingUpdate)
|
strategy:
|
||||||
strategyType: Recreate
|
type: Recreate
|
||||||
|
|
||||||
# Probes configuration
|
|
||||||
probes:
|
|
||||||
liveness:
|
|
||||||
enabled: true
|
|
||||||
scheme: HTTP
|
|
||||||
initialDelaySeconds: 60
|
|
||||||
failureThreshold: 5
|
|
||||||
timeoutSeconds: 10
|
|
||||||
readiness:
|
|
||||||
enabled: true
|
|
||||||
scheme: HTTP
|
|
||||||
initialDelaySeconds: 60
|
|
||||||
failureThreshold: 5
|
|
||||||
timeoutSeconds: 10
|
|
||||||
startup:
|
|
||||||
enabled: false
|
|
||||||
scheme: HTTP
|
|
||||||
failureThreshold: 30
|
|
||||||
periodSeconds: 10
|
|
||||||
service:
|
service:
|
||||||
type: ClusterIP
|
port:
|
||||||
port: 6052
|
port: 6052
|
||||||
portName: api
|
|
||||||
additionalPorts: []
|
|
||||||
# - name: homematicproxy
|
|
||||||
# port: 2001
|
|
||||||
# targetPort: 2001
|
|
||||||
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: []
|
|
||||||
loadBalancerIP: ""
|
|
||||||
loadBalancerSourceRanges: []
|
|
||||||
# nodePort: 30000
|
|
||||||
publishNotReadyAddresses: false
|
|
||||||
|
|
||||||
ingress:
|
env: {}
|
||||||
enabled: false
|
# ESPHOME_DASHBOARD_USE_PING: true
|
||||||
annotations: {}
|
# ESPHOME_DASHBOARD_RELATIVE_URL: "/"
|
||||||
# kubernetes.io/ingress.class: nginx
|
# ESPHOME_QUICKWIZARD:
|
||||||
# kubernetes.io/tls-acme: "true"
|
# ESPHOME_IS_HASSIO:
|
||||||
path: /
|
# DISABLE_HA_AUTHENTICATION:
|
||||||
hosts:
|
# USERNAME:
|
||||||
- esphome.local
|
# PASSWORD:
|
||||||
tls: []
|
|
||||||
# - secretName: esphome-tls
|
|
||||||
# hosts:
|
|
||||||
# - esphome.local
|
|
||||||
|
|
||||||
hostNetwork: false
|
|
||||||
|
|
||||||
persistence:
|
persistence:
|
||||||
enabled: true
|
config:
|
||||||
## esphome data Persistent Volume Storage Class
|
enabled: false
|
||||||
## If defined, storageClassName: <storageClass>
|
emptyDir: false
|
||||||
## If set to "-", storageClassName: "", which disables dynamic provisioning
|
## Persistent Volume Storage Class
|
||||||
## If undefined (the default) or set to null, no storageClassName spec is
|
## If defined, storageClassName: <storageClass>
|
||||||
## set, choosing the default provisioner. (gp2 on AWS, standard on
|
## If set to "-", storageClassName: "", which disables dynamic provisioning
|
||||||
## GKE, AWS & OpenStack)
|
## If undefined (the default) or set to null, no storageClassName spec is
|
||||||
##
|
## set, choosing the default provisioner. (gp2 on AWS, standard on
|
||||||
# storageClass: "-"
|
## GKE, AWS & OpenStack)
|
||||||
##
|
# storageClass: "-"
|
||||||
## If you want to reuse an existing claim, you can pass the name of the PVC using
|
# accessMode: ReadWriteOnce
|
||||||
## the existingClaim variable
|
# size: 1Gi
|
||||||
# existingClaim: your-claim
|
## Do not delete the pvc upon helm uninstall
|
||||||
##
|
# skipuninstall: false
|
||||||
## If you want to use a volume on the host machine instead of a PVC:
|
# existingClaim: ""
|
||||||
# hostPath: /path/to/the/config/folder
|
|
||||||
accessMode: ReadWriteOnce
|
|
||||||
size: 1Gi
|
|
||||||
|
|
||||||
## Additional hass container environment variable
|
|
||||||
## For instance to add a http_proxy
|
|
||||||
##
|
|
||||||
extraEnv: {}
|
|
||||||
|
|
||||||
## Additional hass container environment variable from k8s secrets
|
|
||||||
## For instance to add a password
|
|
||||||
## can use `!env_var` in the esphome configuration to reference these variables
|
|
||||||
extraEnvSecrets:
|
|
||||||
# Example
|
|
||||||
# This will set ${MQTT_PASSWORD} to the 'password' key from the 'mqtt' secret
|
|
||||||
# MQTT_PASSWORD:
|
|
||||||
# secret: mqtt
|
|
||||||
# key: password
|
|
||||||
|
|
||||||
## If you'd like to provide your own Kubernetes Secret object instead of passing your values
|
|
||||||
## individually, pass in the name of a created + populated Secret.
|
|
||||||
## All secrets will be mounted as environment variables, with each key/value mapping to a
|
|
||||||
## corresponding environment variable.
|
|
||||||
##
|
|
||||||
extraSecretForEnvFrom: []
|
|
||||||
# - esphome-secrets
|
|
||||||
|
|
||||||
# Enable pod security context (must be `true` if runAsUser or fsGroup are set)
|
|
||||||
usePodSecurityContext: true
|
|
||||||
# Set runAsUser to 1000 to let esphome run as non-root user.
|
|
||||||
# When setting runAsUser to a different value than 0 also set fsGroup to the same value:
|
|
||||||
# runAsUser: <defaults to 0>
|
|
||||||
# fsGroup: <will be omitted in deployment if runAsUser is 0>
|
|
||||||
|
|
||||||
# Mount devices or folders from the host machine. Can be used for USB device mounting.
|
|
||||||
hostMounts: []
|
|
||||||
# Example
|
|
||||||
# - name: zha
|
|
||||||
# hostPath: /dev/serial/by-id/usb-Silicon_Labs_HubZ_Smart_Home_Controller_6120245D-if01-port0
|
|
||||||
|
|
||||||
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
|
|
||||||
# resources, such as Minikube. If you do want to specify resources, uncomment the following
|
|
||||||
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
|
|
||||||
# limits:
|
|
||||||
# cpu: 100m
|
|
||||||
# memory: 128Mi
|
|
||||||
# requests:
|
|
||||||
# cpu: 100m
|
|
||||||
# memory: 128Mi
|
|
||||||
|
|
||||||
nodeSelector: {}
|
|
||||||
|
|
||||||
tolerations: []
|
|
||||||
|
|
||||||
affinity: {}
|
|
||||||
|
|
||||||
podAnnotations: {}
|
|
||||||
|
|
||||||
# Any extra volumes to define for the pod
|
|
||||||
extraVolumes: []
|
|
||||||
# - name: example-name
|
|
||||||
# hostPath:
|
|
||||||
# path: /path/on/host
|
|
||||||
# type: DirectoryOrCreate
|
|
||||||
|
|
||||||
# Any extra volume mounts to define for the containers
|
|
||||||
extraVolumeMounts: []
|
|
||||||
# - name: example-name
|
|
||||||
# mountPath: /path/in/container
|
|
||||||
|
|
||||||
|
|
||||||
git:
|
|
||||||
enabled: false
|
|
||||||
|
|
||||||
image:
|
|
||||||
repository: k8sathome/git-crypt
|
|
||||||
tag: 2020.09.28
|
|
||||||
pullPolicy: IfNotPresent
|
|
||||||
|
|
||||||
## Specify the command that runs in the git-sync container to pull in configuration.
|
|
||||||
# command: []
|
|
||||||
|
|
||||||
# Committer settings
|
|
||||||
user:
|
|
||||||
name: ""
|
|
||||||
email: ""
|
|
||||||
|
|
||||||
repo: ""
|
|
||||||
secret: git-creds
|
|
||||||
syncPath: /config
|
|
||||||
keyPath: /root/.ssh
|
|
||||||
|
Loading…
Reference in New Issue
Block a user