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

feat(node-red): upgrade to app-template v2 #2172

Merged
merged 2 commits into from
Nov 28, 2023

Conversation

tyriis
Copy link
Owner

@tyriis tyriis commented Nov 28, 2023

No description provided.

@tyriis-automation
Copy link
Contributor

tyriis-automation bot commented Nov 28, 2023

--- kubernetes/talos-flux/apps/home-automation/node-red/app Kustomization: flux-system/apps-node-red HelmRelease: home-automation/node-red

+++ kubernetes/talos-flux/apps/home-automation/node-red/app Kustomization: flux-system/apps-node-red HelmRelease: home-automation/node-red

@@ -8,18 +8,18 @@

   name: node-red
   namespace: home-automation
 spec:
   chart:
     spec:
       chart: app-template
-      interval: 15m
+      interval: 30m
       sourceRef:
         kind: HelmRepository
         name: bjw-s-charts
         namespace: flux-system
-      version: 1.5.1
+      version: 2.3.0
   install:
     createNamespace: true
     remediation:
       retries: 3
   interval: 15m
   maxHistory: 15
@@ -27,67 +27,78 @@

     keepHistory: false
   upgrade:
     cleanupOnFail: true
     remediation:
       retries: 3
   values:
-    env:
-      FLOWS: flows.json
-      NODE_RED_ENABLE_PROJECTS: 'true'
-      NODE_RED_ENABLE_SAFE_MODE: 'false'
-      TZ: ${SETTING_TZ}
-    image:
-      repository: ghcr.io/k8s-at-home/node-red
-      tag: v3.0.2
+    controllers:
+      main:
+        annotations:
+          reloader.stakater.com/auto: 'true'
+        containers:
+          main:
+            env:
+              FLOWS: flows.json
+              NODE_RED_ENABLE_PROJECTS: 'true'
+              NODE_RED_ENABLE_SAFE_MODE: 'false'
+              TZ: ${SETTING_TZ}
+            image:
+              repository: docker.io/nodered/node-red
+              tag: 3.1.0
+            resources:
+              limits:
+                cpu: 1000m
+                memory: 500Mi
+              requests:
+                cpu: 25m
+                memory: 350Mi
+        pod:
+          securityContext:
+            fsGroup: 1000
+            fsGroupChangePolicy: OnRootMismatch
+            runAsGroup: 1000
+            runAsUser: 1000
+        strategy: Recreate
     ingress:
       main:
         annotations:
           cert-manager.io/cluster-issuer: letsencrypt-production
           hajimari.io/enable: 'true'
           hajimari.io/icon: resistor-nodes
           kubernetes.io/tls-acme: 'true'
           traefik.ingress.kubernetes.io/affinity: 'true'
           traefik.ingress.kubernetes.io/router.entrypoints: websecure
           traefik.ingress.kubernetes.io/router.tls: 'true'
+        className: traefik
         enabled: true
         hosts:
         - host: '{{ .Release.Name }}.${SECRET_DOMAIN}'
           paths:
           - path: /
-            pathType: Prefix
-        ingressClassName: traefik
+            service:
+              name: main
+              port: http
         tls:
         - hosts:
           - '{{ .Release.Name }}.${SECRET_DOMAIN}'
           secretName: '{{ .Release.Name }}-tls'
     persistence:
       data:
+        advancedMounts:
+          main:
+            main:
+            - path: /data
         enabled: true
         existingClaim: node-red-data
-        type: pvc
       gitconfig:
-        enabled: true
-        subPath:
-        - mountPath: /usr/src/node-red/.gitconfig
-          path: .gitconfig
-          readOnly: true
-        type: custom
-        volumeSpec:
-          configMap:
-            name: node-red-gitconfig
-    podAnnotations:
-      configmap.reloader.stakater.com/reload: node-red-gitconfig
-    resources:
-      limits:
-        cpu: 1000m
-        memory: 500Mi
-      requests:
-        cpu: 25m
-        memory: 350Mi
+        globalMounts:
+        - path: /usr/src/node-red/.gitconfig
+          readonly: true
+          subPath: .gitconfig
+        name: node-red-gitconfig
+        type: configMap
     service:
       main:
         ports:
           http:
             port: 1880
-    strategy:
-      type: Recreate
 

@tyriis-automation
Copy link
Contributor

tyriis-automation bot commented Nov 28, 2023

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ EDITORCONFIG editorconfig-checker 1 0 0.01s
✅ REPOSITORY gitleaks yes no 1.59s
✅ YAML prettier 1 0 0.47s
✅ YAML yamllint 1 0 0.27s

See detailed report in MegaLinter reports
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security

@tyriis-automation
Copy link
Contributor

