diff --git a/apps/charts/blinko/Chart.yaml b/apps/charts/blinko/Chart.yaml index ec3c4b3..ba6e05a 100644 --- a/apps/charts/blinko/Chart.yaml +++ b/apps/charts/blinko/Chart.yaml @@ -1,3 +1,7 @@ apiVersion: v2 version: 1.0.0 name: blinko +dependencies: + - name: common + version: 1.0.0 + repository: file://../common diff --git a/apps/charts/blinko/templates/deployment.yaml b/apps/charts/blinko/templates/deployment.yaml index 324efbb..4508e33 100644 --- a/apps/charts/blinko/templates/deployment.yaml +++ b/apps/charts/blinko/templates/deployment.yaml @@ -1,57 +1 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: "{{ .Release.Name }}" -spec: - strategy: - type: RollingUpdate - replicas: 1 - revisionHistoryLimit: 0 - 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: 1111 - protocol: TCP - livenessProbe: - tcpSocket: - port: http - readinessProbe: - tcpSocket: - port: http - volumeMounts: - - mountPath: /data - name: data - env: - - name: TZ - value: "{{ .Values.globals.timezone }}" - - name: NODE_ENV - value: "production" - - name: NEXTAUTH_URL - value: "https://{{ .Values.subdomain }}.{{ .Values.globals.domain }}" - - name: NEXT_PUBLIC_BASE_URL - value: "https://{{ .Values.subdomain }}.{{ .Values.globals.domain }}" - - name: NEXTAUTH_SECRET - valueFrom: - secretKeyRef: - name: "{{ .Release.Name }}-secrets" - key: betterauth - - name: DATABASE_URL - valueFrom: - secretKeyRef: - name: "{{ .Release.Name }}-pg-connection" - key: url - volumes: - - name: data - persistentVolumeClaim: - claimName: "{{ .Release.Name }}-data" +{{ include "common.deployment" . }} diff --git a/apps/charts/blinko/templates/pvc.yaml b/apps/charts/blinko/templates/pvc.yaml index bc1d0a6..379bad9 100644 --- a/apps/charts/blinko/templates/pvc.yaml +++ b/apps/charts/blinko/templates/pvc.yaml @@ -1,11 +1 @@ -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: '{{ .Release.Name }}-data' -spec: - accessModes: - - 'ReadWriteOnce' - resources: - requests: - storage: '1Gi' - storageClassName: '{{ .Values.globals.environment }}' +{{ include "common.pvc" . }} diff --git a/apps/charts/blinko/templates/service.yaml b/apps/charts/blinko/templates/service.yaml index a76f45e..f024c64 100644 --- a/apps/charts/blinko/templates/service.yaml +++ b/apps/charts/blinko/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: 1111 - protocol: TCP - name: http - selector: - app: '{{ .Release.Name }}' +{{ include "common.service" . }} diff --git a/apps/charts/blinko/templates/virtual-service.yaml b/apps/charts/blinko/templates/virtual-service.yaml index 36e9d43..766f6b9 100644 --- a/apps/charts/blinko/templates/virtual-service.yaml +++ b/apps/charts/blinko/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/blinko/values.yaml b/apps/charts/blinko/values.yaml index 078b62d..6c4d197 100644 --- a/apps/charts/blinko/values.yaml +++ b/apps/charts/blinko/values.yaml @@ -2,4 +2,59 @@ image: repository: blinkospace/blinko tag: latest@sha256:6db31658e58a0af9d2e15312de995fb3bb3d04db30b2fe500ed4ff0360c57518 pullPolicy: IfNotPresent + subdomain: blinko + +# Deployment configuration +deployment: + strategy: RollingUpdate + replicas: 1 + revisionHistoryLimit: 0 + +# Container configuration +container: + port: 1111 + healthProbe: + type: tcpSocket + port: http # Use named port + +# Service configuration +service: + port: 80 + type: ClusterIP + +# Volume configuration +volumes: + - name: data + mountPath: /data + persistentVolumeClaim: data + +# Persistent volume claims +persistentVolumeClaims: + - name: data + size: 1Gi + +# VirtualService configuration +virtualService: + enabled: true + gateways: + public: true + private: true + +# Environment variables +env: + NODE_ENV: "production" + NEXTAUTH_URL: + value: "https://{subdomain}.{domain}" + NEXT_PUBLIC_BASE_URL: + value: "https://{subdomain}.{domain}" + NEXTAUTH_SECRET: + valueFrom: + secretKeyRef: + name: "{release}-secrets" + key: betterauth + DATABASE_URL: + valueFrom: + secretKeyRef: + name: "{release}-pg-connection" + key: url diff --git a/apps/charts/common/common-1.0.0.tgz b/apps/charts/common/common-1.0.0.tgz index 5103967..b59541e 100644 Binary files a/apps/charts/common/common-1.0.0.tgz and b/apps/charts/common/common-1.0.0.tgz differ