-
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.
* update match rules for postgres triage * minor updates * update cli * update cmd * template updates * add supports * renames and adds sli * template name adjustments * add next step * wip * wip * x * fix path * postgres updates * add bash to runbook * add default db container * fix resource labels * fix sli setup * add escapes * update titles * update var * x * fix typo * try postgresqls * add database container config * change preempt default age * update workload name * postgres touchups * debug full match details * x * x * fix match * x * x * add dynamic backup age and add backup age to SLI * update check from crunchy cr * add next step * add pgbouncer config checks and update tags
- Loading branch information
1 parent
5ab13a5
commit a8d7570
Showing
22 changed files
with
1,042 additions
and
257 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -6,4 +6,5 @@ report.html | |
dist | ||
build | ||
*egg-info | ||
.kube | ||
.kube | ||
*.out |
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
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
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
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
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
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
21 changes: 21 additions & 0 deletions
21
.../k8s-postgres-healthcheck/.runwhen/generation-rules/k8s-postgres-healthcheck-crunchy.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,21 @@ | ||
apiVersion: runwhen.com/v1 | ||
kind: GenerationRules | ||
spec: | ||
generationRules: | ||
- resourceTypes: | ||
- postgresclusters.postgres-operator.crunchydata.com | ||
matchRules: | ||
- type: pattern | ||
pattern: ".+" | ||
properties: [name] | ||
mode: substring | ||
slxs: | ||
- baseName: postgres-health | ||
qualifiers: ["resource", "namespace", "cluster"] | ||
baseTemplateName: k8s-postgres-healthcheck-crunchy | ||
levelOfDetail: detailed | ||
outputItems: | ||
- type: slx | ||
- type: sli | ||
- type: runbook | ||
templateName: k8s-postgres-healthcheck-crunchy-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
52 changes: 52 additions & 0 deletions
52
...les/k8s-postgres-healthcheck/.runwhen/templates/k8s-postgres-healthcheck-crunchy-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,52 @@ | ||
apiVersion: runwhen.com/v1 | ||
kind: ServiceLevelIndicator | ||
metadata: | ||
name: {{slx_name}} | ||
labels: | ||
{% include "common-labels.yaml" %} | ||
annotations: | ||
{% include "common-annotations.yaml" %} | ||
spec: | ||
displayUnitsLong: OK | ||
displayUnitsShort: ok | ||
locations: | ||
- {{default_location}} | ||
description: Measures the health of a postgres cluster by scoring database lag, backups, and member readiness. | ||
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-postgres-healthcheck/sli.robot | ||
intervalStrategy: intermezzo | ||
intervalSeconds: 60 | ||
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}} | ||
- name: WORKLOAD_NAME | ||
value: '-l postgres-operator.crunchydata.com/cluster={{match_resource.resource.metadata.name}},postgres-operator.crunchydata.com/role=master' | ||
- name: RESOURCE_LABELS | ||
value: postgres-operator.crunchydata.com/cluster={{match_resource.resource.metadata.name}} | ||
- name: OBJECT_API_VERSION | ||
value: '{{match_resource.resource.apiVersion}}' | ||
- name: OBJECT_NAME | ||
value: '{{match_resource.resource.metadata.name}}' | ||
- name: DATABASE_CONTAINER | ||
value: 'database' | ||
- name: OBJECT_KIND | ||
value: {{match_resource.resource.kind}}.{{match_resource.resource.apiVersion.split('/')[0]}} | ||
secretsProvided: | ||
- name: kubeconfig | ||
workspaceKey: {{custom.kubeconfig_secret_name}} |
23 changes: 23 additions & 0 deletions
23
...les/k8s-postgres-healthcheck/.runwhen/templates/k8s-postgres-healthcheck-crunchy-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/CrunchyDataPrimaryIcon.png | ||
alias: {{match_resource.resource.metadata.name}} Postgres Health | ||
asMeasuredBy: Database is up and accepting connections. | ||
configProvided: | ||
- name: OBJECT_NAME | ||
value: {{match_resource.resource.metadata.name}} | ||
owners: | ||
- {{workspace.owner_email}} | ||
statement: Database should be available and accept connections 99.5% of the time. | ||
additionalContext: | ||
namespace: "{{match_resource.resource.metadata.namespace}}" | ||
labelMap: "{{match_resource.resource.metadata.labels}}" | ||
cluster: "{{ cluster.name }}" | ||
context: "{{ cluster.context }}" |
46 changes: 46 additions & 0 deletions
46
...k8s-postgres-healthcheck/.runwhen/templates/k8s-postgres-healthcheck-crunchy-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,46 @@ | ||
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-postgres-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}} | ||
- name: WORKLOAD_NAME | ||
value: '-l postgres-operator.crunchydata.com/cluster={{match_resource.resource.metadata.name}},postgres-operator.crunchydata.com/role=master' | ||
- name: RESOURCE_LABELS | ||
value: postgres-operator.crunchydata.com/cluster={{match_resource.resource.metadata.name}} | ||
- name: OBJECT_API_VERSION | ||
value: '{{match_resource.resource.apiVersion}}' | ||
- name: OBJECT_NAME | ||
value: '{{match_resource.resource.metadata.name}}' | ||
- name: DATABASE_CONTAINER | ||
value: 'database' | ||
- name: OBJECT_KIND | ||
value: {{match_resource.resource.kind}}.{{match_resource.resource.apiVersion.split('/')[0]}} | ||
secretsProvided: | ||
- name: kubeconfig | ||
workspaceKey: {{custom.kubeconfig_secret_name}} |
52 changes: 52 additions & 0 deletions
52
...les/k8s-postgres-healthcheck/.runwhen/templates/k8s-postgres-healthcheck-zalando-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,52 @@ | ||
apiVersion: runwhen.com/v1 | ||
kind: ServiceLevelIndicator | ||
metadata: | ||
name: {{slx_name}} | ||
labels: | ||
{% include "common-labels.yaml" %} | ||
annotations: | ||
{% include "common-annotations.yaml" %} | ||
spec: | ||
displayUnitsLong: OK | ||
displayUnitsShort: ok | ||
locations: | ||
- {{default_location}} | ||
description: Measures the health of a postgres cluster by scoring database lag, backups, and member readiness. | ||
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-postgres-healthcheck/sli.robot | ||
intervalStrategy: intermezzo | ||
intervalSeconds: 60 | ||
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}} | ||
- name: WORKLOAD_NAME | ||
value: '-l application=spilo,cluster-name={{match_resource.resource.metadata.name}}' | ||
- name: RESOURCE_LABELS | ||
value: 'cluster-name={{match_resource.resource.metadata.name}}' | ||
- name: OBJECT_API_VERSION | ||
value: '{{match_resource.resource.apiVersion}}' | ||
- name: OBJECT_NAME | ||
value: '{{match_resource.resource.metadata.name}}' | ||
- name: DATABASE_CONTAINER | ||
value: 'postgres' | ||
- name: OBJECT_KIND | ||
value: {{match_resource.resource.kind}}.{{match_resource.resource.apiVersion.split('/')[0]}} | ||
secretsProvided: | ||
- name: kubeconfig | ||
workspaceKey: {{custom.kubeconfig_secret_name}} |
File renamed without changes.
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
Oops, something went wrong.