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

Install AirTrail #605

Merged
merged 2 commits into from
Oct 3, 2024
Merged

Install AirTrail #605

merged 2 commits into from
Oct 3, 2024

Conversation

chrisbsmith
Copy link
Owner

No description provided.

Copy link

github-actions bot commented Oct 3, 2024

--- HelmRelease: services/airtrail Service: services/airtrail

+++ HelmRelease: services/airtrail Service: services/airtrail

@@ -0,0 +1,22 @@

+---
+apiVersion: v1
+kind: Service
+metadata:
+  name: airtrail
+  labels:
+    app.kubernetes.io/instance: airtrail
+    app.kubernetes.io/managed-by: Helm
+    app.kubernetes.io/name: airtrail
+    app.kubernetes.io/service: airtrail
+spec:
+  type: ClusterIP
+  ports:
+  - port: 3000
+    targetPort: 3000
+    protocol: TCP
+    name: http
+  selector:
+    app.kubernetes.io/component: airtrail
+    app.kubernetes.io/instance: airtrail
+    app.kubernetes.io/name: airtrail
+
--- HelmRelease: services/airtrail Deployment: services/airtrail

+++ HelmRelease: services/airtrail Deployment: services/airtrail

@@ -0,0 +1,79 @@

+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: airtrail
+  labels:
+    app.kubernetes.io/component: airtrail
+    app.kubernetes.io/instance: airtrail
+    app.kubernetes.io/managed-by: Helm
+    app.kubernetes.io/name: airtrail
+  annotations:
+    reloader.stakater.com/auto: 'true'
+spec:
+  revisionHistoryLimit: 3
+  replicas: 1
+  strategy:
+    type: RollingUpdate
+  selector:
+    matchLabels:
+      app.kubernetes.io/component: airtrail
+      app.kubernetes.io/name: airtrail
+      app.kubernetes.io/instance: airtrail
+  template:
+    metadata:
+      labels:
+        app.kubernetes.io/component: airtrail
+        app.kubernetes.io/instance: airtrail
+        app.kubernetes.io/name: airtrail
+    spec:
+      enableServiceLinks: false
+      serviceAccountName: default
+      automountServiceAccountToken: true
+      securityContext:
+        fsGroup: 568
+        fsGroupChangePolicy: OnRootMismatch
+        runAsGroup: 568
+        runAsNonRoot: true
+        runAsUser: 568
+      hostIPC: false
+      hostNetwork: false
+      hostPID: false
+      dnsPolicy: ClusterFirst
+      initContainers:
+      - envFrom:
+        - secretRef:
+            name: airtrail-secret
+        image: ghcr.io/onedr0p/postgres-init:16
+        name: init-db
+        volumeMounts:
+        - mountPath: /config
+          name: config
+      containers:
+      - env:
+        - name: ORIGIN
+          value: airtrail.
+        envFrom:
+        - secretRef:
+            name: airtrail-secret
+        image: docker.io/johly/airtrail:v0.2.0
+        name: app
+        resources:
+          limits:
+            memory: 128Mi
+          requests:
+            cpu: 10m
+            memory: 64Mi
+        securityContext:
+          allowPrivilegeEscalation: false
+          capabilities:
+            drop:
+            - ALL
+          readOnlyRootFilesystem: true
+        volumeMounts:
+        - mountPath: /config
+          name: config
+      volumes:
+      - emptyDir: {}
+        name: config
+
--- HelmRelease: services/airtrail Ingress: services/airtrail

+++ HelmRelease: services/airtrail Ingress: services/airtrail

@@ -0,0 +1,28 @@

