Skip to content

Commit

Permalink
Merge pull request #38 from JacekZubielik/esphome
Browse files Browse the repository at this point in the history
build(appversion): bump to 2024.5.4
  • Loading branch information
JacekZubielik authored Jun 4, 2024
2 parents 203d3cb + ae43d75 commit 7f80afe
Show file tree
Hide file tree
Showing 8 changed files with 174 additions and 147 deletions.
8 changes: 4 additions & 4 deletions charts/esphome/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
---
apiVersion: v2
appVersion: 2024.2.1
appVersion: 2024.5.4
description: ESPHome
name: esphome
version: 0.0.3
version: 0.0.4
keywords:
- esphome
- esphome
type: application
home: https://github.com/JacekZubielik/jz-helm-charts/tree/master/charts/esphome
icon: https://esphome.io/_images/logo-text.svg
sources:
- https://github.com/esphome/esphome
- https://github.com/esphome/esphome
maintainers:
- name: jacekzubielik
2 changes: 1 addition & 1 deletion charts/esphome/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ app.kubernetes.io/instance: {{ .Release.Name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
{{- end }}
142 changes: 81 additions & 61 deletions charts/esphome/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,29 @@ kind: Deployment
metadata:
name: {{ template "app.fullname" . }}
labels:
{{- include "app.labels" . | nindent 4 }}
app.kubernetes.io/name: {{ include "app.name" . }}
helm.sh/chart: {{ include "app.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
replicas: {{ .Values.replicas }}
revisionHistoryLimit: {{ .Values.revisionHistoryLimit }}
selector:
matchLabels:
{{- include "app.selectorLabels" . | nindent 6 }}
app.kubernetes.io/name: {{ include "app.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
strategy:
type: {{ .Values.strategyType }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "app.selectorLabels" . | nindent 8 }}
{{- if .Values.podLabels }}
{{- toYaml .Values.podLabels | nindent 8 }}
app.kubernetes.io/name: {{ include "app.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 }}
Expand All @@ -43,6 +47,50 @@ spec:
{{- toYaml .Values.podSecurityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: api
containerPort: {{ .Values.service.httpPort }}
protocol: TCP
- name: metrics
containerPort: {{ .Values.service.metricsPort }}
protocol: TCP
{{- range .Values.service.additionalPorts }}
- name: {{ .name }}
containerPort: {{ .targetPort }}
{{- end }}
{{- if .Values.livenessProbe.enabled }}
livenessProbe:
httpGet:
path: /ping
port: {{ .Values.service.httpPort }}
scheme: {{ .Values.livenessProbe.scheme }}
periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
successThreshold: {{ .Values.livenessProbe.successThreshold }}
failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds}}
{{- end }}
{{- if .Values.readinessProbe.enabled }}
readinessProbe:
httpGet:
path: /ping
port: {{ .Values.service.httpPort }}
scheme: {{ .Values.livenessProbe.scheme }}
periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}
successThreshold: {{ .Values.readinessProbe.successThreshold }}
failureThreshold: {{ .Values.readinessProbe.failureThreshold }}
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds}}
{{- end }}
{{- if .Values.startupProbe.enabled }}
startupProbe:
httpGet:
path: /ping
port: {{ .Values.service.httpPort }}
scheme: {{ .Values.startupProbe.scheme }}
failureThreshold: {{ .Values.startupProbe.failureThreshold }}
periodSeconds: {{ .Values.startupProbe.periodSeconds }}
{{- end }}
env:
{{- range $key, $value := .Values.extraEnv }}
- name: {{ $key | }}
Expand All @@ -62,40 +110,9 @@ spec:
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
ports:
- name: api
containerPort: {{ .Values.service.httpPort }}
protocol: TCP
- name: metrics
containerPort: {{ .Values.service.metricsPort }}
protocol: TCP
{{- if .Values.livenessProbe.enabled }}
livenessProbe:
httpGet:
path: /ping
port: {{ .Values.service.httpPort }}
scheme: {{ .Values.livenessProbe.scheme }}
periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
successThreshold: {{ .Values.livenessProbe.successThreshold }}
failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds}}
{{- end }}
{{- if .Values.readinessProbe.enabled }}
readinessProbe:
httpGet:
path: /ping
port: {{ .Values.service.httpPort }}
scheme: {{ .Values.livenessProbe.scheme }}
periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}
successThreshold: {{ .Values.readinessProbe.successThreshold }}
failureThreshold: {{ .Values.readinessProbe.failureThreshold }}
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds}}
{{- end }}
volumeMounts:
- mountPath: /config
name: config-storage
name: config
{{- range .Values.hostMounts }}
{{- if .mountPath }}
- mountPath: {{ .mountPath }}
Expand All @@ -104,37 +121,40 @@ spec:
{{- end }}
name: {{ .name }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.extraVolumeMounts }}{{ toYaml .Values.extraVolumeMounts | trim | nindent 10 }}
{{ end }}
volumes:
- name: config-storage
- name: config
{{- if .Values.persistence.enabled }}
{{- if .Values.persistence.configstorage.hostPath }}
{{- if .Values.persistence.hostPath }}
hostPath:
path: {{.Values.persistence.configstorage.hostPath}}
{{- else }}
path: {{.Values.persistence.hostPath}}
type: Directory
{{- else }}
persistentVolumeClaim:
claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ template "app.fullname" . }}{{- end }}
claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ template "app.fullname" . }}
{{- end }}
{{- end }}
{{- else }}
emptyDir: {}
{{ end }}
{{- range .Values.hostMounts }}
{{- range .Values.hostMounts }}
- name: {{ .name }}
hostPath:
path: {{.hostPath}}
{{- if .type }}
{{- if .type }}
type: {{ .type }}
{{- end }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}

