FluxCD Capacitor
Prerequisites
- Having a running Kubernetes cluster
- Bootstrapped fluxcd
- Knowledge on how to add charts/kubernetes resources with fluxcd
- Usage of an ingress to make the webhook accessible from outside your network
Initial Setup
- Create a new folder called
capacitor
inside theflux-system
folder. - Update the
kustomization.yaml
file influx-system
with- capacitor
- Next we will need 3 files inside the capacitor folder:
capacitor.yaml
apiVersion: kustomize.toolkit.fluxcd.io/v1kind: Kustomizationmetadata: name: capacitor namespace: flux-systemspec: targetNamespace: flux-system interval: 1h retryInterval: 2m timeout: 5m wait: true prune: true path: "./" sourceRef: kind: OCIRepository name: capacitor
ingress.yaml
apiVersion: networking.k8s.io/v1kind: Ingressmetadata: name: capacitor namespace: flux-system annotations: cert-manager.io/cluster-issuer: domain-0-le-prod # use what you have configured for your ingress cert-manager.io/private-key-rotation-policy: Alwaysspec: ingressClassName: internal rules: - host: capacitor.${DOMAIN_0} # use what you have configured for your ingress http: paths: - pathType: Prefix path: / backend: service: name: capacitor port: number: 9000 tls: - hosts: - capacitor.${DOMAIN_0} # use what you have configured for your ingress secretName: capacitor-tls-0 # use what you have configured for your ingress
kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1kind: Kustomizationresources: - capacitor.yaml - ingress.yaml
Add The Repository
Go to your Reponsitories/oci
directory and create this file.
capacitor-manifests.yaml
apiVersion: source.toolkit.fluxcd.io/v1beta2kind: OCIRepositorymetadata: name: capacitor namespace: flux-systemspec: interval: 12h url: oci://ghcr.io/gimlet-io/capacitor-manifests ref: semver: ">=0.1.0"
Update the kustomization.yaml in oci to include - capacitor-manifests.yaml
Finishing Steps
Reoncile your cluster.
flux reconcile source git cluster