--- kubernetes HelmRelease: home-automation/node-red Deployment: home-automation/node-red

+++ kubernetes HelmRelease: home-automation/node-red Deployment: home-automation/node-red

@@ -1,90 +1,95 @@

 ---
 apiVersion: apps/v1
 kind: Deployment
 metadata:
   name: node-red
   labels:
+    app.kubernetes.io/component: main
     app.kubernetes.io/instance: node-red
     app.kubernetes.io/managed-by: Helm
     app.kubernetes.io/name: node-red
+  annotations:
+    reloader.stakater.com/auto: 'true'
 spec:
   revisionHistoryLimit: 3
   replicas: 1
   strategy:
     type: Recreate
   selector:
     matchLabels:
+      app.kubernetes.io/component: main
       app.kubernetes.io/name: node-red
       app.kubernetes.io/instance: node-red
   template:
     metadata:
-      annotations:
-        configmap.reloader.stakater.com/reload: node-red-gitconfig
       labels:
+        app.kubernetes.io/component: main
+        app.kubernetes.io/instance: node-red
         app.kubernetes.io/name: node-red
-        app.kubernetes.io/instance: node-red
     spec:
+      enableServiceLinks: true
       serviceAccountName: default
       automountServiceAccountToken: true
+      securityContext:
+        fsGroup: 1000
+        fsGroupChangePolicy: OnRootMismatch
+        runAsGroup: 1000
+        runAsUser: 1000
+      hostIPC: false
+      hostNetwork: false
+      hostPID: false
       dnsPolicy: ClusterFirst
-      enableServiceLinks: true
       containers:
-      - name: node-red
-        image: ghcr.io/k8s-at-home/node-red:v3.0.2
-        imagePullPolicy: null
-        env:
+      - env:
         - name: FLOWS
           value: flows.json
         - name: NODE_RED_ENABLE_PROJECTS
           value: 'true'
         - name: NODE_RED_ENABLE_SAFE_MODE
           value: 'false'
         - name: TZ
           value: ${SETTING_TZ}
-        ports:
-        - name: http
-          containerPort: 1880
-          protocol: TCP
-        volumeMounts:
-        - name: data
-          mountPath: /data
-        - name: gitconfig
-          subPath: .gitconfig
-          mountPath: /usr/src/node-red/.gitconfig
-          readOnly: true
+        image: docker.io/nodered/node-red:3.1.0
         livenessProbe:
           failureThreshold: 3
           initialDelaySeconds: 0
           periodSeconds: 10
           tcpSocket:
             port: 1880
           timeoutSeconds: 1
+        name: main
         readinessProbe:
           failureThreshold: 3
           initialDelaySeconds: 0
           periodSeconds: 10
-          tcpSocket:
-            port: 1880
-          timeoutSeconds: 1
-        startupProbe:
-          failureThreshold: 30
-          initialDelaySeconds: 0
-          periodSeconds: 5
           tcpSocket:
             port: 1880
           timeoutSeconds: 1
         resources:
           limits:
             cpu: 1000m
             memory: 500Mi
           requests:
             cpu: 25m
             memory: 350Mi
+        startupProbe:
+          failureThreshold: 30
+          initialDelaySeconds: 0
+          periodSeconds: 5
+          tcpSocket:
+            port: 1880
+          timeoutSeconds: 1
+        volumeMounts:
+        - mountPath: /data
+          name: data
+        - mountPath: /usr/src/node-red/.gitconfig
+          name: gitconfig
+          subPath: .gitconfig
       volumes:
       - name: data
         persistentVolumeClaim:
           claimName: node-red-data
-      - name: gitconfig
-        configMap:
+      - configMap:
           name: node-red-gitconfig
+        name: gitconfig
 
--- kubernetes HelmRelease: home-automation/node-red Service: home-automation/node-red

+++ kubernetes HelmRelease: home-automation/node-red Service: home-automation/node-red

@@ -1,21 +1,22 @@

 ---
 apiVersion: v1
 kind: Service
 metadata:
   name: node-red
   labels:
-    app.kubernetes.io/service: node-red
     app.kubernetes.io/instance: node-red
     app.kubernetes.io/managed-by: Helm
     app.kubernetes.io/name: node-red
+    app.kubernetes.io/service: node-red
 spec:
   type: ClusterIP
   ports:
   - port: 1880
-    targetPort: http
+    targetPort: 1880
     protocol: TCP
     name: http
   selector:
+    app.kubernetes.io/component: main
     app.kubernetes.io/instance: node-red
     app.kubernetes.io/name: node-red
 

@tyriis tyriis merged commit b1aa084 into main Nov 28, 2023
8 checks passed
@tyriis tyriis deleted the feature/app-template-v2-migration branch November 28, 2023 12:17
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