Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
saurabh3460 committed Jan 27, 2025
1 parent 4756fb8 commit b2070d4
Show file tree
Hide file tree
Showing 4 changed files with 123 additions and 0 deletions.
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
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: ''
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 }}"
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}}

0 comments on commit b2070d4

Please sign in to comment.