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(atlantis): migrate tyriis to app-template #4543

Merged
merged 1 commit into from
Feb 11, 2025

Conversation

tyriis
Copy link
Owner

@tyriis tyriis commented Feb 11, 2025

No description provided.

@tyriis-automation
Copy link
Contributor

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ EDITORCONFIG editorconfig-checker 3 0 0.02s
✅ REPOSITORY gitleaks yes no 3.11s
✅ YAML prettier 3 0 0.45s
✅ YAML yamllint 3 0 0.44s

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

--- HelmRelease: atlantis/atlantis-tyriis ServiceAccount: atlantis/atlantis-tyriis

+++ HelmRelease: atlantis/atlantis-tyriis ServiceAccount: atlantis/atlantis-tyriis

@@ -1,13 +0,0 @@

----
-apiVersion: v1
-kind: ServiceAccount
-metadata:
-  name: atlantis-tyriis
-  namespace: atlantis
-  labels:
-    app: atlantis
-    release: atlantis-tyriis
-    heritage: Helm
-    app.kubernetes.io/instance: atlantis-tyriis
-    app.kubernetes.io/name: atlantis-tyriis
-
--- HelmRelease: atlantis/atlantis-tyriis ConfigMap: atlantis/atlantis-tyriis-repo-config

+++ HelmRelease: atlantis/atlantis-tyriis ConfigMap: atlantis/atlantis-tyriis-repo-config

@@ -1,44 +0,0 @@

----
-apiVersion: v1
-kind: ConfigMap
-metadata:
-  name: atlantis-tyriis-repo-config
-  namespace: atlantis
-  labels:
-    app: atlantis
-    release: atlantis-tyriis
-    heritage: Helm
-    app.kubernetes.io/instance: atlantis-tyriis
-    app.kubernetes.io/name: atlantis-tyriis
-data:
-  repos.yaml: |
-    ---
-    repos:
-      - id: /.*/
-        pre_workflow_hooks:
-          - run: sh /home/atlantis/scripts/allow_list.sh
-            description: Check Allow List
-        apply_requirements: []
-        allowed_overrides: []
-        allow_custom_workflows: true
-        workflow: custom
-        allowed_workflows: [custom]
-    workflows:
-      custom:
-        plan:
-          steps:
-            - env:
-                name: SOPS_AGE_KEY_FILE
-                command: echo $HOME/.config/sops/age/$BASE_REPO_NAME.txt
-            - init
-            - plan
-        apply:
-          steps:
-            - env:
-                name: SOPS_AGE_KEY_FILE
-                command: echo $HOME/.config/sops/age/$BASE_REPO_NAME.txt
-            - apply
-    metrics:
-      prometheus:
-        endpoint: /metrics
-
--- HelmRelease: atlantis/atlantis-tyriis ConfigMap: atlantis/atlantis-tyriis-tests

+++ HelmRelease: atlantis/atlantis-tyriis ConfigMap: atlantis/atlantis-tyriis-tests

@@ -1,17 +0,0 @@

----
-apiVersion: v1
-kind: ConfigMap
-metadata:
-  name: atlantis-tyriis-tests
-  namespace: atlantis
-data:
-  tests.bats: |-
-    setup() {
-      apk add curl -q
-    }
-    @test "Atlantis UI is available" {
-      ATLANTIS_URL=http://atlantis-tyriis.atlantis.svc.cluster.local:80
-      echo "Trying Atlantis at: $ATLANTIS_URL"
-      curl -v $ATLANTIS_URL
-    }
-
--- HelmRelease: atlantis/atlantis-tyriis PersistentVolumeClaim: atlantis/atlantis-tyriis-data

+++ HelmRelease: atlantis/atlantis-tyriis PersistentVolumeClaim: atlantis/atlantis-tyriis-data

@@ -1,20 +0,0 @@

----
-apiVersion: v1
-kind: PersistentVolumeClaim
-metadata:
-  name: atlantis-tyriis-data
-  namespace: atlantis
-  labels:
-    app: atlantis
-    release: atlantis-tyriis
-    heritage: Helm
-    app.kubernetes.io/instance: atlantis-tyriis
-    app.kubernetes.io/name: atlantis-tyriis
-spec:
-  accessModes:
-  - ReadWriteOnce
-  resources:
-    requests:
-      storage: 5Gi
-  storageClassName: ceph-block
-
--- HelmRelease: atlantis/atlantis-tyriis Service: atlantis/atlantis-tyriis

+++ HelmRelease: atlantis/atlantis-tyriis Service: atlantis/atlantis-tyriis

@@ -1,23 +1,23 @@

 ---
 apiVersion: v1
 kind: Service
 metadata:
   name: atlantis-tyriis
+  labels:
+    app.kubernetes.io/instance: atlantis-tyriis
+    app.kubernetes.io/managed-by: Helm
+    app.kubernetes.io/name: atlantis-tyriis
+    app.kubernetes.io/service: atlantis-tyriis
   namespace: atlantis
