Skip to content

Commit 00fa0c9

Browse files
committed
Merge branch 'dev' into 'main'
Upgrade Kube-Prom-Stack See merge request clops-monitoring-platform/clops-helm!10
2 parents 4d80be9 + 778c72c commit 00fa0c9

File tree

9 files changed

+156
-16
lines changed

9 files changed

+156
-16
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
charts/
22
.vscode
3-
values-*.yaml
3+
values-*.yaml
4+
*.tgz

.helmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@
2222
*.tmproj
2323
.vscode/
2424
docker/
25+
hack/

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
# [1.0.0-rc.1](https://gitlab.cloudical.net/clops-monitoring-platform/clops-helm/compare/0.2.1...1.0.0-rc.1) (2023-07-11)
2+
3+
4+
### update
5+
6+
* **clops:** kube prometheus stack major bump ([4746d69](https://gitlab.cloudical.net/clops-monitoring-platform/clops-helm/commit/4746d697c8717f9b63fc36f7664b8d91947c951c))
7+
8+
9+
### BREAKING CHANGES
10+
11+
* **clops:** Update kube-prom-stack to 46.x Please check the UPGRADING.md for infos
12+
on how to upgrade the stack.
13+
114
## [0.2.1](https://gitlab.cloudical.net/clops-monitoring-platform/clops-helm/compare/0.2.0...0.2.1) (2023-07-10)
215

316

Chart.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
dependencies:
22
- name: kube-prometheus-stack
33
repository: https://prometheus-community.github.io/helm-charts
4-
version: 45.18.0
4+
version: 46.8.0
55
- name: metrics-server
66
repository: https://kubernetes-sigs.github.io/metrics-server/
77
version: 3.10.0
88
- name: grafana
99
repository: https://grafana.github.io/helm-charts
10-
version: 6.57.4
10+
version: 6.58.2
1111
- name: loki
1212
repository: https://grafana.github.io/helm-charts
1313
version: 5.8.9
@@ -16,6 +16,6 @@ dependencies:
1616
version: 6.11.5
1717
- name: prometheus-blackbox-exporter
1818
repository: https://prometheus-community.github.io/helm-charts
19-
version: 7.12.0
20-
digest: sha256:ec9fbb257da118c6bc230f4368c6725425fddaf36f00926bc8807666b09df720
21-
generated: "2023-07-10T12:46:00.364573797+02:00"
19+
version: 8.0.0
20+
digest: sha256:a7f18959c7ef3d430fb9872f28183b47984a1555be1463b11e0ba7f1eedaca76
21+
generated: "2023-07-11T14:54:46.640239653+02:00"

Chart.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 0.1.2
18+
version: 1.0.0
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to
@@ -25,7 +25,7 @@ appVersion: "0.0.0"
2525

2626
dependencies:
2727
- name: kube-prometheus-stack
28-
version: "45.18.*"
28+
version: "46.8.*"
2929
repository: "https://prometheus-community.github.io/helm-charts"
3030
condition: kube-prometheus-stack.enabled
3131

@@ -35,7 +35,7 @@ dependencies:
3535
condition: metrics-server.enabled
3636

3737
- name: grafana
38-
version: "6.57.*"
38+
version: "6.58.*"
3939
repository: "https://grafana.github.io/helm-charts"
4040
condition: grafana.enabled
4141

@@ -50,6 +50,6 @@ dependencies:
5050
condition: promtail.enabled
5151

5252
- name: prometheus-blackbox-exporter
53-
version: "7.12.*"
53+
version: "8.0.*"
5454
repository: https://prometheus-community.github.io/helm-charts
5555
condition: prometheus-blackbox-exporter.enabled

UPGRADING.md

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,30 @@
1-
# Upgrading guides
1+
# **Upgrading guides**
2+
We try not to break charts when changing `minor` or `patch` versions.
3+
However if there is a change that may break stuff we will add annotations here.
24

5+
Major releases almost always require manual steps. Those will be outlined below.
36

7+
Before Upgading a Major version make sure you are on the latest `Minor` version
48

5-
## General
9+
---
610

7-
We try not to break charts when changing `minor` or `patch` versions.
8-
However if there is a change that may break stuff we will add annotations here.
11+
## **Upgrading From 0.2.\* to 1.0.0**
12+
### Kube Prometheus Stack updated to 46.8.x
13+
This version upgrades Prometheus-Operator to v0.65.1 with new CRDs (PrometheusAgent and ScrapeConfig), Prometheus to v2.44.0 and Thanos to v0.31.0.
14+
15+
Run these commands to update the CRDs before applying the upgrade.
916

10-
Major releases almost always require manual steps.
17+
```sh
18+
kubectl apply --server-side -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.65.1/example/prometheus-operator-crd/monitoring.coreos.com_alertmanagerconfigs.yaml
19+
kubectl apply --server-side -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.65.1/example/prometheus-operator-crd/monitoring.coreos.com_alertmanagers.yaml
20+
kubectl apply --server-side -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.65.1/example/prometheus-operator-crd/monitoring.coreos.com_podmonitors.yaml
21+
kubectl apply --server-side -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.65.1/example/prometheus-operator-crd/monitoring.coreos.com_probes.yaml
22+
kubectl apply --server-side -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.65.1/example/prometheus-operator-crd/monitoring.coreos.com_prometheusagents.yaml
23+
kubectl apply --server-side -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.65.1/example/prometheus-operator-crd/monitoring.coreos.com_prometheuses.yaml
24+
kubectl apply --server-side -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.65.1/example/prometheus-operator-crd/monitoring.coreos.com_prometheusrules.yaml
25+
kubectl apply --server-side -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.65.1/example/prometheus-operator-crd/monitoring.coreos.com_scrapeconfigs.yaml
26+
kubectl apply --server-side -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.65.1/example/prometheus-operator-crd/monitoring.coreos.com_servicemonitors.yaml
27+
kubectl apply --server-side -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.65.1/example/prometheus-operator-crd/monitoring.coreos.com_thanosrulers.yaml
28+
```
1129

12-
Before Upgading a Major version make sure you are on the latest `Minor` version
30+
---

docker/Dockerfile-k8s

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ COPY ["./hack/", "/apps/"]
1515

1616
RUN chmod +x -R "/apps"
1717

18+
WORKDIR "/apps"
19+
1820
## Allow overriding params
1921
ENTRYPOINT ["sh", "-c"]
2022
CMD ["/apps/getChartVersions.sh"]

hack/interactiveChoice.sh

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
#!/bin/sh
2+
3+
### Globals
4+
## CLOPS infos
5+
CLOPS_NAME="clops-helm"
6+
CLOPS_REPO="https://chartmuseum.cloudical.net/clops"
7+
VERSION_FILE="/tmp/versions"
8+
CLOPS_FILE="/tmp/clops_chart"
9+
CLOPS_TMP_FILE="/tmp/clops_chart_tmp"
10+
CLOPS_VALUES_FILE="/tmp/clops_values"
11+
SELECTED_NEW_VALUES="/tmp/GEN_CHART"
12+
SELECTED_OLD_VALUES="/tmp/GEN_CHART_OLD"
13+
14+
### function definitions
15+
## add chart function
16+
function helm_repo_add () {
17+
helm repo add $1 $2 2>&1 > /dev/null
18+
helm repo update 2>&1 > /dev/null
19+
}
20+
21+
## Add CLOPS Helm repository
22+
helm_repo_add "$CLOPS_NAME" "$CLOPS_REPO"
23+
24+
read_input() {
25+
read RESULT
26+
printf "$RESULT"
27+
}
28+
29+
print_divider () {
30+
printf "%-*s\n" "60" "" | tr ' ' '-'
31+
}
32+
33+
get_chart_in_version() {
34+
print_divider
35+
printf "\tEnter the %s version you want \n\tin Format 'X.Y.Z', 'X.Y.*' or 'X.Y'\n\tChoice > " "$1"
36+
V=`read_input`
37+
printf "\n\tRequesting Chart %s in Version %s\n" "$1" "$V"
38+
FETCH_V=`helm show chart "$1/$1" --version "$V" 2>/dev/null | yq '.version'`
39+
helm show values "$1/$1" --version "$V" > "$SELECTED_NEW_VALUES" \
40+
&& printf "\tFound Version %s\n" "$FETCH_V" \
41+
|| get_chart_in_version $1
42+
}
43+
44+
print_dependencies() {
45+
LIST_LENGTH=`cat "$CLOPS_FILE" | yq '. | length'`
46+
print_divider
47+
printf "\tSelect the chart you want to compare\n"
48+
print_divider
49+
for i in $(seq 0 `echo $(($LIST_LENGTH - 1))`)
50+
do
51+
printf "\t%s. Chart: %s \n" "$i" `cat "$CLOPS_FILE" | yq e ".[$i].name"`
52+
done
53+
print_divider
54+
}
55+
56+
## Print clops infos to files
57+
helm show chart "$CLOPS_NAME/$CLOPS_NAME" | yq '.dependencies' > "$CLOPS_FILE"
58+
helm show values "$CLOPS_NAME/$CLOPS_NAME" > "$CLOPS_VALUES_FILE"
59+
60+
print_dependencies
61+
62+
printf "\tChoice > "
63+
C=`read_input`
64+
while [[ $C -gt $LIST_LENGTH || $C -lt 0 ]]; do
65+
printf "\tSelection must be between 0 and %d \n" "$C"
66+
printf "\tChoice > "
67+
C=`read_input`
68+
done
69+
70+
SELECTION_NAME=`cat "$CLOPS_FILE" | yq e ".[$C].name"`
71+
SELECTION_REPO=`cat "$CLOPS_FILE" | yq e ".[$C].repository"`
72+
SELECTION_VERS=`cat "$CLOPS_FILE" | yq e ".[$C].version"`
73+
74+
helm_repo_add $SELECTION_NAME $SELECTION_REPO
75+
76+
SELECTION_UPDA=`helm show chart "$SELECTION_NAME/$SELECTION_NAME" | yq '.version'`
77+
78+
printf "\n\t%s current version is %s \n\tNewest available is %s\n" "$SELECTION_NAME" "$SELECTION_VERS" "$SELECTION_UPDA"
79+
print_divider
80+
81+
get_chart_in_version $SELECTION_NAME
82+
83+
print_divider
84+
print_divider
85+
86+
###
87+
### Diff Selected Versions to current chart
88+
###
89+
helm show values "$SELECTION_NAME/$SELECTION_NAME" --version "$SELECTION_VERS" > "$SELECTED_OLD_VALUES"
90+
91+
cat "$CLOPS_VALUES_FILE" | yq e ".$SELECTION_NAME" > "$CLOPS_TMP_FILE"
92+
93+
## VARS
94+
VALUES_TMP="/tmp/diff"
95+
VALUES_TMP_NEW="/tmp/diff_new"
96+
97+
python3 get_yaml_diff.py "$SELECTED_OLD_VALUES" "$SELECTED_NEW_VALUES" > "$VALUES_TMP"
98+
python3 get_yaml_diff.py "$CLOPS_TMP_FILE" "$VALUES_TMP" > "$VALUES_TMP_NEW"
99+
yq 'del(.enabled)' "$VALUES_TMP_NEW"
100+
101+
print_divider
102+

values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ kube-prometheus-stack:
1313
# Disable grafana, so we can deploy it by our conditions
1414
grafana:
1515
enabled: false
16+
# Flag to disable all the kubernetes component scrapers
17+
kubernetesServiceMonitors:
18+
enabled: true
1619
# Create default rules for monitoring the cluster
1720
defaultRules:
1821
# Labels for default rules

0 commit comments

Comments
 (0)