Skip to content
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: add sample kube-state-metrics-config #75

Merged
merged 7 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
295 changes: 295 additions & 0 deletions config/kube-state-metrics/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,295 @@
kind: ConfigMap
apiVersion: v1
metadata:
labels:
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/component: metrics
name: kube-state-metrics-config
namespace: system
data:
config.yaml: |
kind: CustomResourceStateMetrics
spec:
resources:
##################
# ENTERPRISE #
#################
- groupVersionKind:
group: garm-operator.mercedes-benz.com
kind: "Enterprise"
version: "v1alpha1"
metricNamePrefix: garm_operator
commonLabels:
crd_type: "enterprise"
labelsFromPath:
name: [ metadata, name ]
namespace: [ metadata, namespace ]
metrics:
- name: enterprise_created
help: Unix creation timestamp.
each:
gauge:
path:
- metadata
- creationTimestamp
type: Gauge

- name: enterprise_info
help: Information about an enterprise.
each:
type: Info
info:
labelsFromPath:
credentialsName: [ spec, credentialsName ]
webhookSecretRefKey: [ spec, webhookSecretRef, key ]
webhookSecretRefName: [ spec, webhookSecretRef, name ]
id: [ status, id ]

- name: enterprise_annotation_paused_info
help: Whether the enterprise reconciliation is paused.
each:
type: Info
info:
path:
- metadata
- annotations
- garm-operator.mercedes-benz.com/paused
labelsFromPath:
paused_value: []

- name: enterprise_status_conditions
help: Displays whether status of each possible condition is True or False.
each:
type: Gauge
gauge:
path:
- status
- conditions
valueFrom:
- status
labelFromKey: reason
labelsFromPath:
type: [ type ]

##################
# Org #
#################
- groupVersionKind:
group: garm-operator.mercedes-benz.com
kind: "Organization"
version: "v1alpha1"
metricNamePrefix: garm_operator
commonLabels:
crd_type: "organization"
labelsFromPath:
name: [ metadata, name ]
namespace: [ metadata, namespace ]
metrics:
- name: org_created
help: Unix creation timestamp.
each:
gauge:
path:
- metadata
- creationTimestamp
type: Gauge

- name: org_info
help: Information about an organization.
each:
type: Info
info:
labelsFromPath:
credentialsName: [ spec, credentialsName ]
webhookSecretRefKey: [ spec, webhookSecretRef, key ]
webhookSecretRefName: [ spec, webhookSecretRef, name ]
id: [ status, id ]

- name: org_annotation_paused_info
help: Whether the org reconciliation is paused.
each:
type: Info
info:
path:
- metadata
- annotations
- garm-operator.mercedes-benz.com/paused
labelsFromPath:
paused_value: [ ]

- name: org_status_conditions
help: Displays whether status of each possible condition is True or False.
each:
type: Gauge
gauge:
path:
- status
- conditions
valueFrom:
- status
labelFromKey: reason
labelsFromPath:
type: [ type ]

##################
# Repo #
#################
- groupVersionKind:
group: garm-operator.mercedes-benz.com
kind: "Repository"
version: "v1alpha1"
metricNamePrefix: garm_operator
commonLabels:
crd_type: "repository"
labelsFromPath:
name: [ metadata, name ]
namespace: [ metadata, namespace ]
metrics:
- name: repo_created
help: Unix creation timestamp.
each:
gauge:
path:
- metadata
- creationTimestamp
type: Gauge

- name: repo_info
help: Information about a repository.
each:
type: Info
info:
labelsFromPath:
owner: [ spec, owner ]
credentialsName: [ spec, credentialsName ]
webhookSecretRefKey: [ spec, webhookSecretRef, key ]
webhookSecretRefName: [ spec, webhookSecretRef, name ]
id: [ status, id ]

- name: repo_annotation_paused_info
help: Whether the repo reconciliation is paused.
each:
type: Info
info:
path:
- metadata
- annotations
- garm-operator.mercedes-benz.com/paused
labelsFromPath:
paused_value: [ ]

- name: repo_status_conditions
help: Displays whether status of each possible condition is True or False.
each:
type: Gauge
gauge:
path:
- status
- conditions
valueFrom:
- status
labelFromKey: reason
labelsFromPath:
type: [ type ]

##################
# Pool #
#################
- groupVersionKind:
group: garm-operator.mercedes-benz.com
kind: "Pool"
version: "v1alpha1"
metricNamePrefix: garm_operator
commonLabels:
crd_type: "pool"
labelsFromPath:
name: [ metadata, name ]
namespace: [ metadata, namespace ]
metrics:
- name: pool_created
help: Unix creation timestamp.
each:
gauge:
path:
- metadata
- creationTimestamp
type: Gauge

- name: pool_info
help: Information about a pool.
each:
type: Info
info:
labelsFromPath:
enabled: [spec, enabled]
githubRunnerGroup: [spec, githubRunnerGroup]
scopeKind: [spec, githubScopeRef, kind]
scopeName: [spec, githubScopeRef, name]
imageName: [spec, imageName]
maxRunners: [spec, maxRunners]
minIdleRunners: [spec, minIdleRunners]
osArch: [spec, osArch]
osType: [spec, osType]
providerName: [spec, providerName]
runnerBootstrapTimeout: [spec, runnerBootstrapTimeout]
runnerPrefix: [spec, runnerPrefix]
tags: [spec, tags]
id: [status, id]
longRunningIdleRunners: [status, longRunningIdleRunners]

- name: pool_annotation_paused_info
help: Whether the pool reconciliation is paused.
each:
type: Info
info:
path:
- metadata
- annotations
- garm-operator.mercedes-benz.com/paused
labelsFromPath:
paused_value: [ ]

- name: pool_status_conditions
help: Displays whether status of each possible condition is True or False.
each:
type: Gauge
gauge:
path:
- status
- conditions
valueFrom:
- status
labelFromKey: reason
labelsFromPath:
type: [ type ]

##################
# Image #
#################
- groupVersionKind:
group: garm-operator.mercedes-benz.com
kind: "Image"
version: "v1alpha1"
metricNamePrefix: garm_operator
commonLabels:
crd_type: "image"
labelsFromPath:
name: [ metadata, name ]
namespace: [ metadata, namespace ]
metrics:
- name: image_created
help: Unix creation timestamp.
each:
gauge:
path:
- metadata
- creationTimestamp
type: Gauge

- name: image_info
help: Information about an image.
each:
type: Info
info:
labelsFromPath:
tag: [spec, tag]
Loading
Loading