+---
+apiVersion: networking.k8s.io/v1
+kind: Ingress
+metadata:
+  name: airtrail
+  labels:
+    app.kubernetes.io/instance: airtrail
+    app.kubernetes.io/managed-by: Helm
+    app.kubernetes.io/name: airtrail
+  annotations:
+    external-dns.alpha.kubernetes.io/target: internal.
+spec:
+  ingressClassName: internal
+  tls:
+  - hosts:
+    - airtrail.
+  rules:
+  - host: airtrail.
+    http:
+      paths:
+      - path: /
+        pathType: Prefix
+        backend:
+          service:
+            name: airtrail
+            port:
+              number: 3000
+

Copy link

github-actions bot commented Oct 3, 2024

--- kubernetes/apps Kustomization: flux-system/cluster-apps Kustomization: flux-system/airtrail

+++ kubernetes/apps Kustomization: flux-system/cluster-apps Kustomization: flux-system/airtrail

@@ -0,0 +1,43 @@

+---
+apiVersion: kustomize.toolkit.fluxcd.io/v1
+kind: Kustomization
+metadata:
+  labels:
+    kustomize.toolkit.fluxcd.io/name: cluster-apps
+    kustomize.toolkit.fluxcd.io/namespace: flux-system
+  name: airtrail
+  namespace: flux-system
+spec:
+  commonMetadata:
+    labels:
+      app.kubernetes.io/name: airtrail
+  decryption:
+    provider: sops
+    secretRef:
+      name: sops-age
+  dependsOn:
+  - name: cloudnative-pg-cluster
+  - name: external-secrets-stores
+  interval: 30m
+  path: ./kubernetes/apps/services/airtrail/app
+  postBuild:
+    substitute:
+      APP: airtrail
+    substituteFrom:
+    - kind: ConfigMap
+      name: cluster-settings
+    - kind: Secret
+      name: cluster-secrets
+    - kind: ConfigMap
+      name: cluster-settings-user
+    - kind: Secret
+      name: cluster-secrets-user
+  prune: true
+  retryInterval: 1m
+  sourceRef:
+    kind: GitRepository
+    name: home-kubernetes
+  targetNamespace: services
+  timeout: 5m
+  wait: false
+
--- kubernetes/apps/services/airtrail/app Kustomization: flux-system/airtrail ExternalSecret: services/airtail

+++ kubernetes/apps/services/airtrail/app Kustomization: flux-system/airtrail ExternalSecret: services/airtail

@@ -0,0 +1,35 @@

+---
+apiVersion: external-secrets.io/v1beta1
+kind: ExternalSecret
+metadata:
+  labels:
+    app.kubernetes.io/name: airtrail
+    kustomize.toolkit.fluxcd.io/name: airtrail
+    kustomize.toolkit.fluxcd.io/namespace: flux-system
+  name: airtail
+  namespace: services
+spec:
+  dataFrom:
+  - extract:
+      key: airtrail
+  - extract:
+      key: cloudnative-pg
+  secretStoreRef:
+    kind: ClusterSecretStore
+    name: onepassword-connect
+  target:
+    name: airtrail-secret
+    template:
+      data:
+        DB_DATABASE_NAME: airtrail
+        DB_PASSWORD: '{{ .AIRTRAIL_POSTGRES_PASS }}'
+        DB_URL: postgres://{{ .AIRTRAIL_POSTGRES_USER }}:{{ .AIRTRAIL_POSTGRES_PASS
+          }}@postgres16-rw.database.svc.cluster.local/airtrail
+        DB_USERNAME: '{{ .AIRTRAIL_POSTGRES_USER }}'
+        INIT_POSTGRES_DBNAME: airtail
+        INIT_POSTGRES_HOST: postgres16-rw.database.svc.cluster.local
+        INIT_POSTGRES_PASS: '{{ .AIRTRAIL_POSTGRES_PASS }}'
+        INIT_POSTGRES_SUPER_PASS: '{{ .POSTGRES_SUPER_PASS }}'
+        INIT_POSTGRES_USER: '{{ .AIRTRAIL_POSTGRES_USER }}'
+      engineVersion: v2
+
--- kubernetes/apps/services/airtrail/app Kustomization: flux-system/airtrail HelmRelease: services/airtrail

