Installation¶
This page installs the operator and its CRDs. To create a Garage cluster once the operator is running, follow the quickstart.
Requirements¶
- Kubernetes
1.25or newer, or1.27or newer for node-local pools. - Helm
3.8or newer. - Garage
v2.0.0or newer. The default image is the tested Garagev2.6.0digest. - cert-manager, which issues the webhook certificates. The chart enables the webhooks by default.
The operator has to watch the namespaces where your GarageCluster, GarageNode, bucket, key and token resources live. zoneFrom and node-local pools need a cluster-scoped install.
Install the chart¶
helm install garage-operator \
oci://ghcr.io/rajsinghtech/charts/garage-operator \
--namespace garage-operator-system \
--create-namespace
In production, pin a chart version:
helm install garage-operator \
oci://ghcr.io/rajsinghtech/charts/garage-operator \
--version 0.9.6 \
--namespace garage-operator-system \
--create-namespace
The chart installs the CRDs and keeps them when you uninstall. By default it also turns on:
- conversion and validating webhooks
- leader election
- an authenticated HTTPS metrics endpoint with its own Service
- restrictive pod security settings for the operator
Don't disable webhooks for production storage
webhooks.enabled=false removes the admission checks and the v1beta1 conversion. Use it only for local development or simple v1beta2 experiments on EmptyDir. It doesn't work with node-local pools, operator-managed PVCs, PVC-backed rollouts and recovery, or prepared storage deletion.
Verify the installation¶
kubectl -n garage-operator-system rollout status \
deployment/garage-operator-controller-manager --timeout=180s
kubectl get crd \
garageclusters.garage.rajsingh.info \
garagebuckets.garage.rajsingh.info \
garagekeys.garage.rajsingh.info \
garagenodes.garage.rajsingh.info
Before upgrading an existing release, look at its current values:
helm get values garage-operator \
--namespace garage-operator-system --all
helm status garage-operator --namespace garage-operator-system
Namespace-scoped operation¶
Set watchNamespaces to make the operator reconcile only the namespaces you list. The release namespace is always included. CRDs are cluster-scoped, so a cluster administrator still has to install them.
helm upgrade --install garage-operator \
oci://ghcr.io/rajsinghtech/charts/garage-operator \
--namespace garage-operator-system \
--create-namespace \
--set 'watchNamespaces={storage,team-a,team-b}'
If you run COSI in its own namespace, set cosi.namespace and add a GarageReferenceGrant for it in each namespace that holds a target cluster.
Raw manifests (install.yaml or kustomize)¶
With Helm, you turn on website and web admin UI exposure through ingress.enabled and
gatewayAPI.enabled. The install.yaml release asset and the config/default
kustomize base can't do that. They start the manager without
--enable-ingress and --enable-gateway-api. Until you add the flags, a
GarageBucket with spec.websiteExposure.ingress (or .gateway) reports
WebsiteExposed=False with reason IngressDisabled (or GatewayAPIUnavailable),
and no Ingress or HTTPRoute is created. A GarageCluster with
spec.admin.webUI reports WebUIExposed=False for the same reasons.
install.yaml already has the RBAC rules for Ingresses and HTTPRoutes, so
the flags are all you need. Add only the ones you use. Gateway API needs its
own CRDs, and the operator never installs them.
To patch the running Deployment (the manager is the first container):
kubectl -n garage-operator-system patch deployment garage-operator-controller-manager \
--type=json -p='[
{"op":"add","path":"/spec/template/spec/containers/0/args/-","value":"--enable-ingress"},
{"op":"add","path":"/spec/template/spec/containers/0/args/-","value":"--enable-gateway-api"}
]'
Or set the environment variables the flags read:
kubectl -n garage-operator-system set env deployment/garage-operator-controller-manager \
ENABLE_INGRESS=true ENABLE_GATEWAY_API=true
To keep the change in Git, patch the release manifest with kustomize instead:
# kustomization.yaml
resources:
- install.yaml # the release asset, downloaded
patches:
- target:
kind: Deployment
name: garage-operator-controller-manager
patch: |-
- op: add
path: /spec/template/spec/containers/0/args/-
value: --enable-ingress
- op: add
path: /spec/template/spec/containers/0/args/-
value: --enable-gateway-api
The Deployment restarts, and the operator re-checks every bucket's
WebsiteExposed condition. Applying a fresh install.yaml later undoes a patch
made directly on the cluster, so use kustomize for anything long-lived.
Private registries and immutable images¶
Set imagePullSecrets to pull the operator image from a private registry. Set defaultGarageImage for Garage pods that don't set spec.image. To pin images, use image.digest for the operator and a digest in spec.image or defaultGarageImage for Garage.
Verify release artifacts¶
GitHub Actions signs release images and Helm charts with keyless cosign and
attaches provenance attestations. Release images also have an SPDX SBOM. Verify
an image before you put its digest in image.digest or GarageCluster.spec.image:
IMAGE=ghcr.io/rajsinghtech/garage-operator:v0.9.6
cosign verify "$IMAGE" \
--certificate-identity-regexp '^https://github.com/rajsinghtech/garage-operator/\.github/workflows/docker\.yml@refs/' \
--certificate-oidc-issuer https://token.actions.githubusercontent.com
gh attestation verify "oci://$IMAGE" --repo rajsinghtech/garage-operator
cosign download attestation "$IMAGE" \
--predicate-type https://spdx.dev/Document/v2.3
To verify the Helm chart, resolve its OCI digest first, then check that digest against the Helm publishing workflow's identity:
CHART=oci://ghcr.io/rajsinghtech/charts/garage-operator
helm show chart "$CHART" --version 0.9.6
# Resolve the OCI manifest descriptor with an OCI client such as ORAS.
oras manifest fetch --descriptor "$CHART:0.9.6"
# Set CHART_DIGEST to the sha256 digest in that descriptor.
CHART_DIGEST=ghcr.io/rajsinghtech/charts/garage-operator@sha256:<digest>
cosign verify "$CHART_DIGEST" \
--certificate-identity-regexp '^https://github.com/rajsinghtech/garage-operator/\.github/workflows/helm\.yml@refs/' \
--certificate-oidc-issuer https://token.actions.githubusercontent.com
gh attestation verify "oci://$CHART_DIGEST" --repo rajsinghtech/garage-operator
The install.yaml attached to each GitHub release has a provenance
attestation too. Download it and verify it against the repository:
gh release download v0.9.6 --repo rajsinghtech/garage-operator \
--pattern install.yaml
gh attestation verify install.yaml --repo rajsinghtech/garage-operator
Replace v0.9.6 with the release you're installing. In production, pin the
digests you verified, because a tag can be moved.
Uninstall¶
The CRDs and your resources stay in the cluster. Deleting a CRD deletes every resource of that kind, so back them up first:
kubectl get garageclusters,garagenodes,garagebuckets,garagekeys,garageadmintokens,garagereferencegrants,garagereplications -A -o yaml > garage-operator-resources.yaml
Removing the Helm release doesn't delete Garage data. Before you remove storage, follow the deletion and drain procedure.