Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade common chart. Allow split api/worker config. #137

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

midzelis
Copy link

  • Upgrade to latest charts library.
  • Allow new top level config for 'worker' which allows separating api/web from microservices, and these can be independently scaled
  • Add check to only configure server or worker, not both
  • Move env and image.tag to immich section
  • Add debug template to dump objs (useful for dev improvements to the chart)

Note - this is a breaking change, and chart's major version has been revved.

@midzelis midzelis requested a review from bo0tzz October 24, 2024 03:57
Copy link

Changes in Final Manifest

  • manifest.yaml

manifest.yaml

--- a/main/charts/immich/build/manifest.yaml
+++ b/charts/immich/build/manifest.yaml
@@ -5,21 +5,21 @@ kind: Service
 metadata:
   name: immich-machine-learning
   labels:
-    app.kubernetes.io/service: immich-machine-learning
     app.kubernetes.io/instance: immich
     app.kubernetes.io/managed-by: Helm
     app.kubernetes.io/name: machine-learning
+    app.kubernetes.io/service: immich-machine-learning
     app.kubernetes.io/version: v1.118.0
-    helm.sh/chart: immich-0.8.2
-  annotations:
+    helm.sh/chart: immich-0.9.0
 spec:
   type: ClusterIP
   ports:
     - port: 3003
-      targetPort: http
+      targetPort: 3003
       protocol: TCP
       name: http
   selector:
+    app.kubernetes.io/component: machine-learning
     app.kubernetes.io/instance: immich
     app.kubernetes.io/name: machine-learning
 ---
@@ -29,21 +29,21 @@ kind: Service
 metadata:
   name: immich-server
   labels:
-    app.kubernetes.io/service: immich-server
     app.kubernetes.io/instance: immich
     app.kubernetes.io/managed-by: Helm
     app.kubernetes.io/name: server
+    app.kubernetes.io/service: immich-server
     app.kubernetes.io/version: v1.118.0
-    helm.sh/chart: immich-0.8.2
-  annotations:
+    helm.sh/chart: immich-0.9.0
 spec:
   type: ClusterIP
   ports:
     - port: 2283
-      targetPort: http
+      targetPort: 2283
       protocol: TCP
       name: http
   selector:
+    app.kubernetes.io/component: immich-server
     app.kubernetes.io/instance: immich
     app.kubernetes.io/name: server
 ---
@@ -53,11 +53,12 @@ kind: Deployment
 metadata:
   name: immich-machine-learning
   labels:
+    app.kubernetes.io/component: machine-learning
     app.kubernetes.io/instance: immich
     app.kubernetes.io/managed-by: Helm
     app.kubernetes.io/name: machine-learning
     app.kubernetes.io/version: v1.118.0
-    helm.sh/chart: immich-0.8.2
+    helm.sh/chart: immich-0.9.0
 spec:
   revisionHistoryLimit: 3
   replicas: 1
@@ -65,65 +66,33 @@ spec:
     type: Recreate
   selector:
     matchLabels:
+      app.kubernetes.io/component: machine-learning
       app.kubernetes.io/name: machine-learning
       app.kubernetes.io/instance: immich
   template:
     metadata:
-      labels:
-        app.kubernetes.io/name: machine-learning
+      labels: 
+        app.kubernetes.io/component: machine-learning
         app.kubernetes.io/instance: immich
-    spec:
-      
+        app.kubernetes.io/name: machine-learning
+    spec: 
+      enableServiceLinks: false
       serviceAccountName: default
       automountServiceAccountToken: true
+      hostIPC: false
+      hostNetwork: false
+      hostPID: false
       dnsPolicy: ClusterFirst
-      enableServiceLinks: true
-      containers:
-        - name: immich-machine-learning
-          image: ghcr.io/immich-app/immich-machine-learning:v1.118.0
+      containers: 
+        - image: ghcr.io/immich-app/immich-machine-learning:v1.118.0
           imagePullPolicy: IfNotPresent