-  labels:
-    app: atlantis
-    release: atlantis-tyriis
-    heritage: Helm
-    app.kubernetes.io/instance: atlantis-tyriis
-    app.kubernetes.io/name: atlantis-tyriis
 spec:
   type: ClusterIP
   ports:
-  - port: 80
+  - port: 4141
     targetPort: 4141
     protocol: TCP
-    name: atlantis
+    name: http
   selector:
-    app: atlantis
-    release: atlantis-tyriis
+    app.kubernetes.io/component: main
+    app.kubernetes.io/instance: atlantis-tyriis
+    app.kubernetes.io/name: atlantis-tyriis
 
--- HelmRelease: atlantis/atlantis-tyriis StatefulSet: atlantis/atlantis-tyriis

+++ HelmRelease: atlantis/atlantis-tyriis StatefulSet: atlantis/atlantis-tyriis

@@ -1,138 +0,0 @@

----
-apiVersion: apps/v1
-kind: StatefulSet
-metadata:
-  name: atlantis-tyriis
-  namespace: atlantis
-  labels:
-    app: atlantis
-    release: atlantis-tyriis
-    heritage: Helm
-    app.kubernetes.io/instance: atlantis-tyriis
-    app.kubernetes.io/name: atlantis-tyriis
-spec:
-  serviceName: atlantis-tyriis
-  replicas: 1
-  selector:
-    matchLabels:
-      app: atlantis
-      release: atlantis-tyriis
-  template:
-    metadata:
-      labels:
-        app: atlantis
-        release: atlantis-tyriis
-        app.kubernetes.io/instance: atlantis-tyriis
-        app.kubernetes.io/name: atlantis-tyriis
-      annotations:
-        checksum/repo-config: 9087183c6ed9df935d761703e3b3357beef2fc55e5c5baa7f6a22480e6a2ebdd
-        secret.reloader.stakater.com/reload: atlantis-tyriis-env-secrets
-    spec:
-      hostNetwork: false
-      serviceAccountName: atlantis-tyriis
-      shareProcessNamespace: false
-      automountServiceAccountToken: true
-      securityContext:
-        fsGroup: 1000
-        fsGroupChangePolicy: OnRootMismatch
-        runAsUser: 100
-      volumes:
-      - name: atlantis-data
-        persistentVolumeClaim:
-          claimName: atlantis-tyriis-data
-      - name: repo-config
-        configMap:
-          name: atlantis-tyriis-repo-config
-      - name: atlantis-home-dir
-        emptyDir: {}
-      - name: tmp-dir
-        emptyDir: {}
-      - configMap:
-          name: atlantis-tyriis-allow-list
-        name: allow-list
-      - configMap:
-          name: atlantis-tyriis-scripts
-        name: scripts
-      containers:
-      - name: atlantis
-        image: ghcr.io/runatlantis/atlantis:v0.33.0@sha256:9145babb08e8a3e80e6367af8bf8e443d75be622864ce80a0410a40de5e0f4ac
-        imagePullPolicy: Always
-        securityContext:
-          allowPrivilegeEscalation: false
-          readOnlyRootFilesystem: true
-        args:
-        - server
-        ports:
-        - name: atlantis
-          containerPort: 4141
-        envFrom:
-        - secretRef:
-            name: atlantis-tyriis-env-secrets
-        env:
-        - name: PATH
-          value: /plugins:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
-        - name: ATLANTIS_EMOJI_REACTION
-          value: eyes
-        - name: ATLANTIS_FAIL_ON_PRE_WORKFLOW_HOOK_ERROR
-          value: 'true'
-        - name: ATLANTIS_WRITE_GIT_CREDS
-          value: 'true'
-        - name: ATLANTIS_ENABLE_DIFF_MARKDOWN_FORMAT
-          value: 'true'
-        - name: ATLANTIS_TF_DISTRIBUTION
-          value: terraform
-        - name: ATLANTIS_DATA_DIR
-          value: /atlantis-data
-        - name: ATLANTIS_REPO_ALLOWLIST
-          value: github.com/tyriis/*
-        - name: ATLANTIS_PORT
-          value: '4141'
-        - name: ATLANTIS_REPO_CONFIG
-          value: /etc/atlantis/repos.yaml
-        - name: ATLANTIS_ATLANTIS_URL
-          value: https://atlantis-tyriis.techtales.io
-        livenessProbe:
-          httpGet:
-            path: /healthz
-            port: 4141
-            scheme: HTTP
-          initialDelaySeconds: 5
-          periodSeconds: 60
-          timeoutSeconds: 5
-          successThreshold: 1
-          failureThreshold: 5
-        readinessProbe:
-          httpGet:
-            path: /healthz
-            port: 4141
-            scheme: HTTP
-          initialDelaySeconds: 10
-          periodSeconds: 5
-          timeoutSeconds: 5
-          successThreshold: 1
-          failureThreshold: 5
-        volumeMounts:
-        - name: atlantis-data
-          mountPath: /atlantis-data
-        - name: repo-config
-          mountPath: /etc/atlantis/repos.yaml
-          subPath: repos.yaml
-          readOnly: true
-        - name: atlantis-home-dir
-          mountPath: /home/atlantis
-        - name: tmp-dir
-          mountPath: /tmp
-        - mountPath: /home/atlantis/.config/allowlist
-          name: allow-list
-          readOnly: true
-        - mountPath: /home/atlantis/scripts
-          name: scripts
-          readOnly: true
-        resources:
-          limits:
-            cpu: 1000m
-            memory: 1Gi
-          requests:
-            cpu: 100m
-            memory: 1Gi
-
--- HelmRelease: atlantis/atlantis-tyriis Ingress: atlantis/atlantis-tyriis

+++ HelmRelease: atlantis/atlantis-tyriis Ingress: atlantis/atlantis-tyriis

@@ -1,46 +0,0 @@

----
-apiVersion: networking.k8s.io/v1
-kind: Ingress
-metadata:
-  name: atlantis-tyriis
-  namespace: atlantis
-  labels:
-    app: atlantis
-    release: atlantis-tyriis
-    heritage: Helm
-    app.kubernetes.io/instance: atlantis-tyriis
-    app.kubernetes.io/name: atlantis-tyriis
-  annotations:
-    cert-manager.io/cluster-issuer: letsencrypt-production
-    external-dns/opnsense: 'true'
-    gethomepage.dev/description: Terraform Pull Request Automation
-    gethomepage.dev/enabled: 'true'
-    gethomepage.dev/group: Development
-    gethomepage.dev/icon: terraform
-    gethomepage.dev/name: Atlantis (tyriis)
-    gethomepage.dev/weight: '10'
-    hajimari.io/enable: 'true'
-    hajimari.io/icon: simple-icons:terraform
-    kubernetes.io/tls-acme: 'true'
-    traefik.ingress.kubernetes.io/affinity: 'true'
-    traefik.ingress.kubernetes.io/router.entrypoints: websecure
-    traefik.ingress.kubernetes.io/router.middlewares: traefik-ingress-sso@kubernetescrd
-    traefik.ingress.kubernetes.io/router.tls: 'true'
-spec:
-  ingressClassName: traefik
-  tls:
-  - hosts:
-    - atlantis-tyriis.techtales.io
-    secretName: atlantis-tyriis-tls
-  rules:
-  - host: atlantis-tyriis.techtales.io
-    http:
-      paths:
-      - path: /
-        backend:
-          service:
-            name: atlantis-tyriis
-            port:
-              number: 80
-        pathType: Prefix
-
--- HelmRelease: atlantis/atlantis-tyriis ServiceMonitor: atlantis/atlantis-tyriis

+++ HelmRelease: atlantis/atlantis-tyriis ServiceMonitor: atlantis/atlantis-tyriis

@@ -1,30 +1,26 @@

 ---
 apiVersion: monitoring.coreos.com/v1
 kind: ServiceMonitor
 metadata:
   name: atlantis-tyriis
+  labels:
+    app.kubernetes.io/instance: atlantis-tyriis
+    app.kubernetes.io/managed-by: Helm
+    app.kubernetes.io/name: atlantis-tyriis
   namespace: atlantis
-  labels:
-    app: atlantis
-    release: atlantis-tyriis
-    heritage: Helm
-    app.kubernetes.io/instance: atlantis-tyriis
-    app.kubernetes.io/name: atlantis-tyriis
 spec:
-  selector:
-    matchLabels:
-      app: atlantis
-      chart: atlantis-5.14.0
-      helm.sh/chart: atlantis-5.14.0
-      release: atlantis-tyriis
-      heritage: Helm
-      app.kubernetes.io/instance: atlantis-tyriis
-      app.kubernetes.io/name: atlantis-tyriis
+  jobLabel: atlantis-tyriis
   namespaceSelector:
     matchNames:
     - atlantis
+  selector:
+    matchLabels:
+      app.kubernetes.io/service: atlantis-tyriis
+      app.kubernetes.io/name: atlantis-tyriis
+      app.kubernetes.io/instance: atlantis-tyriis
   endpoints:
-  - port: atlantis
-    interval: 30s
-    path: /metrics
+  - interval: 15m
+    path: /
+    port: metrics
+    scheme: http
 
--- HelmRelease: atlantis/atlantis-tyriis Deployment: atlantis/atlantis-tyriis

+++ HelmRelease: atlantis/atlantis-tyriis Deployment: atlantis/atlantis-tyriis

@@ -0,0 +1,153 @@

+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: atlantis-tyriis
+  labels:
+    app.kubernetes.io/component: main
+    app.kubernetes.io/instance: atlantis-tyriis
+    app.kubernetes.io/managed-by: Helm
+    app.kubernetes.io/name: atlantis-tyriis
+  annotations:
+    reloader.stakater.com/auto: 'true'
+  namespace: atlantis
+spec:
+  revisionHistoryLimit: 3
+  replicas: 1
+  strategy:
+    type: Recreate
+  selector:
+    matchLabels:
+      app.kubernetes.io/component: main
+      app.kubernetes.io/name: atlantis-tyriis
+      app.kubernetes.io/instance: atlantis-tyriis
+  template:
+    metadata:
+      labels:
+        app.kubernetes.io/component: main
+        app.kubernetes.io/instance: atlantis-tyriis
+        app.kubernetes.io/name: atlantis-tyriis
+    spec:
+      enableServiceLinks: false
+      serviceAccountName: default
+      automountServiceAccountToken: false
+      securityContext:
+        fsGroup: 1000
+        fsGroupChangePolicy: OnRootMismatch
+        runAsGroup: 1000
+        runAsNonRoot: true
+        runAsUser: 100
+        seccompProfile:
+          type: RuntimeDefault
+      hostIPC: false
+      hostNetwork: false
+      hostPID: false
+      dnsPolicy: ClusterFirst
+      containers:
+      - env:
+        - name: ATLANTIS_ATLANTIS_URL
+          value: https://atlantis-tyriis.techtales.io
+        - name: ATLANTIS_AUTOPLAN_MODULES
+          value: 'true'
+        - name: ATLANTIS_DEFAULT_TF_DISTRIBUTION
+          value: terraform
+        - name: ATLANTIS_DISABLE_AUTOPLAN_LABEL
+          value: no-autoplan
+        - name: ATLANTIS_DISABLE_MARKDOWN_FOLDING
+          value: 'true'
+        - name: ATLANTIS_DISCARD_APPROVAL_ON_PLAN
+          value: 'true'
+        - name: ATLANTIS_EMOJI_REACTION
+          value: eyes
+        - name: ATLANTIS_ENABLE_DIFF_MARKDOWN_FORMAT
+          value: 'true'
+        - name: ATLANTIS_FAIL_ON_PRE_WORKFLOW_HOOK_ERROR
+          value: 'true'
+        - name: ATLANTIS_LOCKING_DB_TYPE
+          value: redis
+        - name: ATLANTIS_LOG_LEVEL
+          value: info
+        - name: ATLANTIS_PORT
+          value: '4141'
+        - name: ATLANTIS_REDIS_HOST
+          value: dragonfly.database.svc.cluster.local
+        - name: ATLANTIS_REPO_ALLOWLIST
+          value: github.com/tyriis/terraform-github
+        - name: ATLANTIS_REPO_CONFIG
+          value: /etc/atlantis/repos.yaml
+        - name: ATLANTIS_SKIP_CLONE_NO_CHANGES
+          value: 'true'
+        - name: ATLANTIS_STATS_NAMESPACE
+          value: atlantis-tyriis
+        - name: ATLANTIS_TF_DISTRIBUTION
+          value: terraform
+        - name: ATLANTIS_WRITE_GIT_CREDS
+          value: 'true'
+        envFrom:
+        - secretRef:
+            name: atlantis-tyriis-env-secrets
+        image: ghcr.io/runatlantis/atlantis:v0.33.0@sha256:9145babb08e8a3e80e6367af8bf8e443d75be622864ce80a0410a40de5e0f4ac
+        livenessProbe:
+          failureThreshold: 5
+          httpGet:
+            path: /healthz
+            port: 4141
+          initialDelaySeconds: 5
+          periodSeconds: 60
+          timeoutSeconds: 5
+        name: app
+        ports:
+        - containerPort: 4141
+          name: http
+        readinessProbe:
+          failureThreshold: 5
+          httpGet:
+            path: /healthz
+            port: 4141
+          initialDelaySeconds: 10
+          periodSeconds: 5
+          timeoutSeconds: 5
+        resources:
+          requests:
+            cpu: 100m
+            memory: 1Gi
+        securityContext:
+          allowPrivilegeEscalation: false
+          capabilities:
+            drop:
+            - ALL
+          readOnlyRootFilesystem: true
+        startupProbe:
+          failureThreshold: 60
+          httpGet:
+            path: /healthz
+            port: 4141
+          initialDelaySeconds: 5
+          periodSeconds: 1
+        volumeMounts:
+        - mountPath: /home/atlantis/.config/allowlist/allowlist.txt
+          name: allowlist
+          readOnly: true
+          subPath: allowlist.txt
+        - mountPath: /etc/atlantis/repos.yaml
+          name: config
+          readOnly: true
+          subPath: repos.yaml
+        - mountPath: /home/atlantis/scripts
+          name: scripts
+          readOnly: true
+        - mountPath: /tmp
+          name: tmp
+      volumes:
+      - configMap:
+          name: atlantis-tyriis-allowlist
+        name: allowlist
+      - configMap:
+          name: atlantis-default-config
+        name: config
+      - configMap:
+          name: atlantis-default-scripts
+        name: scripts
+      - emptyDir: {}
+        name: tmp
+
--- HelmRelease: atlantis/atlantis-tyriis Ingress: atlantis/atlantis-tyriis-main

+++ HelmRelease: atlantis/atlantis-tyriis Ingress: atlantis/atlantis-tyriis-main

@@ -0,0 +1,40 @@

+---
+apiVersion: networking.k8s.io/v1
+kind: Ingress
+metadata:
+  name: atlantis-tyriis-main
+  labels:
+    app.kubernetes.io/instance: atlantis-tyriis
+    app.kubernetes.io/managed-by: Helm
+    app.kubernetes.io/name: atlantis-tyriis
+  annotations:
+    cert-manager.io/cluster-issuer: letsencrypt-production
+    gethomepage.dev/description: Terraform Pull Request Automation
+    gethomepage.dev/enabled: 'true'
+    gethomepage.dev/group: Terraform
+    gethomepage.dev/icon: terraform
+    gethomepage.dev/name: atlantis-tyriis
+    kubernetes.io/tls-acme: 'true'
+    traefik.ingress.kubernetes.io/affinity: 'true'
+    traefik.ingress.kubernetes.io/router.entrypoints: websecure
+    traefik.ingress.kubernetes.io/router.middlewares: traefik-ingress-sso@kubernetescrd
+    traefik.ingress.kubernetes.io/router.tls: 'true'
+  namespace: atlantis
+spec:
+  ingressClassName: traefik
+  tls:
+  - hosts:
+    - atlantis-tyriis.techtales.io
+    secretName: atlantis-tyriis-tls
+  rules:
+  - host: atlantis-tyriis.techtales.io
+    http:
+      paths:
+      - path: /
+        pathType: Prefix
+        backend:
+          service:
+            name: atlantis-tyriis
+            port:
+              number: 4141
+
--- HelmRelease: atlantis/atlantis-tyriis Ingress: atlantis/atlantis-tyriis-webhook

+++ HelmRelease: atlantis/atlantis-tyriis Ingress: atlantis/atlantis-tyriis-webhook

@@ -0,0 +1,36 @@

+---
+apiVersion: networking.k8s.io/v1
+kind: Ingress
+metadata:
+  name: atlantis-tyriis-webhook
+  labels:
+    app.kubernetes.io/instance: atlantis-tyriis
+    app.kubernetes.io/managed-by: Helm
+    app.kubernetes.io/name: atlantis-tyriis
+  annotations:
+    cert-manager.io/cluster-issuer: letsencrypt-production
+    external-dns.alpha.kubernetes.io/target: ..PLACEHOLDER_SECRET_CLOUDFLARE_TUNNEL_ID...cfargotunnel.com
+    external-dns/cloudflare: 'true'
+    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'
+  namespace: atlantis
+spec:
+  ingressClassName: traefik
+  tls:
+  - hosts:
+    - atlantis-tyriis-webhook.techtales.io
+    secretName: atlantis-tyriis-webhook-tls
+  rules:
+  - host: atlantis-tyriis-webhook.techtales.io
+    http:
+      paths:
+      - path: /events
+        pathType: Prefix
+        backend:
+          service:
+            name: atlantis-tyriis
+            port:
+              number: 4141
+

@tyriis-automation
Copy link
Contributor

--- kubernetes/talos-flux/apps Kustomization: flux-system/apps-sync Kustomization: flux-system/apps-atlantis-tyriis

+++ kubernetes/talos-flux/apps Kustomization: flux-system/apps-sync Kustomization: flux-system/apps-atlantis-tyriis

@@ -2,31 +2,38 @@

 apiVersion: kustomize.toolkit.fluxcd.io/v1
 kind: Kustomization
 metadata:
   labels:
     kustomize.toolkit.fluxcd.io/name: apps-sync
     kustomize.toolkit.fluxcd.io/namespace: flux-system
+    substitution.flux.home.arpa/enabled: 'true'
   name: apps-atlantis-tyriis
   namespace: flux-system
 spec:
+  commonMetadata:
+    labels:
+      app.kubernetes.io/name: apps-atlantis-tyriis
   decryption:
     provider: sops
     secretRef:
       name: sops-age
   dependsOn:
   - name: apps-cert-manager
   - name: apps-rook-ceph-cluster
   - name: apps-traefik-forward-auth
-  interval: 10m
+  interval: 30m
   path: ./kubernetes/talos-flux/apps/atlantis/atlantis/tyriis
   postBuild:
     substituteFrom:
     - kind: ConfigMap
       name: cluster-settings
     - kind: Secret
       name: cluster-secrets
   prune: true
+  retryInterval: 1m
   sourceRef:
     kind: GitRepository
     name: home-ops
+  targetNamespace: atlantis
+  timeout: 5m
   wait: true
 
--- kubernetes/talos-flux/apps/atlantis/atlantis/tyriis Kustomization: flux-system/apps-atlantis-tyriis HelmRelease: atlantis/atlantis-tyriis

+++ kubernetes/talos-flux/apps/atlantis/atlantis/tyriis Kustomization: flux-system/apps-atlantis-tyriis HelmRelease: atlantis/atlantis-tyriis

@@ -1,123 +1,218 @@

 ---
 apiVersion: helm.toolkit.fluxcd.io/v2
 kind: HelmRelease
 metadata:
   labels:
-    app.kubernetes.io/instance: atlantis-tyriis
-    app.kubernetes.io/name: atlantis-tyriis
+    app.kubernetes.io/name: apps-atlantis-tyriis
     kustomize.toolkit.fluxcd.io/name: apps-atlantis-tyriis
     kustomize.toolkit.fluxcd.io/namespace: flux-system
   name: atlantis-tyriis
   namespace: atlantis
 spec:
   chart:
     spec:
-      chart: atlantis
+      chart: app-template
       sourceRef:
         kind: HelmRepository
-        name: runatlantis-charts
+        name: bjw-s-charts
         namespace: flux-system
-      version: 5.14.0
+      version: 3.7.1
+  driftDetection:
+    mode: enabled
   install:
+    createNamespace: true
     remediation:
       retries: 3
-  interval: 15m
-  maxHistory: 3
+  interval: 30m
   uninstall:
     keepHistory: false
   upgrade:
-    cleanupOnFail: true
     remediation:
       retries: 3
   values:
-    atlantisUrl: https://atlantis-tyriis.techtales.io
-    commonLabels:
-      app.kubernetes.io/instance: atlantis-tyriis
-      app.kubernetes.io/name: atlantis-tyriis
-    containerSecurityContext:
-      allowPrivilegeEscalation: false
-      readOnlyRootFilesystem: true
-    enableDiffMarkdownFormat: true
-    environment:
-      ATLANTIS_EMOJI_REACTION: eyes
-      ATLANTIS_FAIL_ON_PRE_WORKFLOW_HOOK_ERROR: 'true'
-      ATLANTIS_WRITE_GIT_CREDS: 'true'
-    extraVolumeMounts:
-    - mountPath: /home/atlantis/.config/allowlist
-      name: allow-list
-      readOnly: true
-    - mountPath: /home/atlantis/scripts
-      name: scripts
-      readOnly: true
-    extraVolumes:
-    - configMap:
-        name: atlantis-tyriis-allow-list
-      name: allow-list
-    - configMap:
-        name: atlantis-tyriis-scripts
-      name: scripts
-    image:
-      repository: ghcr.io/runatlantis/atlantis
-      tag: v0.33.0@sha256:9145babb08e8a3e80e6367af8bf8e443d75be622864ce80a0410a40de5e0f4ac
+    controllers:
+      main:
+        annotations:
+          reloader.stakater.com/auto: 'true'
+        containers:
+          app:
+            env:
+              ATLANTIS_ATLANTIS_URL: https://{{ .Release.Name }}.techtales.io
+              ATLANTIS_AUTOPLAN_MODULES: 'true'
+              ATLANTIS_DEFAULT_TF_DISTRIBUTION: terraform
+              ATLANTIS_DISABLE_AUTOPLAN_LABEL: no-autoplan
+              ATLANTIS_DISABLE_MARKDOWN_FOLDING: 'true'
+              ATLANTIS_DISCARD_APPROVAL_ON_PLAN: 'true'
+              ATLANTIS_EMOJI_REACTION: eyes
+              ATLANTIS_ENABLE_DIFF_MARKDOWN_FORMAT: 'true'
+              ATLANTIS_FAIL_ON_PRE_WORKFLOW_HOOK_ERROR: 'true'
+              ATLANTIS_LOCKING_DB_TYPE: redis
+              ATLANTIS_LOG_LEVEL: info
+              ATLANTIS_PORT: 4141
+              ATLANTIS_REDIS_HOST: dragonfly.database.svc.cluster.local
+              ATLANTIS_REPO_ALLOWLIST: github.com/tyriis/terraform-github
+              ATLANTIS_REPO_CONFIG: /etc/atlantis/repos.yaml
+              ATLANTIS_SKIP_CLONE_NO_CHANGES: true
+              ATLANTIS_STATS_NAMESPACE: atlantis-tyriis
+              ATLANTIS_TF_DISTRIBUTION: terraform
+              ATLANTIS_WRITE_GIT_CREDS: 'true'
+            envFrom:
+            - secretRef:
+                name: atlantis-tyriis-env-secrets
+            image:
+              repository: ghcr.io/runatlantis/atlantis
+              tag: v0.33.0@sha256:9145babb08e8a3e80e6367af8bf8e443d75be622864ce80a0410a40de5e0f4ac
+            ports:
+            - containerPort: 4141
+              name: http
+            probes:
+              liveness:
+                custom: true
+                enabled: true
+                spec:
+                  failureThreshold: 5
+                  httpGet:
+                    path: /healthz
+                    port: 4141
+                  initialDelaySeconds: 5
+                  periodSeconds: 60
+                  timeoutSeconds: 5
+              readiness:
+                custom: true
+                enabled: true
+                spec:
+                  failureThreshold: 5
+                  httpGet:
+                    path: /healthz
+                    port: 4141
+                  initialDelaySeconds: 10
+                  periodSeconds: 5
+                  timeoutSeconds: 5
+              startup:
+                custom: true
+                enabled: true
+                spec:
+                  failureThreshold: 60
+                  httpGet:
+                    path: /healthz
+                    port: 4141
+                  initialDelaySeconds: 5
+                  periodSeconds: 1
+            resources:
+              requests:
+                cpu: 100m
+                memory: 1Gi
+            securityContext:
+              allowPrivilegeEscalation: false
+              capabilities:
+                drop:
+                - ALL
+              readOnlyRootFilesystem: true
+    defaultPodOptions:
+      automountServiceAccountToken: false
+      securityContext:
+        fsGroup: 1000
+        fsGroupChangePolicy: OnRootMismatch
+        runAsGroup: 1000
+        runAsNonRoot: true
+        runAsUser: 100
+        seccompProfile:
+          type: RuntimeDefault
     ingress:
-      annotations:
-        cert-manager.io/cluster-issuer: letsencrypt-production
-        external-dns/opnsense: 'true'
-        gethomepage.dev/description: Terraform Pull Request Automation
-        gethomepage.dev/enabled: 'true'
-        gethomepage.dev/group: Development
-        gethomepage.dev/icon: terraform
-        gethomepage.dev/name: Atlantis (tyriis)
-        gethomepage.dev/weight: '10'
-        hajimari.io/enable: 'true'
-        hajimari.io/icon: simple-icons:terraform
-        kubernetes.io/tls-acme: 'true'
-        traefik.ingress.kubernetes.io/affinity: 'true'
-        traefik.ingress.kubernetes.io/router.entrypoints: websecure
-        traefik.ingress.kubernetes.io/router.middlewares: traefik-ingress-sso@kubernetescrd
-        traefik.ingress.kubernetes.io/router.tls: 'true'
-      enabled: true
-      hosts:
-      - host: atlantis-tyriis.techtales.io
-        paths:
-        - /
-      ingressClassName: traefik
-      pathType: Prefix
-      tls:
-      - hosts:
-        - atlantis-tyriis.techtales.io
-        secretName: atlantis-tyriis-tls
-    loadEnvFromSecrets:
-    - atlantis-tyriis-env-secrets
-    orgAllowlist: github.com/tyriis/*
-    podTemplate:
-      annotations:
-        secret.reloader.stakater.com/reload: atlantis-tyriis-env-secrets
-      labels:
-        app.kubernetes.io/instance: atlantis-tyriis
-        app.kubernetes.io/name: atlantis-tyriis
-    readinessProbe:
-      initialDelaySeconds: 10
-      periodSeconds: 5
-    resources:
-      limits:
-        cpu: 1000m
-        memory: 1Gi
-      requests:
-        cpu: 100m
-        memory: 1Gi
+      main:
+        annotations:
+          cert-manager.io/cluster-issuer: letsencrypt-production
+          gethomepage.dev/description: Terraform Pull Request Automation
+          gethomepage.dev/enabled: 'true'
+          gethomepage.dev/group: Terraform
+          gethomepage.dev/icon: terraform
+          gethomepage.dev/name: atlantis-tyriis
+          kubernetes.io/tls-acme: 'true'
+          traefik.ingress.kubernetes.io/affinity: 'true'
+          traefik.ingress.kubernetes.io/router.entrypoints: websecure
+          traefik.ingress.kubernetes.io/router.middlewares: traefik-ingress-sso@kubernetescrd
+          traefik.ingress.kubernetes.io/router.tls: 'true'
+        className: traefik
+        hosts:
+        - host: '{{ .Release.Name }}.techtales.io'
+          paths:
+          - path: /
+            pathType: Prefix
+            service:
+              identifier: main
+              port: http
+        tls:
+        - hosts:
+          - '{{ .Release.Name }}.techtales.io'
+          secretName: '{{ .Release.Name }}-tls'
+      webhook:
+        annotations:
+          cert-manager.io/cluster-issuer: letsencrypt-production
+          external-dns.alpha.kubernetes.io/target: ..PLACEHOLDER_SECRET_CLOUDFLARE_TUNNEL_ID...cfargotunnel.com
+          external-dns/cloudflare: 'true'
+          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 }}-webhook.techtales.io'
+          paths:
+          - path: /events
+            pathType: Prefix
+            service:
+              identifier: main
+              port: http
+        tls:
+        - hosts:
+          - '{{ .Release.Name }}-webhook.techtales.io'
+          secretName: '{{ .Release.Name }}-webhook-tls'
+    persistence:
+      allowlist:
+        advancedMounts:
+          main:
+            app:
+            - path: /home/atlantis/.config/allowlist/allowlist.txt
+              readOnly: true
+              subPath: allowlist.txt
+        name: atlantis-tyriis-allowlist
+        type: configMap
+      config:
+        advancedMounts:
+          main:
+            app:
+            - path: /etc/atlantis/repos.yaml
+              readOnly: true
+              subPath: repos.yaml
+        name: atlantis-default-config
+        type: configMap
+      scripts:
+        advancedMounts:
+          main:
+            app:
+            - path: /home/atlantis/scripts
+              readOnly: true
+        name: atlantis-default-scripts
+        type: configMap
+      tmp:
+        type: emptyDir
     service:
-      targetPort: 4141
-      type: ClusterIP
-    servicemonitor:
-      enabled: true
-    volumeClaim:
-      dataStorage: 5Gi
-      enabled: true
-      storageClassName: ceph-block
-  valuesFrom:
-  - kind: ConfigMap
-    name: atlantis-tyriis-config
-    targetPath: repoConfig
-    valuesKey: repoConfig
+      main:
+        controller: main
+        nameOverride: atlantis-tyriis
[Diff truncated by flux-local]
--- kubernetes/talos-flux/apps/atlantis/atlantis/tyriis Kustomization: flux-system/apps-atlantis-tyriis Ingress: atlantis/atlantis-tyriis-webhook

+++ kubernetes/talos-flux/apps/atlantis/atlantis/tyriis Kustomization: flux-system/apps-atlantis-tyriis Ingress: atlantis/atlantis-tyriis-webhook

@@ -1,38 +0,0 @@

----
-apiVersion: networking.k8s.io/v1
-kind: Ingress
-metadata:
-  annotations:
-    cert-manager.io/cluster-issuer: letsencrypt-production
-    external-dns.alpha.kubernetes.io/target: ..PLACEHOLDER_SECRET_CLOUDFLARE_TUNNEL_ID...cfargotunnel.com
-    external-dns/cloudflare: 'true'
-    hajimari.io/enable: 'false'
-    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'
-  labels:
-    app.kubernetes.io/instance: atlantis-tyriis
-    app.kubernetes.io/name: atlantis-tyriis
-    kustomize.toolkit.fluxcd.io/name: apps-atlantis-tyriis
-    kustomize.toolkit.fluxcd.io/namespace: flux-system
-  name: atlantis-tyriis-webhook
-  namespace: atlantis
-spec:
-  ingressClassName: traefik
-  rules:
-  - host: atlantis-tyriis-webhook.techtales.io
-    http:
-      paths:
-      - backend:
-          service:
-            name: atlantis-tyriis
-            port:
-              number: 80
-        path: /events
-        pathType: Prefix
-  tls:
-  - hosts:
-    - atlantis-tyriis-webhook.techtales.io
-    secretName: atlantis-tyriis-webhook-tls
-
--- kubernetes/talos-flux/apps/atlantis/atlantis/tyriis Kustomization: flux-system/apps-atlantis-tyriis ConfigMap: atlantis/atlantis-tyriis-config

+++ kubernetes/talos-flux/apps/atlantis/atlantis/tyriis Kustomization: flux-system/apps-atlantis-tyriis ConfigMap: atlantis/atlantis-tyriis-config

@@ -33,13 +33,12 @@

         endpoint: /metrics
 kind: ConfigMap
 metadata:
   annotations:
     kustomize.toolkit.fluxcd.io/substitute: disabled
   labels:
-    app.kubernetes.io/instance: atlantis-tyriis
-    app.kubernetes.io/name: atlantis-tyriis
+    app.kubernetes.io/name: apps-atlantis-tyriis
     kustomize.toolkit.fluxcd.io/name: apps-atlantis-tyriis
     kustomize.toolkit.fluxcd.io/namespace: flux-system
   name: atlantis-tyriis-config
   namespace: atlantis
 
--- kubernetes/talos-flux/apps/atlantis/atlantis/tyriis Kustomization: flux-system/apps-atlantis-tyriis ConfigMap: atlantis/atlantis-tyriis-allow-list

+++ kubernetes/talos-flux/apps/atlantis/atlantis/tyriis Kustomization: flux-system/apps-atlantis-tyriis ConfigMap: atlantis/atlantis-tyriis-allow-list

@@ -6,13 +6,12 @@

     tyriis-automation[bot]
 kind: ConfigMap
 metadata:
   annotations:
     kustomize.toolkit.fluxcd.io/substitute: disabled
   labels:
-    app.kubernetes.io/instance: atlantis-tyriis
-    app.kubernetes.io/name: atlantis-tyriis
+    app.kubernetes.io/name: apps-atlantis-tyriis
     kustomize.toolkit.fluxcd.io/name: apps-atlantis-tyriis
     kustomize.toolkit.fluxcd.io/namespace: flux-system
   name: atlantis-tyriis-allow-list
   namespace: atlantis
 
--- kubernetes/talos-flux/apps/atlantis/atlantis/tyriis Kustomization: flux-system/apps-atlantis-tyriis ConfigMap: atlantis/atlantis-tyriis-scripts

+++ kubernetes/talos-flux/apps/atlantis/atlantis/tyriis Kustomization: flux-system/apps-atlantis-tyriis ConfigMap: atlantis/atlantis-tyriis-scripts

@@ -14,13 +14,12 @@

     fi
 kind: ConfigMap
 metadata:
   annotations:
     kustomize.toolkit.fluxcd.io/substitute: disabled
   labels:
-    app.kubernetes.io/instance: atlantis-tyriis
-    app.kubernetes.io/name: atlantis-tyriis
+    app.kubernetes.io/name: apps-atlantis-tyriis
     kustomize.toolkit.fluxcd.io/name: apps-atlantis-tyriis
     kustomize.toolkit.fluxcd.io/namespace: flux-system
   name: atlantis-tyriis-scripts
   namespace: atlantis

@tyriis tyriis merged commit 8cb505d into main Feb 11, 2025
16 checks passed
@tyriis tyriis deleted the feature/atlantis-migrate-to-app-template branch February 11, 2025 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant