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(forward-auth): migrate to app-template v2 #2166

Merged
merged 1 commit into from
Nov 27, 2023

Conversation

tyriis
Copy link
Owner

@tyriis tyriis commented Nov 27, 2023

No description provided.

@tyriis-automation
Copy link
Contributor

--- kubernetes HelmRelease: traefik-ingress/traefik-forward-auth Service: traefik-ingress/traefik-forward-auth

+++ kubernetes HelmRelease: traefik-ingress/traefik-forward-auth Service: traefik-ingress/traefik-forward-auth

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

 ---
 apiVersion: v1
 kind: Service
 metadata:
   name: traefik-forward-auth
   labels:
-    app.kubernetes.io/service: traefik-forward-auth
     app.kubernetes.io/instance: traefik-forward-auth
     app.kubernetes.io/managed-by: Helm
     app.kubernetes.io/name: traefik-forward-auth
+    app.kubernetes.io/service: traefik-forward-auth
 spec:
   type: ClusterIP
   ports:
   - port: 4181
-    targetPort: http
+    targetPort: 4181
     protocol: TCP
     name: http
   selector:
+    app.kubernetes.io/component: main
     app.kubernetes.io/instance: traefik-forward-auth
     app.kubernetes.io/name: traefik-forward-auth
 
--- kubernetes HelmRelease: traefik-ingress/traefik-forward-auth Deployment: traefik-ingress/traefik-forward-auth

+++ kubernetes HelmRelease: traefik-ingress/traefik-forward-auth Deployment: traefik-ingress/traefik-forward-auth

@@ -1,41 +1,44 @@

 ---
 apiVersion: apps/v1
 kind: Deployment
 metadata:
   name: traefik-forward-auth
   labels:
+    app.kubernetes.io/component: main
     app.kubernetes.io/instance: traefik-forward-auth
     app.kubernetes.io/managed-by: Helm
     app.kubernetes.io/name: traefik-forward-auth
+  annotations:
+    secret.reloader.stakater.com/reload: traefik-forward-auth
 spec:
   revisionHistoryLimit: 3
   replicas: 1
   strategy:
     type: RollingUpdate
   selector:
     matchLabels:
+      app.kubernetes.io/component: main
       app.kubernetes.io/name: traefik-forward-auth
       app.kubernetes.io/instance: traefik-forward-auth
   template:
     metadata:
-      annotations:
-        secret.reloader.stakater.com/reload: traefik-forward-auth
       labels:
+        app.kubernetes.io/component: main
+        app.kubernetes.io/instance: traefik-forward-auth
         app.kubernetes.io/name: traefik-forward-auth
-        app.kubernetes.io/instance: traefik-forward-auth
     spec:
+      enableServiceLinks: true
       serviceAccountName: default
       automountServiceAccountToken: true
+      hostIPC: false
+      hostNetwork: false
+      hostPID: false
       dnsPolicy: ClusterFirst
-      enableServiceLinks: true
       containers:
-      - name: traefik-forward-auth
-        image: thomseddon/traefik-forward-auth:v2.2.0
-        imagePullPolicy: null
-        env:
+      - env:
         - name: AUTH_HOST
           value: auth.${SECRET_DOMAIN}
         - name: COOKIE_DOMAIN
           value: ${SECRET_DOMAIN}
         - name: DOMAIN
           value: ${SECRET_DOMAIN}
@@ -47,38 +50,36 @@

           value: info
         - name: URL_PATH
           value: /_oauth
         envFrom:
         - secretRef:
             name: traefik-forward-auth
-        ports:
-        - name: http
-          containerPort: 4181
-          protocol: TCP
+        image: thomseddon/traefik-forward-auth:v2.2.0
         livenessProbe:
           failureThreshold: 3
           initialDelaySeconds: 0
           periodSeconds: 10
           tcpSocket:
             port: 4181
           timeoutSeconds: 1
+        name: main
         readinessProbe:
           failureThreshold: 3
           initialDelaySeconds: 0
           periodSeconds: 10
-          tcpSocket:
-            port: 4181
-          timeoutSeconds: 1
-        startupProbe:
-          failureThreshold: 30
-          initialDelaySeconds: 0
-          periodSeconds: 5
           tcpSocket:
             port: 4181
           timeoutSeconds: 1
         resources:
           limits:
             memory: 50Mi
           requests:
             cpu: 5m
             memory: 10Mi
