Skip to content

Commit

Permalink
adapt scripts to use fork manifests
Browse files Browse the repository at this point in the history
  • Loading branch information
lippertmarkus committed Mar 1, 2023
1 parent 3408202 commit 6c08c45
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
9 changes: 7 additions & 2 deletions charts/kube-prometheus-stack/hack/sync_grafana_dashboards.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def new_representer(dumper, data):
# Source files list
charts = [
{
'source': 'https://raw.githubusercontent.com/prometheus-operator/kube-prometheus/main/manifests/grafana-dashboardDefinitions.yaml',
'source': 'https://raw.githubusercontent.com/lippertmarkus/kube-prometheus/main/manifests/grafana-dashboardDefinitions.yaml',
'destination': '../templates/grafana/dashboards-1.14',
'type': 'yaml',
'min_kubernetes': '1.14.0-0',
Expand All @@ -55,7 +55,12 @@ def new_representer(dumper, data):
'node-rsrc-use': ' .Values.nodeExporter.enabled',
'node-cluster-rsrc-use': ' .Values.nodeExporter.enabled',
'nodes': ' .Values.nodeExporter.enabled',
'prometheus-remote-write': ' .Values.prometheus.prometheusSpec.remoteWriteDashboards'
'prometheus-remote-write': ' .Values.prometheus.prometheusSpec.remoteWriteDashboards',
'k8s-resources-windows-cluster': ' .Values.windowsMonitoring.enabled',
'k8s-resources-windows-namespace': ' .Values.windowsMonitoring.enabled',
'k8s-resources-windows-pod': ' .Values.windowsMonitoring.enabled',
'k8s-windows-cluster-rsrc-use': ' .Values.windowsMonitoring.enabled',
'k8s-windows-node-rsrc-use': ' .Values.windowsMonitoring.enabled',
}

# standard header
Expand Down
21 changes: 13 additions & 8 deletions charts/kube-prometheus-stack/hack/sync_prometheus_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,37 +28,37 @@ def new_representer(dumper, data):
# Source files list
charts = [
{
'source': 'https://raw.githubusercontent.com/prometheus-operator/kube-prometheus/main/manifests/alertmanager-prometheusRule.yaml',
'source': 'https://raw.githubusercontent.com/lippertmarkus/kube-prometheus/main/manifests/alertmanager-prometheusRule.yaml',
'destination': '../templates/prometheus/rules-1.14',
'min_kubernetes': '1.14.0-0'
},
{
'source': 'https://raw.githubusercontent.com/prometheus-operator/kube-prometheus/main/manifests/kubePrometheus-prometheusRule.yaml',
'source': 'https://raw.githubusercontent.com/lippertmarkus/kube-prometheus/main/manifests/kubePrometheus-prometheusRule.yaml',
'destination': '../templates/prometheus/rules-1.14',
'min_kubernetes': '1.14.0-0'
},
{
'source': 'https://raw.githubusercontent.com/prometheus-operator/kube-prometheus/main/manifests/kubernetesControlPlane-prometheusRule.yaml',
'source': 'https://raw.githubusercontent.com/lippertmarkus/kube-prometheus/main/manifests/kubernetesControlPlane-prometheusRule.yaml',
'destination': '../templates/prometheus/rules-1.14',
'min_kubernetes': '1.14.0-0'
},
{
'source': 'https://raw.githubusercontent.com/prometheus-operator/kube-prometheus/main/manifests/kubeStateMetrics-prometheusRule.yaml',
'source': 'https://raw.githubusercontent.com/lippertmarkus/kube-prometheus/main/manifests/kubeStateMetrics-prometheusRule.yaml',
'destination': '../templates/prometheus/rules-1.14',
'min_kubernetes': '1.14.0-0'
},
{
'source': 'https://raw.githubusercontent.com/prometheus-operator/kube-prometheus/main/manifests/nodeExporter-prometheusRule.yaml',
'source': 'https://raw.githubusercontent.com/lippertmarkus/kube-prometheus/main/manifests/nodeExporter-prometheusRule.yaml',
'destination': '../templates/prometheus/rules-1.14',
'min_kubernetes': '1.14.0-0'
},
{
'source': 'https://raw.githubusercontent.com/prometheus-operator/kube-prometheus/main/manifests/prometheus-prometheusRule.yaml',
'source': 'https://raw.githubusercontent.com/lippertmarkus/kube-prometheus/main/manifests/prometheus-prometheusRule.yaml',
'destination': '../templates/prometheus/rules-1.14',
'min_kubernetes': '1.14.0-0'
},
{
'source': 'https://raw.githubusercontent.com/prometheus-operator/kube-prometheus/main/manifests/prometheusOperator-prometheusRule.yaml',
'source': 'https://raw.githubusercontent.com/lippertmarkus/kube-prometheus/main/manifests/prometheusOperator-prometheusRule.yaml',
'destination': '../templates/prometheus/rules-1.14',
'min_kubernetes': '1.14.0-0'
},
Expand Down Expand Up @@ -101,6 +101,8 @@ def new_representer(dumper, data):
'node-network': ' .Values.defaultRules.rules.network',
'prometheus-operator': ' .Values.defaultRules.rules.prometheusOperator',
'prometheus': ' .Values.defaultRules.rules.prometheus', # kube-prometheus >= 1.14 uses prometheus as group instead of prometheus.rules
'windows.node.rules': ' .Values.windowsMonitoring.enabled .Values.defaultRules.rules.windows',
'windows.pod.rules': ' .Values.windowsMonitoring.enabled .Values.defaultRules.rules.windows',
}

alert_condition_map = {
Expand Down Expand Up @@ -145,7 +147,10 @@ def new_representer(dumper, data):
'init': ''},
'(controller,namespace)': {
'replacement': '(controller,namespace,cluster)',
'init': ''}
'init': ''},
'job="kubernetes-windows-exporter"': {
'replacement': 'job="{{ .Values.windowsMonitoring.job }}"',
'init': ''},
}

# standard header
Expand Down

0 comments on commit 6c08c45

Please sign in to comment.