+++ kubernetes/apps/services/airtrail/app Kustomization: flux-system/airtrail HelmRelease: services/airtrail

@@ -0,0 +1,100 @@

+---
+apiVersion: helm.toolkit.fluxcd.io/v2
+kind: HelmRelease
+metadata:
+  labels:
+    app.kubernetes.io/name: airtrail
+    kustomize.toolkit.fluxcd.io/name: airtrail
+    kustomize.toolkit.fluxcd.io/namespace: flux-system
+  name: airtrail
+  namespace: services
+spec:
+  chart:
+    spec:
+      chart: app-template
+      sourceRef:
+        kind: HelmRepository
+        name: bjw-s
+        namespace: flux-system
+      version: 3.4.0
+  install:
+    remediation:
+      retries: 3
+  interval: 30m
+  uninstall:
+    keepHistory: false
+  upgrade:
+    cleanupOnFail: true
+    remediation:
+      retries: 3
+  values:
+    controllers:
+      airtrail:
+        annotations:
+          reloader.stakater.com/auto: 'true'
+        containers:
+          app:
+            env:
+              ORIGIN: '{{ .Release.Name }}.'
+            envFrom:
+            - secretRef:
+                name: airtrail-secret
+            image:
+              repository: docker.io/johly/airtrail
+              tag: v0.2.0
+            resources:
+              limits:
+                memory: 128Mi
+              requests:
+                cpu: 10m
+                memory: 64Mi
+            securityContext:
+              allowPrivilegeEscalation: false
+              capabilities:
+                drop:
+                - ALL
+              readOnlyRootFilesystem: true
+        initContainers:
+          init-db:
+            envFrom:
+            - secretRef:
+                name: airtrail-secret
+            image:
+              repository: ghcr.io/onedr0p/postgres-init
+              tag: 16
+        pod:
+          securityContext:
+            fsGroup: 568
+            fsGroupChangePolicy: OnRootMismatch
+            runAsGroup: 568
+            runAsNonRoot: true
+            runAsUser: 568
+        replicas: 1
+        strategy: RollingUpdate
+    ingress:
+      app:
+        annotations:
+          external-dns.alpha.kubernetes.io/target: internal.
+        className: internal
+        enabled: true
+        hosts:
+        - host: '{{ .Release.Name }}.'
+          paths:
+          - path: /
+            service:
+              identifier: app
+              port: http
+        tls:
+        - hosts:
+          - '{{ .Release.Name }}.'
+    persistence:
+      config:
+        enabled: true
+        type: emptyDir
+    service:
+      app:
+        controller: airtrail
+        ports:
+          http:
+            port: 3000
+
--- kubernetes/apps/services/airtrail/app Kustomization: flux-system/airtrail ConfigMap: services/airtrail-gatus-ep

+++ kubernetes/apps/services/airtrail/app Kustomization: flux-system/airtrail ConfigMap: services/airtrail-gatus-ep

@@ -0,0 +1,27 @@

+---
+apiVersion: v1
+data:
+  config.yaml: |-
+    endpoints:
+      - name: "airtrail"
+        group: internal
+        url: "https://airtrail."
+        interval: 1m
+        ui:
+          hide-hostname: true
+          hide-url: true
+        conditions:
+          - "[STATUS] < 300"
+          - "[RESPONSE_TIME] < 300"
+        alerts:
+          - type: pushover
+kind: ConfigMap
+metadata:
+  labels:
+    app.kubernetes.io/name: airtrail
+    gatus.io/enabled: 'true'
+    kustomize.toolkit.fluxcd.io/name: airtrail
+    kustomize.toolkit.fluxcd.io/namespace: flux-system
+  name: airtrail-gatus-ep
+  namespace: services
+

@chrisbsmith chrisbsmith merged commit 721c3f6 into main Oct 3, 2024
5 checks passed
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