feat: install kube-prometheus-stack CRDs during argocd install#515
Open
venkatamutyala wants to merge 4 commits into
Open
feat: install kube-prometheus-stack CRDs during argocd install#515venkatamutyala wants to merge 4 commits into
venkatamutyala wants to merge 4 commits into
Conversation
Replicates the kube-prometheus-stack-crds ArgoCD app from platform-helm-chart-platform via kubectl: the chart version is read from VERSIONS/glueops.yaml (kube_prometheus_stack_version, added by GlueOps/terraform-module-cloud-multy-prerequisites#648), the CRD folder is sparse-cloned from prometheus-community/helm-charts at that tag, and applied server-side (the prometheus CRDs are too large for client-side apply, mirroring the app's Replace=true). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The command block is printed before being eval'd so users can copy it to re-run or debug (the set -x trace alone references a temp dir that is deleted afterwards, so it is not re-runnable as copied). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Replaces the set -x traces around the helm diff/upgrade commands and the argocd pre-commands with a clean echo of the exact command string before it is eval'd, so users can copy it to re-run or debug (e.g. swap 'helm diff upgrade' for 'helm template'). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Run pre_commands and install_kube_prometheus_stack_crds inside a tested condition so failures reach the retry/continue handler instead of set -e killing the whole session (the old bare eval made the $? check dead code). - Keep the echoed pre_commands fully copy-pastable by moving the CRD function call out of the string; the function prints its own self-contained block. - Chain the CRD block with && (fail-fast survives the suspended set -e) and clean up the temp dir on the failure path. - GIT_TERMINAL_PROMPT=0 so GitHub auth/rate-limit prompts fail fast instead of hanging. - Fix the helm template hint: --allow-unreleased is helm-diff-only and must be dropped when swapping to template. - Drop unused 'crd' local. Failure paths (missing version key, nonexistent tag, kubectl failure) and the success path verified with a stubbed harness: the menu loop survives, no temp dirs leak, echoed block matches what runs. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
Author
|
Migration sequencing (from the multi-agent review): the old |
venkatamutyala
added a commit
to GlueOps/platform-helm-chart-platform
that referenced
this pull request
Jul 7, 2026
Removes the resources-finalizer and the automated sync policy (prune + selfHeal) from the kube-prometheus-stack-crds Application. The CRDs are now installed by captain_utils via kubectl server-side apply (GlueOps/codespaces#515, versioned through VERSIONS/glueops.yaml by GlueOps/terraform-module-cloud-multy-prerequisites#648). Without the finalizer, deleting the Application in a future release is non-cascading: the CRDs (and every CR of those kinds cluster-wide) are orphaned in place instead of garbage-collected. Dropping automated sync stops selfHeal from reverting kubectl-applied CRD updates during the transition. BREAKING CHANGE: after upgrading, and before the follow-up release deletes this Application, verify it has no finalizer — otherwise the delete cascades and wipes the kube-prometheus-stack CRDs and all monitoring CRs. Verify with `kubectl get application kube-prometheus-stack-crds -n glueops-core -o jsonpath='{.metadata.finalizers}'` and expect empty output; if it is non-empty, strip it first with `kubectl patch application kube-prometheus-stack-crds -n glueops-core --type merge -p '{"metadata":{"finalizers":null}}'`. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
venkatamutyala
added a commit
to GlueOps/platform-helm-chart-platform
that referenced
this pull request
Jul 7, 2026
Removes the resources-finalizer and the automated sync policy (prune + selfHeal) from the kube-prometheus-stack-crds Application. The CRDs are now installed by captain_utils via kubectl server-side apply (GlueOps/codespaces#515, versioned through VERSIONS/glueops.yaml by GlueOps/terraform-module-cloud-multy-prerequisites#648). Without the finalizer, deleting the Application in a future release is non-cascading: the CRDs (and every CR of those kinds cluster-wide) are orphaned in place instead of garbage-collected. Dropping automated sync stops selfHeal from reverting kubectl-applied CRD updates during the transition. BREAKING CHANGE: after upgrading, and before the follow-up release deletes this Application, verify it has no finalizer — otherwise the delete cascades and wipes the kube-prometheus-stack CRDs and all monitoring CRs. Verify with `kubectl get application kube-prometheus-stack-crds -n glueops-core -o jsonpath='{.metadata.finalizers}'` and expect empty output; if it is non-empty, strip it first with `kubectl patch application kube-prometheus-stack-crds -n glueops-core --type merge -p '{"metadata":{"finalizers":null}}'`. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
handle_argocdnow installs the kube-prometheus-stack CRDs as part of its pre-commands (right after the ArgoCD CRDs), replicating thekube-prometheus-stack-crdsArgoCD Application from platform-helm-chart-platform with plain kubectl.How it works
VERSIONS/glueops.yaml(kube_prometheus_stack_version) in production, like the other components — added by feat: add kube_prometheus_stack_version to generated VERSIONS/glueops.yaml terraform-module-cloud-multy-prerequisites#648. Dev mode falls back to thetargetRevisionpinned onmainof platform-helm-chart-platform. A clear error is shown if the key is missing (olderVERSIONS/glueops.yaml— re-run terraform to regenerate).charts/kube-prometheus-stack/charts/crds/crds) is sparse-cloned fromprometheus-community/helm-chartsat tagkube-prometheus-stack-<version>and applied in onekubectl apply --server-side --force-conflicts -R -f— no hardcoded file list, matching the app'sdirectory.recurse: true.Replace=true: the prometheus/alertmanager CRDs blow past the 256KB last-applied-configuration annotation limit of client-side apply.Testing
bash -nsyntax check passes.kube-prometheus-stack-59.1.0materializes exactly the 10 CRD yamls; full apply needs a live cluster (--server-sidecan't pair with--dry-run=client).🤖 Generated with Claude Code