Skip to content

🐛 fix(civo/project-cluster): external-dns domain + one-shot Job hooks#53

Open
CristhianF7 wants to merge 77 commits into
mainfrom
fix/civo-project-cluster-dns-and-hooks
Open

🐛 fix(civo/project-cluster): external-dns domain + one-shot Job hooks#53
CristhianF7 wants to merge 77 commits into
mainfrom
fix/civo-project-cluster-dns-and-hooks

Conversation

@CristhianF7

Copy link
Copy Markdown
Contributor

Summary

Three template bugs in templates/civo/project-cluster leave freshly-created mgmt clusters with Degraded / flapping ArgoCD apps. Diagnosed live on e2e-mgmt-cluster-k3m; hotfixed in the rendered k1-civo/gitops and now fixed at the source here.

Fixes

1. external-dns publishes nothing → NXDOMAIN → cert/Gateway cascade

templates/30-external-dns.yaml set domainFilters: [ {{ .Values.domainName }} ]. domainName defaults to konstruct.io and is never overridden, while every hostname (gateway/HTTPRoutes) uses {{ .Values.domain }} — the real env domain that is injected at render (e.g. kubefunk.net). So external-dns filtered out all hostnames and published nothing:

challenge ... Waiting for HTTP-01 challenge propagation: failed to perform self check
GET 'http://argocd-<cluster>.<domain>/.well-known/acme-challenge/...': ... no such host

→ ACME HTTP-01 self-check fails → Certificates never issue → Gateway/eg HTTPS listeners InvalidCertificateRefargocd, envoy-gateway-components, registry Degraded.

Fix: point domainFilters at {{ .Values.domain }} (same value the hostnames use) and drop the now-unused domainName from values.yaml.

2. github-token-refresher-init Jobs stuck the apps OutOfSync/Missing

Both copies (argocd/ and crossplane-components/) used helm.sh/hook-delete-policy: hook-succeeded. ArgoCD deletes the Job on success but still tracks it as a desired resource → live state lacks it → app perpetually OutOfSync/Missing and retries the hook.

Fix: before-hook-creation so the completed Job persists.

3. apply-argocd-clusters-app flapped the argocd app every ~100s

Plain Job with ttlSecondsAfterFinished: 100 and no hook annotation. Kubernetes auto-deletes it ~100s after completion while ArgoCD tracks it → the argocd Application flaps Synced ↔ OutOfSync / Healthy ↔ Missing on a ~100s cycle.

Fix: annotate as a post-install,post-upgrade hook with before-hook-creation and remove the TTL, so ArgoCD excludes it from the live-vs-desired diff.

Notes

  • The underlying clusters are functionally healthy throughout; these are sync-status/cert issues from template config.
  • Same hotfixes were applied directly to k1-civo/gitops for the live e2e-mgmt-cluster-k3m to unblock it.
  • This targets saas-rishi (the Helm v2 layout these clusters render from); main uses a different (tokenized) layout and isn't affected by the same lines.

jokestax and others added 29 commits April 13, 2026 11:06
* feat: add GPU cluster template and catalog items for Friday demo

- Create templates/civo/gpu-cluster/ with isGpu=true and is_gpu Terraform var
- Backfill is_gpu=false on workload-cluster template for consistency
- Add nvidia-nim-operator catalog item (k8s-nim-operator v3.0.2)
- Add runai catalog item (control-plane + cluster-agent v2.20.0)

Closes #35, Closes #36, Closes #37, Closes #38

* feat: add konstruct.yaml metadata to gpu-cluster and workload-cluster templates

Required for template registration via Konstruct UI/API.

* fix: correct terraform module path in template default URLs

The module lives under civo-github/, not at the repo root.

* fix: update open-webui default chart version to 13.3.1

* fix: cert-manager template fixes from gpu cluster dry run

- Downgrade cert-manager from v1.20.1 to v1.16.5 (selectableFields CRD
  incompatibility with older K8s versions)
- Disable startupapicheck (hangs on Talos clusters)
- Add ServerSideApply=true sync option (required for CRD apply)
- Remove duplicate 35-cert-manager.yaml (caused ArgoCD warnings)
- Add ServerSideApply to ollama-openwebui catalog app

* fix: add ServerSideApply to NIM operator and Run.ai catalog apps

Learned from dry run that CRD-heavy charts need ServerSideApply
to avoid annotation size limits during ArgoCD sync.

* fix: update Run.ai catalog to use public runai-cluster chart

- Switch from JFrog control-plane chart to GCS runai-cluster chart
  (publicly accessible, no auth required)
- Simplify to single Application (cluster agent only, no separate
  control-plane chart needed)
- Update chart version to 2.16.79
- Replace domain/TLS config with cluster URL/UID inputs

* fix(runai): restructure catalog for ArgoCD hook compatibility

ArgoCD interprets helm.sh/hook annotations as hooks and blocks sync.
Restructured Run.ai catalog to use pre-rendered manifests (hooks stripped)
instead of direct Helm chart source.

Catalog now outputs 3 Applications:
- Parent app (wave 47): points at runai environment dir
- Prereqs app (wave 49): creates runai, monitoring, runai-scale-adjust,
  runai-reservation namespaces
- Manifests app (wave 50): deploys rendered runai-cluster 2.16.79 chart

Static files in static/ dir are copied to gitops repo alongside rendered
templates. Manifests use <RUNAI_CLUSTER_URL> and <RUNAI_CLUSTER_UID>
token placeholders for cluster-specific values.

* fix: set civo-gpu demo defaults in NIM and Run.ai catalog values

* fix(nim): disable upgradeCRD hook in catalog template

ArgoCD blocks on helm.sh/hook pre-upgrade Job. Setting
operator.upgradeCRD=false prevents the hook from being rendered.
Add catalog templates for: envoy-gateway, external-dns, cert-manager,
external-secrets, vault, prometheus (kube-prometheus-stack), grafana,
reloader, and groundcover. Each template includes Chart.yaml, values.yaml
with @input annotations for UI form generation, and an ArgoCD Application
template.

Closes #41
PSP was removed in Kubernetes 1.25+. The groundcover chart 0.36.3
creates PSP resources by default, causing sync failures on modern
clusters. Disable pspEnabled across all subcharts (agent, loki,
victoria-metrics, promscale, timescaledb) with a configurable toggle
defaulting to false.
… Job hooks

Three fixes for the civo/project-cluster template that left freshly-created mgmt
clusters with Degraded/flapping ArgoCD apps:

1. external-dns domainFilters used .Values.domainName (default konstruct.io),
   never overridden, while all hostnames use .Values.domain (the real env domain
   that IS injected). external-dns published nothing (NXDOMAIN) -> ACME HTTP-01
   failed -> certs unissued -> Gateway HTTPS listeners InvalidCertificateRef ->
   argocd/envoy-gateway-components/registry Degraded. Point domainFilters at
   .Values.domain and drop the now-unused domainName value.

2. github-token-refresher-init Jobs (argocd + crossplane-components) used
   hook-delete-policy: hook-succeeded, so ArgoCD deleted them on success while
   still tracking them as desired -> apps stuck OutOfSync/Missing. Use
   before-hook-creation so the completed Job persists.

3. apply-argocd-clusters-app was a plain Job with ttlSecondsAfterFinished: 100;
   k8s auto-deleted it ~100s after completion while ArgoCD tracked it -> the
   argocd app flapped Synced<->OutOfSync every ~100s. Make it a post-install/
   post-upgrade hook (before-hook-creation) and drop the TTL.
Base automatically changed from saas-rishi to main July 4, 2026 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants