Skip to content

Commit 054d8c1

Browse files
Merge branch 'release-psmdb-1.22.0' into K8SPSMDB-1470-revert-crds-dep
2 parents 027eec7 + 3ab818e commit 054d8c1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+4834
-46
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
* @hors @nmarukovich @jvpasinatto @eleo007 @valmiranogueira
22
/charts/pmm/ @percona/pmm-review-be
3+
/charts/pmm-ha/ @percona/pmm-review-be
34
/charts/everest/ @percona/everest-backend-devs
45
.github/everest-pr-checks.yaml @percona/everest-backend-devs
56
.github/everest-release.yaml @percona/everest-backend-devs
7+
.github/workflows/pmm-ha-pr-checks.yaml @percona/pmm-review-be
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
name: PMM-HA PR checks
2+
on:
3+
pull_request:
4+
paths:
5+
- 'charts/pmm-ha/**'
6+
- 'charts/pmm-ha-dependencies/**'
7+
8+
jobs:
9+
lint-test:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
sparse-checkout: |
17+
.github/
18+
charts/pmm-ha
19+
charts/pmm-ha-dependencies
20+
21+
- name: Set up Helm
22+
uses: azure/setup-helm@v4.2.0
23+
with:
24+
version: v3.15.4
25+
26+
- uses: azure/setup-kubectl@v4
27+
28+
- name: Set up chart-testing
29+
uses: helm/chart-testing-action@v2.6.1
30+
31+
- name: Add Helm repositories
32+
run: |
33+
helm repo add altinity https://helm.altinity.com
34+
helm repo add percona https://percona.github.io/percona-helm-charts/
35+
helm repo add vm https://victoriametrics.github.io/helm-charts/
36+
helm repo add haproxytech https://haproxytech.github.io/helm-charts/
37+
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts/
38+
helm repo update
39+
40+
- name: Run chart-testing (list-changed)
41+
id: list-changed
42+
run: |
43+
changed=$(ct list-changed --config .github/ct.yaml)
44+
if [[ -n "$changed" ]]; then
45+
echo "changed=true" >> $GITHUB_OUTPUT
46+
fi
47+
48+
- name: Run chart-testing (lint)
49+
run: |
50+
ct lint --config .github/ct.yaml --lint-conf .github/lintconf.yaml --chart-dirs=charts --charts=charts/pmm-ha,charts/pmm-ha-dependencies --check-version-increment=true
51+
52+
- name: Create kind cluster
53+
uses: helm/kind-action@v1.10.0
54+
if: steps.list-changed.outputs.changed == 'true'
55+
56+
- name: Prepare PMM-HA prerequisites
57+
if: steps.list-changed.outputs.changed == 'true'
58+
run: |
59+
NS="pmm-ha-$(openssl rand -hex 5)"
60+
echo "NS=$NS" >> $GITHUB_ENV
61+
kubectl create namespace "$NS" || true
62+
63+
# pmm-secret
64+
cat <<'EOF' | kubectl apply -n "$NS" -f -
65+
apiVersion: v1
66+
kind: Secret
67+
metadata:
68+
name: pmm-secret
69+
labels:
70+
app.kubernetes.io/name: pmm
71+
type: Opaque
72+
data:
73+
PMM_ADMIN_PASSWORD: YWRtaW4=
74+
PG_PASSWORD: cG1tcGFzcw==
75+
GF_PASSWORD: Z2ZwYXNz
76+
VMAGENT_remoteWrite_basicAuth_username: dm11c2Vy
77+
VMAGENT_remoteWrite_basicAuth_password: dm1wYXNz
78+
PMM_CLICKHOUSE_USER: Y2h1c2Vy
79+
PMM_CLICKHOUSE_PASSWORD: Y2hwYXNz
80+
EOF
81+
82+
- name: Install pmm-ha-dependencies chart
83+
if: steps.list-changed.outputs.changed == 'true'
84+
run: |
85+
echo "Installing pmm-ha-dependencies (operators)..."
86+
# Using --skip-clean-up to keep operators running for pmm-ha installation
87+
ct install --namespace "${{ env.NS }}" --config .github/ct.yaml --charts=charts/pmm-ha-dependencies --skip-clean-up
88+
89+
echo "Waiting for operators to be ready..."
90+
kubectl wait --for=condition=ready pod -l app.kubernetes.io/name=victoria-metrics-operator -n "${{ env.NS }}" --timeout=300s
91+
kubectl wait --for=condition=ready pod -l app.kubernetes.io/name=altinity-clickhouse-operator -n "${{ env.NS }}" --timeout=300s
92+
kubectl wait --for=condition=ready pod -l app.kubernetes.io/name=pg-operator -n "${{ env.NS }}" --timeout=300s
93+
94+
echo "All operators are ready!"
95+
96+
# - name: Setup tmate session on failure
97+
# uses: mxschmitt/action-tmate@v3
98+
# timeout-minutes: 60
99+
# with:
100+
# limit-access-to-actor: true
101+
102+
- name: Run chart-testing (install pmm-ha)
103+
if: steps.list-changed.outputs.changed == 'true'
104+
run: |
105+
# Install pmm-ha chart via ct (using --skip-crds from ct.yaml)
106+
ct install --namespace "${{ env.NS }}" --config .github/ct.yaml --charts=charts/pmm-ha
107+
108+
- name: Build chart packages
109+
run: |
110+
changed=$(ct list-changed --config .github/ct.yaml)
111+
if [[ -n "$changed" ]]; then
112+
for chart in $changed; do
113+
echo "Packaging $chart..."
114+
helm package "$chart"
115+
done
116+
else
117+
echo "No charts changed, skipping package"
118+
fi
119+
120+
- name: Upload helm charts
121+
uses: actions/upload-artifact@v4
122+
with:
123+
path: ./*.tgz
124+
retention-days: 30
125+
if-no-files-found: ignore
126+
127+
- name: Cleanup test resources
128+
if: steps.list-changed.outputs.changed == 'true'
129+
run: |
130+
echo "Cleaning up test namespace: ${{ env.NS }}"
131+
132+
# Uninstall pmm-ha-dependencies chart (ct creates dynamic release names)
133+
DEPS_RELEASE=$(helm list -n "${{ env.NS }}" --filter 'pmm-ha-dependencies-*' -q)
134+
if [[ -n "$DEPS_RELEASE" ]]; then
135+
echo "Uninstalling release: $DEPS_RELEASE"
136+
helm uninstall "$DEPS_RELEASE" -n "${{ env.NS }}" || true
137+
fi
138+
139+
# Delete namespace and all remaining resources
140+
kubectl delete namespace "${{ env.NS }}" --timeout=120s || true
141+
142+
echo "Cleanup completed. CRDs are intentionally left for reuse by other tests."

.github/workflows/release.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,20 @@ jobs:
3131
with:
3232
version: v3.15.4
3333

34+
- name: Add Helm repositories
35+
run: |
36+
helm repo add haproxytech https://haproxytech.github.io/helm-charts/
37+
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
38+
helm repo add victoriametrics https://victoriametrics.github.io/helm-charts/
39+
helm repo add altinity https://helm.altinity.com
40+
helm repo add percona https://percona.github.io/percona-helm-charts/
41+
helm repo update
42+
43+
- name: Build chart dependencies
44+
run: |
45+
helm dependency build charts/pmm-ha-dependencies
46+
helm dependency build charts/pmm-ha
47+
3448
- name: Run chart-releaser
3549
uses: helm/chart-releaser-action@v1.6.0
3650
env:

.github/workflows/test.yaml

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
path-ignore:
66
- 'charts/gcp-marketplace/**'
77
- 'charts/everest/**'
8+
- 'charts/pmm-ha/**'
9+
- 'charts/pmm-ha-dependencies/**'
10+
811

912
jobs:
1013
lint-test:
@@ -16,9 +19,9 @@ jobs:
1619
fetch-depth: 0
1720

1821
- name: Set up Helm
19-
uses: azure/setup-helm@v4.2.0
22+
uses: azure/setup-helm@v4.3.1
2023
with:
21-
version: v3.15.4
24+
version: v3.20.0
2225

2326
- uses: actions/setup-python@v5
2427
with:
@@ -36,7 +39,7 @@ jobs:
3639
fi
3740
3841
- name: Run chart-testing (lint)
39-
run: ct lint --config .github/ct.yaml --lint-conf .github/lintconf.yaml --excluded-charts=everest
42+
run: ct lint --config .github/ct.yaml --lint-conf .github/lintconf.yaml --excluded-charts=everest,pmm-ha,pmm-ha-dependencies
4043

4144
- name: Create kind cluster
4245
uses: helm/kind-action@v1.10.0
@@ -45,11 +48,41 @@ jobs:
4548

4649
- name: Run db-chart-testing (install)
4750
run: |
48-
OPERATOR_INSTALL=$(ct list-changed --config .github/ct.yaml | sed 's:charts/::' | grep "\-db$" | sed 's/-db$/-operator/')
51+
echo "Base branch is $GITHUB_BASE_REF"
52+
excluded_charts=("everest")
53+
# Exclude -operator-crds; they are installed in the next step with --take-ownership
54+
while IFS= read -r crd; do [[ -n "$crd" ]] && excluded_charts+=("$crd"); done <<< "$(ct list-changed --config .github/ct.yaml | sed 's:^charts/::' | grep '\-operator-crds$' || true)"
55+
OPERATOR_INSTALL=$(ct list-changed --config .github/ct.yaml | sed -E 's:charts/::' | awk '/(-db|-operator)$/ { sub(/-db$/, "-operator"); print }' | sort -u)
56+
echo "The charts to install: $OPERATOR_INSTALL"
57+
4958
if [ -n "$OPERATOR_INSTALL" ]; then
50-
for operator in $OPERATOR_INSTALL; do helm install --namespace default $operator charts/$operator/.; done
59+
for operator in $OPERATOR_INSTALL; do
60+
HELM_ARGS=()
61+
if [[ "$GITHUB_BASE_REF" == release-* ]]; then
62+
IMAGE_REPOSITORY_OLD=$(yq e '.operatorImageRepository' "charts/$operator/values.yaml" | awk -F/ '{print $NF}')
63+
IMAGE_REPOSITORY=$(yq e '.image.repository' "charts/$operator/values.yaml" | awk -F/ '{print $NF}')
64+
if [ -n "$IMAGE_REPOSITORY_OLD" ]; then
65+
HELM_ARGS=(
66+
--set "operatorImageRepository=perconalab/$IMAGE_REPOSITORY_OLD"
67+
--set "image=perconalab/$IMAGE_REPOSITORY_OLD:main"
68+
)
69+
fi
70+
if [ -n "$IMAGE_REPOSITORY" ]; then
71+
HELM_ARGS=(
72+
--set "image.repository=perconalab/$IMAGE_REPOSITORY"
73+
--set "image.tag=main"
74+
)
75+
fi
76+
echo "${HELM_ARGS[@]}"
77+
fi
78+
echo "Installing $operator with Helm args: ${HELM_ARGS[@]}"
79+
helm install --namespace default $operator charts/$operator/. --wait --debug "${HELM_ARGS[@]}"
80+
excluded_charts+=($operator)
81+
done
5182
fi
52-
ct install --config .github/ct.yaml --excluded-charts=everest,psmdb-operator-crds
83+
84+
ct install --config .github/ct.yaml --excluded-charts=$(IFS=,; echo "${excluded_charts[*]}")
85+
5386
if [ -n "$OPERATOR_INSTALL" ]; then
5487
for operator in $OPERATOR_INSTALL; do helm uninstall --namespace default $operator; done
5588
fi

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.deploy/
22
.idea/
33
*.tgz
4+
.DS_Store
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/
24+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
dependencies:
2+
- name: victoria-metrics-operator
3+
repository: https://victoriametrics.github.io/helm-charts/
4+
version: 0.56.4
5+
- name: altinity-clickhouse-operator
6+
repository: https://helm.altinity.com
7+
version: 0.25.4
8+
- name: pg-operator
9+
repository: https://percona.github.io/percona-helm-charts/
10+
version: 2.8.0
11+
digest: sha256:4aa066101ee10081ef558ca7f5f8e508d94647320e28953f7f04da8faf7f59d0
12+
generated: "2025-11-20T16:19:09.898309+01:00"
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
apiVersion: v2
2+
name: pmm-ha-dependencies
3+
description: Kubernetes operators required for PMM HA deployment
4+
type: application
5+
version: 1.0.0
6+
appVersion: "1.0.0"
7+
home: https://github.com/percona/percona-helm-charts
8+
maintainers:
9+
- name: tibi
10+
email: tibor.korocz@percona.com
11+
- name: alex
12+
email: alexander.demidoff@percona.com
13+
keywords:
14+
- PMM
15+
- Operators
16+
- Dependencies
17+
icon: https://www.percona.com/sites/default/files/pmm-logo.png
18+
dependencies:
19+
- name: victoria-metrics-operator
20+
version: 0.56.4
21+
repository: https://victoriametrics.github.io/helm-charts/
22+
- name: altinity-clickhouse-operator
23+
version: 0.25.4
24+
repository: https://helm.altinity.com
25+
- name: pg-operator
26+
version: 2.8.0
27+
repository: https://percona.github.io/percona-helm-charts/

0 commit comments

Comments
 (0)