diff --git a/kubernetes/apps/capacitor/app/helmrelease.yaml b/kubernetes/apps/capacitor/app/helmrelease.yaml new file mode 100644 index 00000000..5947a708 --- /dev/null +++ b/kubernetes/apps/capacitor/app/helmrelease.yaml @@ -0,0 +1,103 @@ +--- +# 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 capacitor +spec: + interval: 15m + chart: + spec: + chart: app-template + version: 3.5.1 + sourceRef: + kind: HelmRepository + name: bjw-s-charts + namespace: flux-system + install: + createNamespace: true + remediation: + retries: 3 + upgrade: + remediation: + retries: 3 + values: + controllers: + capacitor: + replicas: 1 + pod: + securityContext: + fsGroup: 999 + # runAsGroup: 3000 + # runAsNonRoot: true + # runAsUser: 1000 + # seccompProfile: + # type: RuntimeDefault + containers: + app: + env: + TZ: ${SETTING_TZ} + + image: + repository: ghcr.io/gimlet-io/capacitor + tag: v0.4.8@sha256:a80207f52c054dba9e04e8b1ea86e297817ecf05ddbfce249c1f5eaf6ce8c7d8 + securityContext: + allowPrivilegeEscalation: false + capabilities: + drop: + - ALL + readOnlyRootFilesystem: true + + probes: + startup: + enabled: false + liveness: &probe + enabled: true + custom: true + spec: + httpGet: + path: / + port: &port 9000 + scheme: HTTP + initialDelaySeconds: 0 + periodSeconds: 10 + timeoutSeconds: 1 + failureThreshold: 3 + readiness: *probe + + resources: + requests: + cpu: 190m + memory: 127Mi + limits: + memory: 127Mi + + serviceAccount: + create: false + name: capacitor + + service: + app: + controller: capacitor + ports: + http: + enabled: true + port: *port + protocol: HTTP + + ingress: + app: + enabled: true + className: ingress-internal + hosts: + - host: &host "{{ .Release.Name }}.k8s.home.arpa" + paths: + - path: / + pathType: Prefix + service: + identifier: app + port: http + tls: + - hosts: + - *host + secretName: "{{ .Release.Name }}-tls" diff --git a/kubernetes/apps/capacitor/app/ks.yaml b/kubernetes/apps/capacitor/app/ks.yaml new file mode 100644 index 00000000..2f3bc7c2 --- /dev/null +++ b/kubernetes/apps/capacitor/app/ks.yaml @@ -0,0 +1,19 @@ +--- +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/capacitor/app + prune: true + sourceRef: + kind: GitRepository + name: home-kubernetes + wait: true + interval: 30m + timeout: 5m diff --git a/kubernetes/apps/capacitor/app/rbac.yaml b/kubernetes/apps/capacitor/app/rbac.yaml new file mode 100644 index 00000000..a7896e6b --- /dev/null +++ b/kubernetes/apps/capacitor/app/rbac.yaml @@ -0,0 +1,58 @@ +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: capacitor +--- +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 + - helmrepositories + - helmcharts + - 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