diff --git a/kubernetes/apps/flux-system/capacitor/app/helmrelease.yaml b/kubernetes/apps/flux-system/capacitor/app/helmrelease.yaml new file mode 100644 index 000000000..b447954e5 --- /dev/null +++ b/kubernetes/apps/flux-system/capacitor/app/helmrelease.yaml @@ -0,0 +1,73 @@ +--- +# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/helm.toolkit.fluxcd.io/helmrelease_v2beta2.json +apiVersion: helm.toolkit.fluxcd.io/v2beta2 +kind: HelmRelease +metadata: + name: capacitor +spec: + interval: 30m + chart: + spec: + chart: app-template + version: 2.6.0 + sourceRef: + kind: HelmRepository + name: bjw-s + namespace: flux-system + install: + remediation: + retries: 3 + upgrade: + cleanupOnFail: true + remediation: + retries: 3 + uninstall: + keepHistory: false + values: + controllers: + main: + strategy: RollingUpdate + containers: + main: + image: + repository: ghcr.io/gimlet-io/capacitor + tag: v0.3.3 + resources: + requests: + cpu: 50m + memory: 100Mi + ephemeral-storage: 1Gi + limits: + memory: 200Mi + ephemeral-storage: 2Gi + securityContext: + allowPrivilegeEscalation: false + readOnlyRootFilesystem: true + capabilities: {drop: [ALL]} + serviceAccount: + create: true + name: "capacitor" + service: + main: + controller: main + ports: + http: + enabled: true + port: 9000 + ingress: + main: + enabled: true + className: nginx + annotations: + hajimari.io/icon: mdi:sync + hosts: + - host: &host "{{ .Release.Name }}.${SECRET_CLUSTER_DOMAIN}" + paths: + - path: / + service: + name: main + port: http + tls: + - hosts: + - *host + diff --git a/kubernetes/apps/flux-system/capacitor/app/kustomization.yaml b/kubernetes/apps/flux-system/capacitor/app/kustomization.yaml new file mode 100644 index 000000000..b4f5b8037 --- /dev/null +++ b/kubernetes/apps/flux-system/capacitor/app/kustomization.yaml @@ -0,0 +1,9 @@ +--- +# yaml-language-server: $schema=https://json.schemastore.org/kustomization +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: default +resources: + - ./helmrelease.yaml + - ./rbac.yaml + - ../../../../templates/gatus/guarded diff --git a/kubernetes/apps/flux-system/capacitor/app/rbac.yaml b/kubernetes/apps/flux-system/capacitor/app/rbac.yaml new file mode 100644 index 000000000..b6a51eaae --- /dev/null +++ b/kubernetes/apps/flux-system/capacitor/app/rbac.yaml @@ -0,0 +1,51 @@ +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: capacitor +rules: +- apiGroups: + - networking.k8s.io + - apps + - "" + resources: + - pods + - pods/log + - ingresses + - deployments + - services + - secrets + - events + - configmaps + verbs: + - get + - watch + - list +- apiGroups: + - source.toolkit.fluxcd.io + - kustomize.toolkit.fluxcd.io + - helm.toolkit.fluxcd.io + resources: + - gitrepositories + - ocirepositories + - buckets + - kustomizations + - helmreleases + verbs: + - get + - watch + - list + - patch # to allow force reconciling by adding an annotation +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: capacitor +subjects: + - kind: ServiceAccount + name: capacitor + namespace: flux-system +roleRef: + kind: ClusterRole + name: capacitor + apiGroup: rbac.authorization.k8s.io diff --git a/kubernetes/apps/flux-system/capacitor/ks.yaml b/kubernetes/apps/flux-system/capacitor/ks.yaml new file mode 100644 index 000000000..eaf97d064 --- /dev/null +++ b/kubernetes/apps/flux-system/capacitor/ks.yaml @@ -0,0 +1,24 @@ +--- +# yaml-language-server: $schema=https://kubernetes-schemas.devbu.io/kustomize.toolkit.fluxcd.io/kustomization_v1.json +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: &app capacitor + namespace: flux-system +spec: + targetNamespace: flux-system + commonMetadata: + labels: + app.kubernetes.io/name: *app + path: ./kubernetes/apps/flux-system/capacitor/app + prune: true + sourceRef: + kind: GitRepository + name: home-ops-kubernetes + wait: false + interval: 30m + retryInterval: 1m + timeout: 5m + postBuild: + substitute: + APP: *app diff --git a/kubernetes/apps/flux-system/kustomization.yaml b/kubernetes/apps/flux-system/kustomization.yaml index 7d9d5fe83..0a62dc53e 100644 --- a/kubernetes/apps/flux-system/kustomization.yaml +++ b/kubernetes/apps/flux-system/kustomization.yaml @@ -7,4 +7,5 @@ resources: - ./namespace.yaml # Flux-Kustomizations - ./addons/ks.yaml + - ./capacitor/ks.yaml # Standard Resources