Skip to content

Commit

Permalink
Merge pull request #2190 from frezes/feat/upgradeMonitoringComponentP…
Browse files Browse the repository at this point in the history
…DBgvk

make the monitoring component PodDisruptionBudget apiVersion compatible
  • Loading branch information
ks-ci-bot authored May 24, 2023
2 parents 2effbf6 + 831e9fd commit c31b6df
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 1 deletion.
5 changes: 4 additions & 1 deletion roles/ks-monitor/tasks/generate_manifests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@
with_items:
- { path: prometheus/prometheus-operator, file: prometheus-operator-deployment.yaml }
- { path: prometheus/prometheus, file: prometheus-prometheus.yaml }
- { path: prometheus/prometheus, file: prometheus-podDisruptionBudget.yaml}
- { path: prometheus/kube-state-metrics, file: kube-state-metrics-deployment.yaml }
- { path: prometheus/node-exporter, file: node-exporter-daemonset.yaml }
- { path: prometheus/alertmanager, file: alertmanager-alertmanager.yaml }
- { path: prometheus/alertmanager, file: alertmanager-podDisruptionBudget.yaml }
- { path: prometheus/grafana, file: grafana-deployment.yaml }
- { path: prometheus/etcd, file: prometheus-serviceMonitorEtcd.yaml }
- { path: prometheus/etcd, file: prometheus-endpointsEtcd.yaml }
- { path: prometheus/thanos-ruler, file: thanos-ruler-thanosRuler.yaml }
- { path: prometheus/thanos-ruler, file: thanos-ruler-thanosRuler.yaml }
- { path: prometheus/thanos-ruler, file: thanos-ruler-podDisruptionBudget.yaml }
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{% if kubernetes_version is version('v1.25.0', '>=') %}
apiVersion: policy/v1
{% else %}
apiVersion: policy/v1beta1
{% endif %}
kind: PodDisruptionBudget
metadata:
labels:
app.kubernetes.io/component: alert-router
app.kubernetes.io/instance: main
app.kubernetes.io/name: alertmanager
app.kubernetes.io/part-of: kube-prometheus
app.kubernetes.io/version: {{ alertmanager_tag | replace("v", "") }}
name: alertmanager-main
namespace: kubesphere-monitoring-system
spec:
maxUnavailable: 1
selector:
matchLabels:
app.kubernetes.io/component: alert-router
app.kubernetes.io/instance: main
app.kubernetes.io/name: alertmanager
app.kubernetes.io/part-of: kube-prometheus
23 changes: 23 additions & 0 deletions roles/ks-monitor/templates/prometheus-podDisruptionBudget.yaml.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{% if kubernetes_version is version('v1.25.0', '>=') %}
apiVersion: policy/v1
{% else %}
apiVersion: policy/v1beta1
{% endif %}
kind: PodDisruptionBudget
metadata:
labels:
app.kubernetes.io/component: prometheus
app.kubernetes.io/instance: k8s
app.kubernetes.io/name: prometheus
app.kubernetes.io/part-of: kube-prometheus
app.kubernetes.io/version: {{ prometheus_tag | replace("v", "") }}
name: prometheus-k8s
namespace: kubesphere-monitoring-system
spec:
minAvailable: 1
selector:
matchLabels:
app.kubernetes.io/component: prometheus
app.kubernetes.io/instance: k8s
app.kubernetes.io/name: prometheus
app.kubernetes.io/part-of: kube-prometheus
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{% if kubernetes_version is version('v1.25.0', '>=') %}
apiVersion: policy/v1
{% else %}
apiVersion: policy/v1beta1
{% endif %}
kind: PodDisruptionBudget
metadata:
labels:
app.kubernetes.io/component: thanos-ruler
app.kubernetes.io/instance: kubesphere
app.kubernetes.io/name: thanos-ruler
app.kubernetes.io/part-of: kube-prometheus
app.kubernetes.io/version: {{ thanos_tag | replace("v", "") }}
name: thanos-ruler-kubesphere
namespace: kubesphere-monitoring-system
spec:
minAvailable: 1
selector:
matchLabels:
app.kubernetes.io/component: thanos-ruler
app.kubernetes.io/instance: kubesphere
app.kubernetes.io/name: thanos-ruler
app.kubernetes.io/part-of: kube-prometheus

0 comments on commit c31b6df

Please sign in to comment.