From bdf7900036b770c3da1ca780607dd6c491425546 Mon Sep 17 00:00:00 2001 From: Morten Olsen Date: Thu, 1 Jan 2026 17:49:14 +0100 Subject: [PATCH] migrate baikal to new helper chart --- apps/charts/baikal/Chart.yaml | 6 ++- apps/charts/baikal/templates/deployment.yaml | 47 +------------------ apps/charts/baikal/templates/pvc.yaml | 25 +--------- apps/charts/baikal/templates/service.yaml | 16 +------ .../baikal/templates/virtual-service.yaml | 40 +--------------- apps/charts/baikal/values.yaml | 42 +++++++++++++++++ 6 files changed, 51 insertions(+), 125 deletions(-) diff --git a/apps/charts/baikal/Chart.yaml b/apps/charts/baikal/Chart.yaml index b06614b..a6f1385 100644 --- a/apps/charts/baikal/Chart.yaml +++ b/apps/charts/baikal/Chart.yaml @@ -1,3 +1,7 @@ apiVersion: v2 version: 1.0.0 -name: esphome +name: baikal +dependencies: + - name: common + version: 1.0.0 + repository: file://../common diff --git a/apps/charts/baikal/templates/deployment.yaml b/apps/charts/baikal/templates/deployment.yaml index a661d1a..4508e33 100644 --- a/apps/charts/baikal/templates/deployment.yaml +++ b/apps/charts/baikal/templates/deployment.yaml @@ -1,46 +1 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: "{{ .Release.Name }}" -spec: - strategy: - type: Recreate - replicas: 1 - selector: - matchLabels: - app: "{{ .Release.Name }}" - template: - metadata: - labels: - app: "{{ .Release.Name }}" - spec: - containers: - - name: "{{ .Release.Name }}" - image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" - imagePullPolicy: "{{ .Values.image.pullPolicy }}" - ports: - - name: http - containerPort: 80 - protocol: TCP - livenessProbe: - tcpSocket: - port: http - readinessProbe: - tcpSocket: - port: http - env: - - name: TZ - value: "{{ .Values.globals.timezone }}" - volumeMounts: - - mountPath: /var/www/baikal/Specific - name: data - - mountPath: /var/www/baikal/config - name: config - - volumes: - - name: data - persistentVolumeClaim: - claimName: "{{ .Release.Name }}-data" - - name: config - persistentVolumeClaim: - claimName: "{{ .Release.Name }}-config" +{{ include "common.deployment" . }} diff --git a/apps/charts/baikal/templates/pvc.yaml b/apps/charts/baikal/templates/pvc.yaml index a7bd546..379bad9 100644 --- a/apps/charts/baikal/templates/pvc.yaml +++ b/apps/charts/baikal/templates/pvc.yaml @@ -1,24 +1 @@ -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: "{{ .Release.Name }}-data" -spec: - accessModes: - - "ReadWriteOnce" - resources: - requests: - storage: "1Gi" - storageClassName: "{{ .Values.globals.environment }}" - ---- -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: "{{ .Release.Name }}-config" -spec: - accessModes: - - "ReadWriteOnce" - resources: - requests: - storage: "1Gi" - storageClassName: "{{ .Values.globals.environment }}" +{{ include "common.pvc" . }} diff --git a/apps/charts/baikal/templates/service.yaml b/apps/charts/baikal/templates/service.yaml index 98872d7..f024c64 100644 --- a/apps/charts/baikal/templates/service.yaml +++ b/apps/charts/baikal/templates/service.yaml @@ -1,15 +1 @@ -apiVersion: v1 -kind: Service -metadata: - name: "{{ .Release.Name }}" - labels: - app: "{{ .Release.Name }}" -spec: - type: ClusterIP - ports: - - port: 80 - targetPort: 80 - protocol: TCP - name: http - selector: - app: "{{ .Release.Name }}" +{{ include "common.service" . }} diff --git a/apps/charts/baikal/templates/virtual-service.yaml b/apps/charts/baikal/templates/virtual-service.yaml index 36e9d43..766f6b9 100644 --- a/apps/charts/baikal/templates/virtual-service.yaml +++ b/apps/charts/baikal/templates/virtual-service.yaml @@ -1,39 +1 @@ -apiVersion: networking.istio.io/v1 -kind: VirtualService -metadata: - name: "{{ .Release.Name }}-public" - namespace: "{{ .Release.Namespace }}" -spec: - gateways: - - "{{ .Values.globals.istio.gateways.public }}" - - mesh - hosts: - - "{{ .Values.subdomain }}.{{ .Values.globals.domain }}" - - mesh - http: - - route: - - destination: - host: "{{ .Release.Name }}" - port: - number: 80 - ---- -apiVersion: networking.istio.io/v1 -kind: VirtualService -metadata: - name: "{{ .Release.Name }}-private" - namespace: "{{ .Release.Namespace }}" -spec: - gateways: - - "{{ .Values.globals.istio.gateways.private }}" - - mesh - hosts: - - "{{ .Values.subdomain }}.{{ .Values.globals.domain }}" - - mesh - http: - - route: - - destination: - host: "{{ .Release.Name }}" - port: - number: 80 - +{{ include "common.virtualService" . }} diff --git a/apps/charts/baikal/values.yaml b/apps/charts/baikal/values.yaml index 907858e..8954c04 100644 --- a/apps/charts/baikal/values.yaml +++ b/apps/charts/baikal/values.yaml @@ -2,4 +2,46 @@ image: repository: docker.io/ckulka/baikal tag: 0.10.1-nginx@sha256:434bdd162247cc6aa6f878c9b4dce6216e39e79526b980453b13812d5f8ebf4b pullPolicy: IfNotPresent + subdomain: baikal + +# Deployment configuration +deployment: + strategy: Recreate + replicas: 1 + revisionHistoryLimit: 0 + +# Container configuration +container: + port: 80 + healthProbe: + type: tcpSocket + port: http # Use named port + +# Service configuration +service: + port: 80 + type: ClusterIP + +# Volume configuration +volumes: + - name: data + mountPath: /var/www/baikal/Specific + persistentVolumeClaim: data + - name: config + mountPath: /var/www/baikal/config + persistentVolumeClaim: config + +# Persistent volume claims +persistentVolumeClaims: + - name: data + size: 1Gi + - name: config + size: 1Gi + +# VirtualService configuration +virtualService: + enabled: true + gateways: + public: true + private: true