-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: enable crossplane health checks #1106
Open
jkleinlercher
wants to merge
2
commits into
main
Choose a base branch
from
feat/crossplane-health-check
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains 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
Signed-off-by: Johannes Kleinlercher <johannes.kleinlercher@suxess-it.com>
Changes Rendered Chartdiff -U 4 -r out/target/argocd/values-k3d.yaml/argocd/charts/argo-cd/templates/argocd-application-controller/statefulset.yaml out/pr/argocd/values-k3d.yaml/argocd/charts/argo-cd/templates/argocd-application-controller/statefulset.yaml
--- out/target/argocd/values-k3d.yaml/argocd/charts/argo-cd/templates/argocd-application-controller/statefulset.yaml 2025-03-03 17:16:43.734639467 +0000
+++ out/pr/argocd/values-k3d.yaml/argocd/charts/argo-cd/templates/argocd-application-controller/statefulset.yaml 2025-03-03 17:16:07.267369443 +0000
@@ -24,9 +24,9 @@
template:
metadata:
annotations:
checksum/cmd-params: 021657bca0b768f07802318ce7d0b20b3d5045c2feedf146761230e3127d1a38
- checksum/cm: 092e4b68676523e0791c5a3260457f72fb09b529679b11d8e23fa30c7ac50527
+ checksum/cm: d8729e9013919be081e3d3c170bb4bcf7375eb3f4283a8bc4ceb2f3e4d1f3fd3
labels:
helm.sh/chart: argo-cd-7.8.5
app.kubernetes.io/name: argocd-application-controller
app.kubernetes.io/instance: release-name
diff -U 4 -r out/target/argocd/values-k3d.yaml/argocd/charts/argo-cd/templates/argocd-configs/argocd-cm.yaml out/pr/argocd/values-k3d.yaml/argocd/charts/argo-cd/templates/argocd-configs/argocd-cm.yaml
--- out/target/argocd/values-k3d.yaml/argocd/charts/argo-cd/templates/argocd-configs/argocd-cm.yaml 2025-03-03 17:16:43.730639437 +0000
+++ out/pr/argocd/values-k3d.yaml/argocd/charts/argo-cd/templates/argocd-configs/argocd-cm.yaml 2025-03-03 17:16:07.263369411 +0000
@@ -34,8 +34,123 @@
end
end
end
return hs
+
+ "*.upbound.io/*":
+ health.lua: |
+ health_status = {
+ status = "Progressing",
+ message = "Provisioning ..."
+ }
+ local function contains (table, val)
+ for i, v in ipairs(table) do
+ if v == val then
+ return true
+ end
+ end
+ return false
+ end
+ local has_no_status = {
+ "ProviderConfig",
+ "ProviderConfigUsage"
+ }
+ if obj.status == nil or next(obj.status) == nil and contains(has_no_status, obj.kind) then
+ health_status.status = "Healthy"
+ health_status.message = "Resource is up-to-date."
+ return health_status
+ end
+ if obj.status == nil or next(obj.status) == nil or obj.status.conditions == nil then
+ if obj.kind == "ProviderConfig" and obj.status.users ~= nil then
+ health_status.status = "Healthy"
+ health_status.message = "Resource is in use."
+ return health_status
+ end
+ return health_status
+ end
+ for i, condition in ipairs(obj.status.conditions) do
+ if condition.type == "LastAsyncOperation" then
+ if condition.status == "False" then
+ health_status.status = "Degraded"
+ health_status.message = condition.message
+ return health_status
+ end
+ end
+ if condition.type == "Synced" then
+ if condition.status == "False" then
+ health_status.status = "Degraded"
+ health_status.message = condition.message
+ return health_status
+ end
+ end
+ if condition.type == "Ready" then
+ if condition.status == "True" then
+ health_status.status = "Healthy"
+ health_status.message = "Resource is up-to-date."
+ return health_status
+ end
+ end
+ end
+ return health_status
+ "*.crossplane.io/*":
+ health.lua: |
+ health_status = {
+ status = "Progressing",
+ message = "Provisioning ..."
+ }
+ local function contains (table, val)
+ for i, v in ipairs(table) do
+ if v == val then
+ return true
+ end
+ end
+ return false
+ end
+ local has_no_status = {
+ "Composition",
+ "CompositionRevision",
+ "DeploymentRuntimeConfig",
+ "ControllerConfig",
+ "ProviderConfig",
+ "ProviderConfigUsage"
+ }
+ if obj.status == nil or next(obj.status) == nil and contains(has_no_status, obj.kind) then
+ health_status.status = "Healthy"
+ health_status.message = "Resource is up-to-date."
+ return health_status
+ end
+ if obj.status == nil or next(obj.status) == nil or obj.status.conditions == nil then
+ if obj.kind == "ProviderConfig" and obj.status.users ~= nil then
+ health_status.status = "Healthy"
+ health_status.message = "Resource is in use."
+ return health_status
+ end
+ return health_status
+ end
+ for i, condition in ipairs(obj.status.conditions) do
+ if condition.type == "LastAsyncOperation" then
+ if condition.status == "False" then
+ health_status.status = "Degraded"
+ health_status.message = condition.message
+ return health_status
+ end
+ end
+ if condition.type == "Synced" then
+ if condition.status == "False" then
+ health_status.status = "Degraded"
+ health_status.message = condition.message
+ return health_status
+ end
+ end
+ if contains({"Ready", "Healthy", "Offered", "Established"}, condition.type) then
+ if condition.status == "True" then
+ health_status.status = "Healthy"
+ health_status.message = "Resource is up-to-date."
+ return health_status
+ end
+ end
+ end
+ return health_status
server.rbac.log.enforce.enable: "false"
statusbadge.enabled: "false"
timeout.hard.reconciliation: 0s
timeout.reconciliation: 20s
diff -U 4 -r out/target/argocd/values-k3d.yaml/argocd/charts/argo-cd/templates/argocd-repo-server/deployment.yaml out/pr/argocd/values-k3d.yaml/argocd/charts/argo-cd/templates/argocd-repo-server/deployment.yaml
--- out/target/argocd/values-k3d.yaml/argocd/charts/argo-cd/templates/argocd-repo-server/deployment.yaml 2025-03-03 17:16:43.734639467 +0000
+++ out/pr/argocd/values-k3d.yaml/argocd/charts/argo-cd/templates/argocd-repo-server/deployment.yaml 2025-03-03 17:16:07.267369443 +0000
@@ -23,9 +23,9 @@
template:
metadata:
annotations:
checksum/cmd-params: 021657bca0b768f07802318ce7d0b20b3d5045c2feedf146761230e3127d1a38
- checksum/cm: 092e4b68676523e0791c5a3260457f72fb09b529679b11d8e23fa30c7ac50527
+ checksum/cm: d8729e9013919be081e3d3c170bb4bcf7375eb3f4283a8bc4ceb2f3e4d1f3fd3
labels:
helm.sh/chart: argo-cd-7.8.5
app.kubernetes.io/name: argocd-repo-server
app.kubernetes.io/instance: release-name
diff -U 4 -r out/target/argocd/values-k3d.yaml/argocd/charts/argo-cd/templates/argocd-server/deployment.yaml out/pr/argocd/values-k3d.yaml/argocd/charts/argo-cd/templates/argocd-server/deployment.yaml
--- out/target/argocd/values-k3d.yaml/argocd/charts/argo-cd/templates/argocd-server/deployment.yaml 2025-03-03 17:16:43.734639467 +0000
+++ out/pr/argocd/values-k3d.yaml/argocd/charts/argo-cd/templates/argocd-server/deployment.yaml 2025-03-03 17:16:07.267369443 +0000
@@ -23,9 +23,9 @@
template:
metadata:
annotations:
checksum/cmd-params: 021657bca0b768f07802318ce7d0b20b3d5045c2feedf146761230e3127d1a38
- checksum/cm: 092e4b68676523e0791c5a3260457f72fb09b529679b11d8e23fa30c7ac50527
+ checksum/cm: d8729e9013919be081e3d3c170bb4bcf7375eb3f4283a8bc4ceb2f3e4d1f3fd3
labels:
helm.sh/chart: argo-cd-7.8.5
app.kubernetes.io/name: argocd-server
app.kubernetes.io/instance: release-name |
Changes Default Values |
Changes Default Values |
Changes Rendered Chartdiff -U 4 -r out/target/argocd/values-k3d.yaml/argocd/charts/argo-cd/templates/argocd-application-controller/statefulset.yaml out/pr/argocd/values-k3d.yaml/argocd/charts/argo-cd/templates/argocd-application-controller/statefulset.yaml
--- out/target/argocd/values-k3d.yaml/argocd/charts/argo-cd/templates/argocd-application-controller/statefulset.yaml 2025-03-03 19:55:12.615651188 +0000
+++ out/pr/argocd/values-k3d.yaml/argocd/charts/argo-cd/templates/argocd-application-controller/statefulset.yaml 2025-03-03 19:54:44.366624949 +0000
@@ -24,9 +24,9 @@
template:
metadata:
annotations:
checksum/cmd-params: 021657bca0b768f07802318ce7d0b20b3d5045c2feedf146761230e3127d1a38
- checksum/cm: 092e4b68676523e0791c5a3260457f72fb09b529679b11d8e23fa30c7ac50527
+ checksum/cm: d8729e9013919be081e3d3c170bb4bcf7375eb3f4283a8bc4ceb2f3e4d1f3fd3
labels:
helm.sh/chart: argo-cd-7.8.5
app.kubernetes.io/name: argocd-application-controller
app.kubernetes.io/instance: release-name
diff -U 4 -r out/target/argocd/values-k3d.yaml/argocd/charts/argo-cd/templates/argocd-configs/argocd-cm.yaml out/pr/argocd/values-k3d.yaml/argocd/charts/argo-cd/templates/argocd-configs/argocd-cm.yaml
--- out/target/argocd/values-k3d.yaml/argocd/charts/argo-cd/templates/argocd-configs/argocd-cm.yaml 2025-03-03 19:55:12.611651188 +0000
+++ out/pr/argocd/values-k3d.yaml/argocd/charts/argo-cd/templates/argocd-configs/argocd-cm.yaml 2025-03-03 19:54:44.361624948 +0000
@@ -34,8 +34,123 @@
end
end
end
return hs
+
+ "*.upbound.io/*":
+ health.lua: |
+ health_status = {
+ status = "Progressing",
+ message = "Provisioning ..."
+ }
+ local function contains (table, val)
+ for i, v in ipairs(table) do
+ if v == val then
+ return true
+ end
+ end
+ return false
+ end
+ local has_no_status = {
+ "ProviderConfig",
+ "ProviderConfigUsage"
+ }
+ if obj.status == nil or next(obj.status) == nil and contains(has_no_status, obj.kind) then
+ health_status.status = "Healthy"
+ health_status.message = "Resource is up-to-date."
+ return health_status
+ end
+ if obj.status == nil or next(obj.status) == nil or obj.status.conditions == nil then
+ if obj.kind == "ProviderConfig" and obj.status.users ~= nil then
+ health_status.status = "Healthy"
+ health_status.message = "Resource is in use."
+ return health_status
+ end
+ return health_status
+ end
+ for i, condition in ipairs(obj.status.conditions) do
+ if condition.type == "LastAsyncOperation" then
+ if condition.status == "False" then
+ health_status.status = "Degraded"
+ health_status.message = condition.message
+ return health_status
+ end
+ end
+ if condition.type == "Synced" then
+ if condition.status == "False" then
+ health_status.status = "Degraded"
+ health_status.message = condition.message
+ return health_status
+ end
+ end
+ if condition.type == "Ready" then
+ if condition.status == "True" then
+ health_status.status = "Healthy"
+ health_status.message = "Resource is up-to-date."
+ return health_status
+ end
+ end
+ end
+ return health_status
+ "*.crossplane.io/*":
+ health.lua: |
+ health_status = {
+ status = "Progressing",
+ message = "Provisioning ..."
+ }
+ local function contains (table, val)
+ for i, v in ipairs(table) do
+ if v == val then
+ return true
+ end
+ end
+ return false
+ end
+ local has_no_status = {
+ "Composition",
+ "CompositionRevision",
+ "DeploymentRuntimeConfig",
+ "ControllerConfig",
+ "ProviderConfig",
+ "ProviderConfigUsage"
+ }
+ if obj.status == nil or next(obj.status) == nil and contains(has_no_status, obj.kind) then
+ health_status.status = "Healthy"
+ health_status.message = "Resource is up-to-date."
+ return health_status
+ end
+ if obj.status == nil or next(obj.status) == nil or obj.status.conditions == nil then
+ if obj.kind == "ProviderConfig" and obj.status.users ~= nil then
+ health_status.status = "Healthy"
+ health_status.message = "Resource is in use."
+ return health_status
+ end
+ return health_status
+ end
+ for i, condition in ipairs(obj.status.conditions) do
+ if condition.type == "LastAsyncOperation" then
+ if condition.status == "False" then
+ health_status.status = "Degraded"
+ health_status.message = condition.message
+ return health_status
+ end
+ end
+ if condition.type == "Synced" then
+ if condition.status == "False" then
+ health_status.status = "Degraded"
+ health_status.message = condition.message
+ return health_status
+ end
+ end
+ if contains({"Ready", "Healthy", "Offered", "Established"}, condition.type) then
+ if condition.status == "True" then
+ health_status.status = "Healthy"
+ health_status.message = "Resource is up-to-date."
+ return health_status
+ end
+ end
+ end
+ return health_status
server.rbac.log.enforce.enable: "false"
statusbadge.enabled: "false"
timeout.hard.reconciliation: 0s
timeout.reconciliation: 20s
diff -U 4 -r out/target/argocd/values-k3d.yaml/argocd/charts/argo-cd/templates/argocd-repo-server/deployment.yaml out/pr/argocd/values-k3d.yaml/argocd/charts/argo-cd/templates/argocd-repo-server/deployment.yaml
--- out/target/argocd/values-k3d.yaml/argocd/charts/argo-cd/templates/argocd-repo-server/deployment.yaml 2025-03-03 19:55:12.615651188 +0000
+++ out/pr/argocd/values-k3d.yaml/argocd/charts/argo-cd/templates/argocd-repo-server/deployment.yaml 2025-03-03 19:54:44.365624949 +0000
@@ -23,9 +23,9 @@
template:
metadata:
annotations:
checksum/cmd-params: 021657bca0b768f07802318ce7d0b20b3d5045c2feedf146761230e3127d1a38
- checksum/cm: 092e4b68676523e0791c5a3260457f72fb09b529679b11d8e23fa30c7ac50527
+ checksum/cm: d8729e9013919be081e3d3c170bb4bcf7375eb3f4283a8bc4ceb2f3e4d1f3fd3
labels:
helm.sh/chart: argo-cd-7.8.5
app.kubernetes.io/name: argocd-repo-server
app.kubernetes.io/instance: release-name
diff -U 4 -r out/target/argocd/values-k3d.yaml/argocd/charts/argo-cd/templates/argocd-server/deployment.yaml out/pr/argocd/values-k3d.yaml/argocd/charts/argo-cd/templates/argocd-server/deployment.yaml
--- out/target/argocd/values-k3d.yaml/argocd/charts/argo-cd/templates/argocd-server/deployment.yaml 2025-03-03 19:55:12.615651188 +0000
+++ out/pr/argocd/values-k3d.yaml/argocd/charts/argo-cd/templates/argocd-server/deployment.yaml 2025-03-03 19:54:44.366624949 +0000
@@ -23,9 +23,9 @@
template:
metadata:
annotations:
checksum/cmd-params: 021657bca0b768f07802318ce7d0b20b3d5045c2feedf146761230e3127d1a38
- checksum/cm: 092e4b68676523e0791c5a3260457f72fb09b529679b11d8e23fa30c7ac50527
+ checksum/cm: d8729e9013919be081e3d3c170bb4bcf7375eb3f4283a8bc4ceb2f3e4d1f3fd3
labels:
helm.sh/chart: argo-cd-7.8.5
app.kubernetes.io/name: argocd-server
app.kubernetes.io/instance: release-name |
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.
No description provided.