57 changes: 16 additions & 41 deletions charts/esphome/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,64 +1,39 @@
{{- if .Values.ingress.enabled -}}
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "app.fullname" . -}}
{{- $servicePort := .Values.service.http -}}
{{- $ingressPath := .Values.ingress.path -}}
{{- $new := false }}
{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1" -}}
apiVersion: networking.k8s.io/v1
{{- $new = true }}
{{- else }}
{{- $servicePort := .Values.service.port -}}
{{- $ingressPath := .Values.ingress.path -}}
apiVersion: extensions/v1beta1
{{- end }}
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
{{- include "app.labels" . | nindent 4 }}
app.kubernetes.io/name: {{ include "app.name" . }}
helm.sh/chart: {{ include "app.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- with .Values.ingress.annotations }}
annotations:
{{- if not $new }}
kubernetes.io/ingress.class: {{ required "If ingress.enabled is set to true, ingress.class is required" .Values.ingress.class }}
{{- end }}
{{- if .Values.ingress.annotations }}
{{- toYaml .Values.ingress.annotations | nindent 4 }}
{{- end }}
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{- if $new }}
ingressClassName: {{ required "If ingress.enabled is set to true, ingress.class is required" .Values.ingress.class }}
{{- end }}
{{- if .Values.ingress.tls }}
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
{{- end }}
rules:
{{- if $new }}
{{- range .Values.ingress.hosts }}
- host: {{ . }}
http:
paths:
- path: {{ $ingressPath }}
pathType: Prefix
backend:
service:
name: {{ $fullName }}
port:
number: {{ $servicePort }}
{{- end }}
{{- else }}
{{- range .Values.ingress.hosts }}
{{- range .Values.ingress.hosts }}
- host: {{ . }}
http:
paths:
- path: {{ $ingressPath }}
backend:
serviceName: {{ $fullName }}
servicePort: {{ $servicePort }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}

27 changes: 16 additions & 11 deletions charts/esphome/templates/pvc.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
{{- if and .Values.persistence.pvc.enabled (not .Values.persistence.configstorage.hostPath) }}
{{- if .Values.persistence.enabled -}}
{{- if not .Values.persistence.existingClaim -}}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ template "app.fullname" . }}
labels:
{{- include "app.labels" . | nindent 4 }}
app.kubernetes.io/name: {{ include "app.name" . }}
helm.sh/chart: {{ include "app.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
accessModes:
- {{ .Values.persistence.pvc.accessMode }}
- {{ .Values.persistence.accessMode | quote }}
resources:
requests:
storage: {{ .Values.persistence.pvc.size }}
{{- if .Values.persistence.pvc.storageClass }}
{{- if (eq "-" .Values.persistence.pvc.storageClass) }}
storage: {{ .Values.persistence.size | quote }}
{{- if .Values.persistence.storageClass }}
{{- if (eq "-" .Values.persistence.storageClass) }}
storageClassName: ""
{{- else }}
storageClassName: "{{ .Values.persistence.pvc.storageClass }}"
{{- end }}
{{- end }}
{{- end }}
{{- else }}
storageClassName: "{{ .Values.persistence.storageClass }}"
{{- end }}
{{- end }}
{{- end -}}
{{- end -}}
30 changes: 19 additions & 11 deletions charts/esphome/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
apiVersion: v1
kind: Service
metadata:
{{- if .Values.service.annotations }}
annotations:
{{- toYaml .Values.service.annotations | nindent 4 }}
{{- end }}
name: {{ template "app.fullname" . }}
labels:
{{- include "app.labels" . | nindent 4 }}
{{- if .Values.service.labels }}
{{ toYaml .Values.service.labels | indent 4 }}
{{- end }}
app.kubernetes.io/name: {{ include "app.name" . }}
helm.sh/chart: {{ include "app.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:
type: {{ .Values.service.type }}
{{- if .Values.service.externalIPs }}
Expand All @@ -29,13 +36,14 @@ spec:
{{- end }}
publishNotReadyAddresses: {{ .Values.service.publishNotReadyAddresses }}
ports:
- name: api
port: {{ .Values.service.httpPort }}
- name: api
port: {{ .Values.service.httpPort }}
protocol: TCP
targetPort: {{ .Values.service.httpPort }}
- name: metrics
port: {{ .Values.service.metricsPort }}
protocol: TCP
targetPort: metrics
selector:
{{- include "app.selectorLabels" . | nindent 4 }}
app.kubernetes.io/name: {{ include "app.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
2 changes: 1 addition & 1 deletion charts/esphome/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ spec:
{{- end }}
{{- end }}
jobLabel: {{ template "app.fullname" . }}-prometheus-exporter
{{- end }}
{{- end }}
Loading

0 comments on commit 7f80afe

Please sign in to comment.