Skip to content

Commit 81edb3f

Browse files
committed
Update Helm chart publishing to use charts.support.tools
- Replace GitHub Pages with SupportTools/helm-chart repository - Add Chart.yaml.template and values.yaml.template for envsubst - Use BOT_TOKEN for cross-repo push - Publish to https://charts.support.tools/
1 parent 4f23ab9 commit 81edb3f

File tree

3 files changed

+158
-42
lines changed

3 files changed

+158
-42
lines changed

.github/workflows/release.yaml

Lines changed: 31 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -121,71 +121,60 @@ jobs:
121121
env:
122122
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
123123

124-
helm-release:
125-
name: Helm Chart Release
124+
helm-publish:
125+
name: Publish Helm Chart
126126
runs-on: ubuntu-latest
127127
needs: [release]
128-
permissions:
129-
contents: write
130-
pages: write
131128
steps:
132129
- name: Checkout
133130
uses: actions/checkout@v4
134-
with:
135-
fetch-depth: 0
136131

137-
- name: Configure Git
132+
- name: Install gettext
138133
run: |
139-
git config user.name "$GITHUB_ACTOR"
140-
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
134+
sudo apt-get update && sudo apt-get install -y gettext
141135
142136
- name: Setup Helm
143-
uses: azure/setup-helm@v3
144-
with:
145-
version: v3.13.0
137+
uses: azure/setup-helm@v4.2.0
146138

