-
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.
- Loading branch information
1 parent
4756fb8
commit b2070d4
Showing
4 changed files
with
123 additions
and
0 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
codebundles/jenkins-health/.runwhen/generation-rules/jenkins-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,20 @@ | ||
apiVersion: runwhen.com/v1 | ||
kind: GenerationRules | ||
spec: | ||
generationRules: | ||
- resourceTypes: | ||
- statefulset | ||
matchRules: | ||
- type: pattern | ||
pattern: "jenkins" | ||
properties: [name] | ||
mode: substring | ||
slxs: | ||
- baseName: jenkins-health | ||
levelOfDetail: detailed | ||
qualifiers: ["resource", "namespace", "cluster"] | ||
baseTemplateName: jenkins-health | ||
outputItems: | ||
- type: slx | ||
- type: runbook | ||
templateName: jenkins-health-taskset.yaml |
49 changes: 49 additions & 0 deletions
49
codebundles/jenkins-health/.runwhen/templates/jenkins-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,49 @@ | ||
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: The number of failed Jenkins builds. | ||
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/jenkins-healthcheck/runbook.robot | ||
intervalStrategy: intermezzo | ||
intervalSeconds: 600 | ||
configProvided: | ||
- name: JENKINS_URL | ||
workspaceKey: {{custom.jenkins_url}} | ||
secretsProvided: | ||
- name: JENKINS_USERNAME | ||
workspaceKey: {{custom.jenkins_username}} | ||
- name: JENKINS_TOKEN | ||
workspaceKey: {{custom.jenkins_token}} | ||
alerts: | ||
warning: | ||
operator: < | ||
threshold: '1' | ||
for: '20m' | ||
ticket: | ||
operator: < | ||
threshold: '1' | ||
for: '40m' | ||
page: | ||
operator: '==' | ||
threshold: '0' | ||
for: '' |
23 changes: 23 additions & 0 deletions
23
codebundles/jenkins-health/.runwhen/templates/jenkins-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/Jenkins_logo.svg | ||
alias: {{match_resource.resource.metadata.name}} Health | ||
asMeasuredBy: The number of failed Jenkins builds. | ||
configProvided: | ||
- name: SLX_PLACEHOLDER | ||
value: SLX_PLACEHOLDER | ||
owners: | ||
- {{workspace.owner_email}} | ||
statement: The number of failed Jenkins builds should be zero. | ||
additionalContext: | ||
namespace: "{{match_resource.resource.metadata.namespace}}" | ||
labelMap: "{{match_resource.resource.metadata.labels}}" | ||
cluster: "{{ cluster.name }}" | ||
context: "{{ cluster.context }}" |
31 changes: 31 additions & 0 deletions
31
codebundles/jenkins-health/.runwhen/templates/jenkins-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,31 @@ | ||
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/jenkins-healthcheck/runbook.robot | ||
configProvided: | ||
- name: JENKINS_URL | ||
workspaceKey: {{custom.jenkins_url}} | ||
secretsProvided: | ||
- name: JENKINS_USERNAME | ||
workspaceKey: {{custom.jenkins_username}} | ||
- name: JENKINS_TOKEN | ||
workspaceKey: {{custom.jenkins_token}} | ||
|