+        startupProbe:
+          failureThreshold: 30
+          initialDelaySeconds: 0
+          periodSeconds: 5
+          tcpSocket:
+            port: 4181
+          timeoutSeconds: 1
 

@tyriis-automation
Copy link
Contributor

--- kubernetes/talos-flux/apps/traefik-ingress/traefik/forward-auth Kustomization: flux-system/apps-traefik-forward-auth HelmRelease: traefik-ingress/traefik-forward-auth

+++ kubernetes/talos-flux/apps/traefik-ingress/traefik/forward-auth Kustomization: flux-system/apps-traefik-forward-auth HelmRelease: traefik-ingress/traefik-forward-auth

@@ -9,13 +9,13 @@

     spec:
       chart: app-template
       sourceRef:
         kind: HelmRepository
         name: bjw-s-charts
         namespace: flux-system
-      version: 1.5.1
+      version: 2.2.0
   install:
     remediation:
       retries: 3
     replace: true
     timeout: 5m
   interval: 15m
@@ -30,55 +30,60 @@

     cleanupOnFail: true
     remediation:
       remediateLastFailure: true
       retries: 3
       strategy: rollback
   values:
-    controller:
-      strategy: RollingUpdate
-    env:
-      AUTH_HOST: auth.${SECRET_DOMAIN}
-      COOKIE_DOMAIN: ${SECRET_DOMAIN}
-      DOMAIN: ${SECRET_DOMAIN}
-      INSECURE_COOKIE: 'false'
-      LIFETIME: '604800'
-      LOG_LEVEL: info
-      URL_PATH: /_oauth
-    envFrom:
-    - secretRef:
-        name: traefik-forward-auth
-    image:
-      repository: thomseddon/traefik-forward-auth
-      tag: v2.2.0
+    controllers:
+      main:
+        annotations:
+          secret.reloader.stakater.com/reload: traefik-forward-auth
+        containers:
+          main:
+            env:
+              AUTH_HOST: auth.${SECRET_DOMAIN}
+              COOKIE_DOMAIN: ${SECRET_DOMAIN}
+              DOMAIN: ${SECRET_DOMAIN}
+              INSECURE_COOKIE: 'false'
+              LIFETIME: '604800'
+              LOG_LEVEL: info
+              URL_PATH: /_oauth
+            envFrom:
+            - secretRef:
+                name: traefik-forward-auth
+            image:
+              repository: thomseddon/traefik-forward-auth
+              tag: v2.2.0
+            resources:
+              limits:
+                memory: 50Mi
+              requests:
+                cpu: 5m
+                memory: 10Mi
+        strategy: RollingUpdate
     ingress:
       main:
         annotations:
           cert-manager.io/cluster-issuer: letsencrypt-production
           external-dns.alpha.kubernetes.io/target: ${SECRET_CLOUDFLARE_TUNNEL_ID}.cfargotunnel.com
           kubernetes.io/tls-acme: 'true'
           traefik.ingress.kubernetes.io/router.entrypoints: websecure
           traefik.ingress.kubernetes.io/router.middlewares: traefik-ingress-sso@kubernetescrd
+        className: traefik
         enabled: true
         hosts:
         - host: auth.${SECRET_DOMAIN}
           paths:
           - path: /
-            pathType: Prefix
-        ingressClassName: traefik
+            service:
+              name: main
+              port: http
         tls:
         - hosts:
           - auth.${SECRET_DOMAIN}
           secretName: '{{ .Release.Name }}-tls'
-    podAnnotations:
-      secret.reloader.stakater.com/reload: traefik-forward-auth
-    resources:
-      limits:
-        memory: 50Mi
-      requests:
-        cpu: 5m
-        memory: 10Mi
     service:
       main:
         ports:
           http:
             port: 4181
 

@tyriis-automation
Copy link
Contributor

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ EDITORCONFIG editorconfig-checker 1 0 0.01s
✅ REPOSITORY gitleaks yes no 1.58s
✅ YAML prettier 1 0 0.49s
✅ 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 tyriis merged commit 9d113c6 into main Nov 27, 2023
8 checks passed
@tyriis tyriis deleted the feature/app-template-v2-migration branch November 27, 2023 22:33
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