-          env:
-            - name: DB_DATABASE_NAME
-              value: immich
-            - name: DB_HOSTNAME
-              value: immich-postgresql
-            - name: DB_PASSWORD
-              value: immich
-            - name: DB_USERNAME
-              value: immich
-            - name: IMMICH_MACHINE_LEARNING_URL
-              value: http://immich-machine-learning:3003
-            - name: REDIS_HOSTNAME
-              value: immich-redis-master
-            - name: TRANSFORMERS_CACHE
-              value: /cache
-          ports:
-            - name: http
-              containerPort: 3003
-              protocol: TCP
+          name: main
           volumeMounts:
-            - name: cache
-              mountPath: /cache
-          livenessProbe:
-            failureThreshold: 3
-            httpGet:
-              path: /ping
-              port: http
-            initialDelaySeconds: 0
-            periodSeconds: 10
-            timeoutSeconds: 1
-          readinessProbe:
-            failureThreshold: 3
-            httpGet:
-              path: /ping
-              port: http
-            initialDelaySeconds: 0
-            periodSeconds: 10
-            timeoutSeconds: 1
-      volumes:
-        - name: cache
-          emptyDir:
-            {}
+          - mountPath: /cache
+            name: cache
+      volumes: 
+        - emptyDir: {}
+          name: cache
 ---
 # Source: immich/templates/server.yaml
 apiVersion: apps/v1
@@ -131,11 +100,12 @@ kind: Deployment
 metadata:
   name: immich-server
   labels:
+    app.kubernetes.io/component: immich-server
     app.kubernetes.io/instance: immich
     app.kubernetes.io/managed-by: Helm
     app.kubernetes.io/name: server
     app.kubernetes.io/version: v1.118.0
-    helm.sh/chart: immich-0.8.2
+    helm.sh/chart: immich-0.9.0
 spec:
   revisionHistoryLimit: 3
   replicas: 1
@@ -143,68 +113,31 @@ spec:
     type: Recreate
   selector:
     matchLabels:
+      app.kubernetes.io/component: immich-server
       app.kubernetes.io/name: server
       app.kubernetes.io/instance: immich
   template:
     metadata:
-      labels:
-        app.kubernetes.io/name: server
+      labels: 
+        app.kubernetes.io/component: immich-server
         app.kubernetes.io/instance: immich
-    spec:
-      
+        app.kubernetes.io/name: server
+    spec: 
+      enableServiceLinks: false
       serviceAccountName: default
       automountServiceAccountToken: true
+      hostIPC: false
+      hostNetwork: false
+      hostPID: false
       dnsPolicy: ClusterFirst
-      enableServiceLinks: true
-      containers:
-        - name: immich-server
-          image: ghcr.io/immich-app/immich-server:v1.118.0
+      containers: 
+        - image: ghcr.io/immich-app/immich-server:v1.118.0
           imagePullPolicy: IfNotPresent
-          env:
-            - name: DB_DATABASE_NAME
-              value: immich
-            - name: DB_HOSTNAME
-              value: immich-postgresql
-            - name: DB_PASSWORD
-              value: immich
-            - name: DB_USERNAME
-              value: immich
-            - name: IMMICH_MACHINE_LEARNING_URL
-              value: http://immich-machine-learning:3003
-            - name: REDIS_HOSTNAME
-              value: immich-redis-master
-          ports:
-            - name: http
-              containerPort: 2283
-              protocol: TCP
+          name: main
           volumeMounts:
-            - name: library
-              mountPath: /usr/src/app/upload
-          livenessProbe:
-            failureThreshold: 3
-            httpGet:
-              path: /api/server/ping
-              port: http
-            initialDelaySeconds: 0
-            periodSeconds: 10
-            timeoutSeconds: 1
-          readinessProbe:
-            failureThreshold: 3
-            httpGet:
-              path: /api/server/ping
-              port: http
-            initialDelaySeconds: 0
-            periodSeconds: 10
-            timeoutSeconds: 1
-          startupProbe:
-            failureThreshold: 30
-            httpGet:
-              path: /api/server/ping
-              port: http
-            initialDelaySeconds: 0
-            periodSeconds: 10
-            timeoutSeconds: 1
-      volumes:
+          - mountPath: /usr/src/app/upload
+            name: library
+      volumes: 
         - name: library
           persistentVolumeClaim:
             claimName: test-pvc

See the workflow run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant