-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug fixes, task tweaks for certmanager and add genrules (#238)
* Add loki, kubeprom genrules * Migrate genrules for certmanager and roll in expiration check to sli * Add accept statuscode 5 to jq parse
- Loading branch information
Showing
12 changed files
with
350 additions
and
36 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
...ertmanager-healthcheck/.runwhen/generation-rules/k8s-certmanager-certificates-health.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
apiVersion: runwhen.com/v1 | ||
kind: GenerationRules | ||
spec: | ||
generationRules: | ||
- resourceTypes: | ||
- certificates.cert-manager.io | ||
- certificaterequests.cert-manager.io | ||
matchRules: | ||
- type: and | ||
matches: | ||
- type: pattern | ||
pattern: ".+" | ||
properties: [name] | ||
mode: substring | ||
slxs: | ||
- baseName: cert-health | ||
qualifiers: ["resource", "namespace", "cluster"] | ||
baseTemplateName: k8s-certmanager-certificate-health | ||
levelOfDetail: basic | ||
outputItems: | ||
- type: slx | ||
- type: sli | ||
- type: runbook | ||
templateName: k8s-certmanager-certificate-health-taskset.yaml |
43 changes: 43 additions & 0 deletions
43
...8s-certmanager-healthcheck/.runwhen/templates/k8s-certmanager-certificate-health-sli.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
apiVersion: runwhen.com/v1 | ||
kind: ServiceLevelIndicator | ||
metadata: | ||
name: {{slx_name}} | ||
labels: | ||
{% include "common-labels.yaml" %} | ||
annotations: | ||
{% include "common-annotations.yaml" %} | ||
spec: | ||
displayUnitsLong: Number | ||
displayUnitsShort: '#' | ||
locations: | ||
- {{default_location}} | ||
description: Measures ____ | ||
codeBundle: | ||
{% if repo_url %} | ||
repoUrl: {{repo_url}} | ||
{% else %} | ||
repoUrl: https://github.com/runwhen-contrib/rw-cli-codecollection.git | ||
{% endif %} | ||
{% if ref %} | ||
ref: {{ref}} | ||
{% else %} | ||
ref: main | ||
{% endif %} | ||
pathToRobot: codebundles/k8s-certmanager-healthcheck/sli.robot | ||
intervalStrategy: intermezzo | ||
intervalSeconds: 30 | ||
configProvided: | ||
- name: DISTRIBUTION | ||
value: {{custom.kubernetes_distribution}} | ||
- name: NAMESPACE | ||
value: '{{match_resource.resource.metadata.namespace}}' | ||
- name: CONTEXT | ||
value: {{context}} | ||
- name: KUBERNETES_DISTRIBUTION_BINARY | ||
value: {{custom.kubernetes_distribution_binary}} | ||
secretsProvided: | ||
- name: kubeconfig | ||
workspaceKey: {{custom.kubeconfig_secret_name}} | ||
servicesProvided: | ||
- name: kubectl | ||
locationServiceName: kubectl-service.shared |
23 changes: 23 additions & 0 deletions
23
...8s-certmanager-healthcheck/.runwhen/templates/k8s-certmanager-certificate-health-slx.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
apiVersion: runwhen.com/v1 | ||
kind: ServiceLevelX | ||
metadata: | ||
name: {{slx_name}} | ||
labels: | ||
{% include "common-labels.yaml" %} | ||
annotations: | ||
{% include "common-annotations.yaml" %} | ||
spec: | ||
imageURL: https://storage.googleapis.com/runwhen-nonprod-shared-images/icons/cert-manager.svg | ||
alias: {{namespace.name}} SSL Certificate Health | ||
asMeasuredBy: Certificates in an unready state | ||
configProvided: | ||
- name: OBJECT_NAME | ||
value: {{match_resource.resource.metadata.name}} | ||
owners: | ||
- {{workspace.owner_email}} | ||
statement: All certificates should be in a Ready state 99.5%. | ||
additionalContext: | ||
namespace: "{{match_resource.resource.metadata.namespace}}" | ||
labelMap: "{{match_resource.resource.metadata.labels}}" | ||
cluster: "{{ cluster.name }}" | ||
context: "{{ cluster.context }}" |
29 changes: 29 additions & 0 deletions
29
...ertmanager-healthcheck/.runwhen/templates/k8s-certmanager-certificate-health-taskset.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
apiVersion: runwhen.com/v1 | ||
kind: Runbook | ||
metadata: | ||
name: {{slx_name}} | ||
labels: | ||
{% include "common-labels.yaml" %} | ||
annotations: | ||
{% include "common-annotations.yaml" %} | ||
spec: | ||
location: {{default_location}} | ||
codeBundle: | ||
repoUrl: https://github.com/runwhen-contrib/rw-cli-codecollection | ||
ref: main | ||
pathToRobot: codebundles/k8s-certmanager-healthcheck/runbook.robot | ||
configProvided: | ||
- name: DISTRIBUTION | ||
value: {{custom.kubernetes_distribution}} | ||
- name: NAMESPACE | ||
value: '{{match_resource.resource.metadata.namespace}}' | ||
- name: CONTEXT | ||
value: {{context}} | ||
- name: KUBERNETES_DISTRIBUTION_BINARY | ||
value: {{custom.kubernetes_distribution_binary}} | ||
secretsProvided: | ||
- name: kubeconfig | ||
workspaceKey: {{custom.kubeconfig_secret_name}} | ||
servicesProvided: | ||
- name: {{custom.kubernetes_distribution_binary}} | ||
locationServiceName: {{custom.kubernetes_distribution_binary}}-service.shared |
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
20 changes: 20 additions & 0 deletions
20
codebundles/k8s-loki-healthcheck/.runwhen/generation-rules/k8s-loki-healthcheck.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
apiVersion: runwhen.com/v1 | ||
kind: GenerationRules | ||
spec: | ||
generationRules: | ||
- resourceTypes: | ||
- statefulset | ||
matchRules: | ||
- type: pattern | ||
pattern: "loki" | ||
properties: [name] | ||
mode: substring | ||
slxs: | ||
- baseName: loki-hlthck | ||
qualifiers: ["resource", "namespace", "cluster"] | ||
baseTemplateName: k8s-loki-healthcheck | ||
levelOfDetail: detailed | ||
outputItems: | ||
- type: slx | ||
- type: runbook | ||
templateName: k8s-loki-healthcheck-taskset.yaml |
23 changes: 23 additions & 0 deletions
23
codebundles/k8s-loki-healthcheck/.runwhen/templates/k8s-loki-healthcheck-slx.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
apiVersion: runwhen.com/v1 | ||
kind: ServiceLevelX | ||
metadata: | ||
name: {{slx_name}} | ||
labels: | ||
{% include "common-labels.yaml" %} | ||
annotations: | ||
{% include "common-annotations.yaml" %} | ||
spec: | ||
imageURL: https://storage.googleapis.com/runwhen-nonprod-shared-images/icons/grafana-loki.svg | ||
alias: Loki Stack Health | ||
asMeasuredBy: The Loki stack is up, and healthy. | ||
configProvided: | ||
- name: OBJECT_NAME | ||
value: {{match_resource.resource.metadata.name}} | ||
owners: | ||
- {{workspace.owner_email}} | ||
statement: Loki's stack should be up, healthy with a up-to-date hash ring in the {{namespace.name}} namespace. | ||
additionalContext: | ||
namespace: "{{match_resource.resource.metadata.namespace}}" | ||
labelMap: "{{match_resource.resource.metadata.labels}}" | ||
cluster: "{{ cluster.name }}" | ||
context: "{{ cluster.context }}" |
35 changes: 35 additions & 0 deletions
35
codebundles/k8s-loki-healthcheck/.runwhen/templates/k8s-loki-healthcheck-taskset.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
apiVersion: runwhen.com/v1 | ||
kind: Runbook | ||
metadata: | ||
name: {{slx_name}} | ||
labels: | ||
{% include "common-labels.yaml" %} | ||
annotations: | ||
{% include "common-annotations.yaml" %} | ||
spec: | ||
location: {{default_location}} | ||
codeBundle: | ||
{% if repo_url %} | ||
repoUrl: {{repo_url}} | ||
{% else %} | ||
repoUrl: https://github.com/runwhen-contrib/rw-cli-codecollection.git | ||
{% endif %} | ||
{% if ref %} | ||
ref: {{ref}} | ||
{% else %} | ||
ref: main | ||
{% endif %} | ||
pathToRobot: codebundles/k8s-loki-healthcheck/runbook.robot | ||
configProvided: | ||
- name: NAMESPACE | ||
value: '{{match_resource.resource.metadata.namespace}}' | ||
- name: CONTEXT | ||
value: {{context}} | ||
- name: KUBERNETES_DISTRIBUTION_BINARY | ||
value: {{custom.kubernetes_distribution_binary}} | ||
secretsProvided: | ||
- name: kubeconfig | ||
workspaceKey: {{custom.kubeconfig_secret_name}} | ||
servicesProvided: | ||
- name: {{custom.kubernetes_distribution_binary}} | ||
locationServiceName: {{custom.kubernetes_distribution_binary}}-service.shared |
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
20 changes: 20 additions & 0 deletions
20
...dles/k8s-prometheus-healthcheck/.runwhen/generation-rules/k8s-prometheus-healthcheck.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
apiVersion: runwhen.com/v1 | ||
kind: GenerationRules | ||
spec: | ||
generationRules: | ||
- resourceTypes: | ||
- prometheuses.monitoring.coreos.com | ||
matchRules: | ||
- type: pattern | ||
pattern: ".+" | ||
properties: [name] | ||
mode: substring | ||
slxs: | ||
- baseName: kubeprom-hlthck | ||
qualifiers: ["resource", "namespace", "cluster"] | ||
baseTemplateName: k8s-prometheus-healthcheck | ||
levelOfDetail: detailed | ||
outputItems: | ||
- type: slx | ||
- type: runbook | ||
templateName: k8s-prometheus-healthcheck-taskset.yaml |
23 changes: 23 additions & 0 deletions
23
...bundles/k8s-prometheus-healthcheck/.runwhen/templates/k8s-prometheus-healthcheck-slx.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
apiVersion: runwhen.com/v1 | ||
kind: ServiceLevelX | ||
metadata: | ||
name: {{slx_name}} | ||
labels: | ||
{% include "common-labels.yaml" %} | ||
annotations: | ||
{% include "common-annotations.yaml" %} | ||
spec: | ||
imageURL: https://storage.googleapis.com/runwhen-nonprod-shared-images/icons/prometheus_color.svg | ||
alias: Kubeprometheus Operator Health | ||
asMeasuredBy: The Kubeprometheus operator is healthy and its ServiceMonitors are functional. | ||
configProvided: | ||
- name: OBJECT_NAME | ||
value: {{match_resource.resource.metadata.name}} | ||
owners: | ||
- {{workspace.owner_email}} | ||
statement: The Kubeprometheus operator should be healthy in the {{namespace.name}} namespace and its ServiceMonitors are functional. | ||
additionalContext: | ||
namespace: "{{match_resource.resource.metadata.namespace}}" | ||
labelMap: "{{match_resource.resource.metadata.labels}}" | ||
cluster: "{{ cluster.name }}" | ||
context: "{{ cluster.context }}" |
Oops, something went wrong.