Terraform
Cluster services, Gateway API dependencies, DNS, certificates, and CloudNativePG.
Operations guide
Terraform owns infrastructure and PostgreSQL. Helmfile owns the OpenIssuer application releases. Keeping that boundary clear makes deployment, recovery, and troubleshooting substantially safer.
Cluster services, Gateway API dependencies, DNS, certificates, and CloudNativePG.
Registry, service credentials, tenant seed configuration, and other sensitive values.
Application releases and their repository-specific Helm values in the configured namespace.
The reference deployment currently uses main, but OpenIssuer does not require that namespace. Set the namespace consistently in Terraform, Helmfile, Helm values, secrets, and Gateway API resources. The commands below use an environment variable so the value can be changed.
export NAMESPACE=mainRun the deployment Makefile from the Terraform repository root:
make platform-init
make platform-apply
make platform-output
make generate-utils-vars
make utils-init
make utils-applyThe Makefile loads secret Terraform variables from macOS Keychain. Do not commit DigitalOcean tokens, PostgreSQL passwords, or generated tfvars.
OpenIssuer uses one CloudNativePG cluster per application database. The reference configuration provisions 5 GiB volumes in the configured namespace.
kubectl get clusters.postgresql.cnpg.io -n "$NAMESPACE"
kubectl get pvc -n "$NAMESPACE"
kubectl get pods -n "$NAMESPACE"Continue only when every required database cluster reports a healthy primary and its PVC is bound.
Create or refresh the registry and service secrets through the repository targets:
make github-registry-secret
make account-rest-service-secret
make email-rest-service-secret
make do-s3-secretTenant seed values are converted into SPRING_APPLICATION_JSONand sealed before they are stored in the cluster. For the current zsh-based local setup, run:
NAMESPACE="$NAMESPACE" ./scripts/apply-authorization-seed-from-zshrc.sh
kubectl get sealedsecret authorization-seed -n "$NAMESPACE"
kubectl get secret authorization-seed -n "$NAMESPACE"From the deployment repository root, synchronize all managed releases:
helmfile syncDeploy or update one application by its Helmfile release name:
helmfile -l name=authorization-server sync
helmfile -l name=attempt-rest-service syncHelmfile release names match Kubernetes workload names. Internal WebClient calls resolve Kubernetes Service names supplied by each chart'sfullnameOverride.
A tag such as latest can point to a new image without changing the Deployment manifest. Helmfile therefore may have nothing to update. Force new pods after the image has been published:
kubectl rollout restart deployment/authorization-server -n "$NAMESPACE"
kubectl rollout status deployment/authorization-server -n "$NAMESPACE"RESTARTS counts container restarts inside a pod. A successful rollout normally creates a new pod with a recent age and a restart count of zero.
helm list -n "$NAMESPACE"
kubectl get deployments,pods,httproutes -n "$NAMESPACE"
kubectl logs -n "$NAMESPACE" deployment/authorization-server --tail=100Deleting CloudNativePG clusters or PVCs permanently removes application data. Scale dependent applications down first, confirm backups or accept the data loss, remove only the intended database resources, and reapply Terraform from the utils directory. Start applications only after every recreated cluster and PVC is healthy.
kubectl get output has been reviewed. Terraform must be run from platform orutils; running it from the repository root has no configuration.helm history authorization-server -n "$NAMESPACE"
helm rollback authorization-server REVISION -n "$NAMESPACE"
kubectl describe pod POD_NAME -n "$NAMESPACE"