From 9ea9da65ccf37ab4316ef16b99649b5ae4b62d0b Mon Sep 17 00:00:00 2001 From: Joseph Hanson Date: Mon, 28 Oct 2024 08:20:20 -0500 Subject: [PATCH] add scrutiny --- .../scrutiny/app/helmrelease.yaml | 123 ++++++++++++++++++ .../scrutiny/app/kustomization.yaml | 7 + .../apps/observability/scrutiny/ks.yaml | 24 ++++ 3 files changed, 154 insertions(+) create mode 100644 kubernetes/apps/observability/scrutiny/app/helmrelease.yaml create mode 100644 kubernetes/apps/observability/scrutiny/app/kustomization.yaml create mode 100644 kubernetes/apps/observability/scrutiny/ks.yaml diff --git a/kubernetes/apps/observability/scrutiny/app/helmrelease.yaml b/kubernetes/apps/observability/scrutiny/app/helmrelease.yaml new file mode 100644 index 00000000..68437325 --- /dev/null +++ b/kubernetes/apps/observability/scrutiny/app/helmrelease.yaml @@ -0,0 +1,123 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/bjw-s/helm-charts/main/charts/other/app-template/schemas/helmrelease-helm-v2.schema.json +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease +metadata: + name: &app scrutiny +spec: + interval: 30m + chart: + spec: + chart: app-template + version: 3.5.1 + sourceRef: + kind: HelmRepository + name: bjw-s + namespace: flux-system + install: + remediation: + retries: 3 + upgrade: + cleanupOnFail: true + remediation: + retries: 3 + strategy: rollback + values: + controllers: + scrutiny-collector: + type: cronjob + annotations: + reloader.stakater.com/auto: "true" + cronjob: + schedule: "@daily" + containers: + app: + image: + repository: ghcr.io/analogj/scrutiny + tag: v0.8.1-collector + env: + TZ: America/Chicago + COLLECTOR_API_ENDPOINT: http://scrutiny.observability.svc.cluster.local:8080 + COLLECTOR_HOST_ID: + valueFrom: + fieldRef: + fieldPath: spec.nodeName + args: + - /opt/scrutiny/bin/scrutiny-collector-metrics + - run + securityContext: + privileged: true + readOnlyRootFilesystem: true + resources: + requests: + cpu: 10m + limits: + memory: 128Mi + scrutiny: + containers: + app: + image: + repository: ghcr.io/analogj/scrutiny + tag: v0.8.1-web + env: + SCRUTINY_WEB_INFLUXDB_BUCKET: scrutiny + SCRUTINY_WEB_INFLUXDB_HOST: influxdb2.database.svc.cluster.local + SCRUTINY_WEB_INFLUXDB_ORG: scrutiny + TZ: America/Chicago + envFrom: + - secretRef: + name: scrutiny-secret + securityContext: + allowPrivilegeEscalation: false + readOnlyRootFilesystem: true + capabilities: { drop: ["ALL"] } + probes: + liveness: &probe + enabled: true + custom: true + spec: + httpGet: + path: /api/health + port: &port 8080 + readiness: *probe + startup: + enabled: false + + service: + scrutiny: + controller: scrutiny + ports: + http: + port: *port + ingress: + scrutiny: + className: internal-nginx + hosts: + - host: "{{ .Release.Name }}.jahanson.tech" + paths: + - path: / + service: + identifier: scrutiny + port: http + persistence: + scrutiny-config: + existingClaim: *app + advancedMounts: + scrutiny: + app: + - path: /opt/scrutiny/config + collector-config: + enabled: true + type: emptyDir + advancedMounts: + scrutiny-collector: + app: + - path: /config + dev: + type: hostPath + hostPath: /dev + hostPathType: Directory + udev: + type: hostPath + hostPath: /run/udev + hostPathType: Directory diff --git a/kubernetes/apps/observability/scrutiny/app/kustomization.yaml b/kubernetes/apps/observability/scrutiny/app/kustomization.yaml new file mode 100644 index 00000000..a928a563 --- /dev/null +++ b/kubernetes/apps/observability/scrutiny/app/kustomization.yaml @@ -0,0 +1,7 @@ +--- +# yaml-language-server: $schema=https://json.schemastore.org/kustomization +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - ./helmrelease.yaml + - ../../../../templates/volsync diff --git a/kubernetes/apps/observability/scrutiny/ks.yaml b/kubernetes/apps/observability/scrutiny/ks.yaml new file mode 100644 index 00000000..47bc5b5a --- /dev/null +++ b/kubernetes/apps/observability/scrutiny/ks.yaml @@ -0,0 +1,24 @@ +--- +# yaml-language-server: $schema=https://ks.hsn.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: &app scrutiny + namespace: flux-system +spec: + targetNamespace: observability + commonMetadata: + labels: + app.kubernetes.io/name: *app + path: ./kubernetes/apps/observability/scrutiny/app + prune: true + sourceRef: + kind: GitRepository + name: theshire + wait: false + interval: 30m + retryInterval: 1m + postBuild: + substitute: + APP: *app + VOLSYNC_CAPACITY: 1Gi