147139
- name: Get version
148140
id: version
149141
run: |
150-
VERSION=${GITHUB_REF#refs/tags/v}
142+
VERSION=${GITHUB_REF#refs/tags/}
151143
echo "version=${VERSION}" >> $GITHUB_OUTPUT
152144
153-
- name: Update chart version
154-
run: |
155-
sed -i "s/^version:.*/version: ${{ steps.version.outputs.version }}/" charts/cnpg-storage-manager/Chart.yaml
156-
sed -i "s/^appVersion:.*/appVersion: \"${{ steps.version.outputs.version }}\"/" charts/cnpg-storage-manager/Chart.yaml
157-
sed -i "s/tag:.*/tag: \"v${{ steps.version.outputs.version }}\"/" charts/cnpg-storage-manager/values.yaml
145+
- name: Helm Lint
146+
run: helm lint charts/cnpg-storage-manager/
158147

159148
- name: Package Helm chart
160149
run: |
161-
helm package charts/cnpg-storage-manager -d .helm-releases
162-
163-
- name: Checkout gh-pages
150+
export CHART_VERSION="${{ steps.version.outputs.version }}"
151+
export APP_VERSION="${{ steps.version.outputs.version }}"
152+
export IMAGE_TAG="${{ steps.version.outputs.version }}"
153+
echo "CHART_VERSION=${CHART_VERSION}"
154+
echo "APP_VERSION=${APP_VERSION}"
155+
echo "IMAGE_TAG=${IMAGE_TAG}"
156+
envsubst < charts/cnpg-storage-manager/Chart.yaml.template > charts/cnpg-storage-manager/Chart.yaml
157+
envsubst < charts/cnpg-storage-manager/values.yaml.template > charts/cnpg-storage-manager/values.yaml
158+
mkdir -p helm/repo
159+
helm package charts/cnpg-storage-manager --destination helm/repo
160+
161+
- name: Checkout helm-chart repository
164162
uses: actions/checkout@v4
165163
with:
166-
ref: gh-pages
167-
path: gh-pages
168-
continue-on-error: true
164+
repository: SupportTools/helm-chart
165+
path: helm-chart
166+
token: ${{ secrets.BOT_TOKEN }}
169167

170-
- name: Setup gh-pages branch
168+
- name: Configure Git
171169
run: |
172-
if [ ! -d "gh-pages" ]; then
173-
mkdir gh-pages
174-
cd gh-pages
175-
git init
176-
git checkout -b gh-pages
177-
fi
170+
git config --global user.email "github-action@users.noreply.github.com"
171+
git config --global user.name "GitHub Action"
178172
179173
- name: Update Helm repository
180174
run: |
181-
cp .helm-releases/*.tgz gh-pages/
182-
cd gh-pages
183-
helm repo index . --url https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}
175+
cp helm/repo/cnpg-storage-manager-*.tgz helm-chart/
176+
cd helm-chart
177+
helm repo index . --url https://charts.support.tools/
184178
git add .
185-
git commit -m "Release helm chart ${{ steps.version.outputs.version }}" || echo "No changes to commit"
186-
187-
- name: Push to gh-pages
188-
run: |
189-
cd gh-pages
190-
git push origin gh-pages --force || echo "gh-pages branch not configured"
191-
continue-on-error: true
179+
git commit -m "Update cnpg-storage-manager Helm chart to ${{ steps.version.outputs.version }}"
180+
git push
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
apiVersion: v2
2+
name: cnpg-storage-manager
3+
description: A Kubernetes controller for automated storage management of CloudNativePG clusters
4+
type: application
5+
version: ${CHART_VERSION}
6+
appVersion: "${APP_VERSION}"
7+
kubeVersion: ">=1.26.0-0"
8+
keywords:
9+
- kubernetes
10+
- cnpg
11+
- cloudnativepg
12+
- postgresql
13+
- storage
14+
- pvc
15+
- expansion
16+
home: https://github.com/supporttools/cnpg-storage-manager
17+
sources:
18+
- https://github.com/supporttools/cnpg-storage-manager
19+
maintainers:
20+
- name: SupportTools
21+
url: https://github.com/supporttools
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# Default values for cnpg-storage-manager
2+
3+
replicaCount: 1
4+
5+
# Global dry-run mode
6+
# When enabled, no actual changes are made to PVCs or WAL files.
7+
# This is useful for testing and validation before enabling actual remediation.
8+
# This setting takes precedence over individual policy dryRun settings.
9+
dryRun: false
10+
11+
image:
12+
repository: ghcr.io/supporttools/cnpg-storage-manager
13+
pullPolicy: IfNotPresent
14+
tag: "${IMAGE_TAG}"
15+
16+
imagePullSecrets: []
17+
nameOverride: ""
18+
fullnameOverride: ""
19+
20+
serviceAccount:
21+
create: true
22+
annotations: {}
23+
name: ""
24+
25+
podAnnotations: {}
26+
27+
podSecurityContext:
28+
runAsNonRoot: true
29+
seccompProfile:
30+
type: RuntimeDefault
31+
32+
securityContext:
33+
readOnlyRootFilesystem: true
34+
allowPrivilegeEscalation: false
35+
capabilities:
36+
drop:
37+
- ALL
38+
39+
resources:
40+
limits:
41+
cpu: 500m
42+
memory: 256Mi
43+
requests:
44+
cpu: 50m
45+
memory: 128Mi
46+
47+
nodeSelector: {}
48+
49+
tolerations: []
50+
51+
affinity: {}
52+
53+
# Leader election configuration
54+
leaderElection:
55+
enabled: true
56+
57+
# Metrics configuration
58+
metrics:
59+
enabled: true
60+
port: 8080
61+
serviceMonitor:
62+
enabled: false
63+
interval: 30s
64+
labels: {}
65+
66+
# Health probes
67+
health:
68+
port: 8081
69+
livenessProbe:
70+
initialDelaySeconds: 15
71+
periodSeconds: 20
72+
readinessProbe:
73+
initialDelaySeconds: 5
74+
periodSeconds: 10
75+
76+
# Logging configuration
77+
logging:
78+
level: info # debug, info, warn, error
79+
development: false
80+
81+
# Install CRDs with the chart
82+
crds:
83+
install: true
84+
85+
# Default StoragePolicy (optional)
86+
defaultPolicy:
87+
enabled: false
88+
name: default-storage-policy
89+
selector:
90+
matchLabels: {}
91+
thresholds:
92+
warning: 70
93+
critical: 80
94+
expansion: 85
95+
emergency: 90
96+
expansion:
97+
enabled: true
98+
percentage: 50
99+
minIncrementGi: 5
100+
cooldownMinutes: 30
101+
walCleanup:
102+
enabled: true
103+
retainCount: 10
104+
requireArchived: true
105+
cooldownMinutes: 15
106+
dryRun: false

0 commit comments

Comments
 (0)