Skip to content

Commit 4497e7b

Browse files
authored
Merge pull request #1186 from stakater/feat/add-reloader-enterprise-in-v2-chart
added reloader-enterprise dependency
2 parents b52d0f7 + de62f06 commit 4497e7b

10 files changed

Lines changed: 171 additions & 24 deletions

File tree

.github/workflows/pull_request-helm.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
- name: Get version for chart from helm repo
7474
id: chart_eval
7575
run: |
76-
current_chart_version=$(helm search repo stakater/reloader | tail -n 1 | awk '{print $2}')
76+
current_chart_version=$(helm search repo stakater/reloader-v2 | tail -n 1 | awk '{print $2}')
7777
echo "CURRENT_CHART_VERSION=$(echo ${current_chart_version})" >> $GITHUB_OUTPUT
7878
7979
- name: Get Updated Chart version from Chart.yaml
@@ -82,15 +82,18 @@ jobs:
8282
with:
8383
cmd: yq e '.version' deployments/kubernetes/chart/reloader/Chart.yaml
8484

85+
# Skip the version-increase gate on first publish, when no reloader-v2
86+
# chart exists yet in the repo (CURRENT_CHART_VERSION is empty).
8587
- name: Check Version
88+
if: steps.chart_eval.outputs.CURRENT_CHART_VERSION != ''
8689
uses: aleoyakas/check-semver-increased-action@415c9c60054c2442c03478b6dd96a195deac6695 # v1
8790
id: check-version
8891
with:
8992
current-version: ${{ steps.new_chart_version.outputs.result }}
9093
previous-version: ${{ steps.chart_eval.outputs.CURRENT_CHART_VERSION }}
9194

9295
- name: Fail if Helm Chart version isnt updated
93-
if: steps.check-version.outputs.is-version-increased != 'true'
96+
if: steps.chart_eval.outputs.CURRENT_CHART_VERSION != '' && steps.check-version.outputs.is-version-increased != 'true'
9497
run: |
9598
echo "Helm Chart Version wasnt updated"
9699
exit 1

.github/workflows/push-helm-chart.yaml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
- name: Get version for chart from helm repo
5555
id: chart_eval
5656
run: |
57-
current_chart_version=$(helm search repo stakater/reloader | tail -n 1 | awk '{print $2}')
57+
current_chart_version=$(helm search repo stakater/reloader-v2 | tail -n 1 | awk '{print $2}')
5858
echo "CURRENT_CHART_VERSION=$(echo ${current_chart_version})" >> $GITHUB_OUTPUT
5959
6060
- name: Get Updated Chart version from Chart.yaml
@@ -63,15 +63,18 @@ jobs:
6363
with:
6464
cmd: yq e '.version' deployments/kubernetes/chart/reloader/Chart.yaml
6565

66+
# Skip the version-increase gate on first publish, when no reloader-v2
67+
# chart exists yet in the repo (CURRENT_CHART_VERSION is empty).
6668
- name: Check Version
69+
if: steps.chart_eval.outputs.CURRENT_CHART_VERSION != ''
6770
uses: aleoyakas/check-semver-increased-action@415c9c60054c2442c03478b6dd96a195deac6695 # v1
6871
id: check-version
6972
with:
7073
current-version: ${{ steps.new_chart_version.outputs.result }}
7174
previous-version: ${{ steps.chart_eval.outputs.CURRENT_CHART_VERSION }}
7275

7376
- name: Fail if Helm Chart version isnt updated
74-
if: steps.check-version.outputs.is-version-increased != 'true'
77+
if: steps.chart_eval.outputs.CURRENT_CHART_VERSION != '' && steps.check-version.outputs.is-version-increased != 'true'
7578
run: |
7679
echo "Helm Chart Version wasnt updated"
7780
exit 1
@@ -88,12 +91,15 @@ jobs:
8891

8992
- name: Publish Helm chart to ghcr.io
9093
run: |
94+
# Pull the enterprise subchart from private GHCR (uses the login above);
95+
# the vendored charts/*.tgz is gitignored, so it isn't present on the runner.
96+
helm dependency build ./deployments/kubernetes/chart/reloader
9197
helm package ./deployments/kubernetes/chart/reloader --destination ./packaged-chart
9298
helm push ./packaged-chart/*.tgz oci://ghcr.io/stakater/charts
9399
rm -rf ./packaged-chart
94100
95101
- name: Sign artifacts with Cosign
96-
run: cosign sign --yes ghcr.io/stakater/charts/reloader:${{ steps.new_chart_version.outputs.result }}
102+
run: cosign sign --yes ghcr.io/stakater/charts/reloader-v2:${{ steps.new_chart_version.outputs.result }}
97103

98104
- name: Publish Helm chart to gh-pages
99105
uses: stefanprodan/helm-gh-pages@0ad2bb377311d61ac04ad9eb6f252fb68e207260 # v1.7.0
@@ -114,7 +120,7 @@ jobs:
114120
env:
115121
GITHUB_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
116122
WITH_V: false
117-
CUSTOM_TAG: chart-v${{ steps.new_chart_version.outputs.result }}
123+
CUSTOM_TAG: reloader-v2-chart-v${{ steps.new_chart_version.outputs.result }}
118124

119125
- name: Notify Slack
120126
uses: 8398a7/action-slack@77eaa4f1c608a7d68b38af4e3f739dcd8cba273e # v3

.github/workflows/release-helm-chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Release Helm chart
33
on:
44
push:
55
tags:
6-
- "chart-v*"
6+
- "reloader-v2-chart-v*"
77

88
permissions:
99
contents: write
@@ -26,7 +26,7 @@ jobs:
2626
run: |
2727
gh release create "$tag" \
2828
--repo="$GITHUB_REPOSITORY" \
29-
--title="Helm chart ${tag#chart-}" \
29+
--title="Helm chart reloader-v2 ${tag#reloader-v2-chart-v}" \
3030
--generate-notes
3131
3232
- name: Notify Slack

.github/workflows/release.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,8 @@ jobs:
147147
run: |
148148
echo GHCR_IMAGE_REPOSITORY=${{env.REGISTRY}}/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
149149
150-
# tag this image as latest as it will be used in plain manifests
150+
# v2 branch: publish a floating `v2` tag instead of `latest` so v2
151+
# releases never overwrite the v1 `latest` tag used by plain manifests.
151152
- name: Build and Push Docker Image to ghcr registry
152153
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6
153154
with:
@@ -157,7 +158,7 @@ jobs:
157158
push: true
158159
platforms: linux/amd64,linux/arm,linux/arm64
159160
tags: |
160-
${{ env.GHCR_IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.RELEASE_VERSION }},${{ env.GHCR_IMAGE_REPOSITORY }}:latest
161+
${{ env.GHCR_IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.RELEASE_VERSION }},${{ env.GHCR_IMAGE_REPOSITORY }}:v2
161162
build-args: |
162163
VERSION=${{ steps.generate_tag.outputs.RELEASE_VERSION }}
163164
COMMIT=${{ github.sha }}

deployments/kubernetes/chart/reloader/Chart.yaml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
apiVersion: v1
2-
name: reloader
1+
apiVersion: v2
2+
name: reloader-v2
33
description: Reloader chart that runs on kubernetes
4-
version: 2.2.12
5-
appVersion: v1.4.17
4+
version: 2.0.0
5+
appVersion: v2.0.0
66
keywords:
77
- Reloader
88
- kubernetes
@@ -17,3 +17,9 @@ maintainers:
1717
email: rasheed@stakater.com
1818
- name: faizanahmad055
1919
email: faizan@stakater.com
20+
dependencies:
21+
- name: reloader-enterprise
22+
alias: enterprise
23+
version: 0.1.0
24+
repository: oci://ghcr.io/stakater/charts
25+
condition: enterprise.enabled

deployments/kubernetes/chart/reloader/README.md

Lines changed: 60 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ helm repo add stakater https://stakater.github.io/stakater-charts
1010

1111
helm repo update
1212

13-
helm install stakater/reloader # For helm3 add --generate-name flag or set the release name
13+
helm install stakater/reloader-v2 # For helm3 add --generate-name flag or set the release name
1414

15-
helm install {{RELEASE_NAME}} stakater/reloader -n {{NAMESPACE}} --set reloader.watchGlobally=false # By default, Reloader watches in all namespaces. To watch in single namespace, set watchGlobally=false
15+
helm install {{RELEASE_NAME}} stakater/reloader-v2 -n {{NAMESPACE}} --set reloader.watchGlobally=false # By default, Reloader watches in all namespaces. To watch in single namespace, set watchGlobally=false
1616

17-
helm install stakater/reloader --set reloader.watchGlobally=false --namespace test --generate-name # Install Reloader in `test` namespace which will only watch `Deployments`, `Daemonsets` `Statefulsets` and `Rollouts` in `test` namespace.
17+
helm install stakater/reloader-v2 --set reloader.watchGlobally=false --namespace test --generate-name # Install Reloader in `test` namespace which will only watch `Deployments`, `Daemonsets` `Statefulsets` and `Rollouts` in `test` namespace.
1818

19-
helm install stakater/reloader --set reloader.ignoreJobs=true --set reloader.ignoreCronJobs=true --generate-name # Install Reloader ignoring Jobs and CronJobs from reload monitoring
19+
helm install stakater/reloader-v2 --set reloader.ignoreJobs=true --set reloader.ignoreCronJobs=true --generate-name # Install Reloader ignoring Jobs and CronJobs from reload monitoring
2020
```
2121

2222
## Uninstalling
@@ -170,6 +170,62 @@ helm uninstall {{RELEASE_NAME}} -n {{NAMESPACE}}
170170
### Deprecation Notice
171171
- `serviceMonitor` will be removed in future releases in favor of `PodMonitor`
172172

173+
## Enterprise mode
174+
175+
Reloader Enterprise adds a console, gateway, and cache (dragonfly) alongside the
176+
operator. It ships as an optional subchart gated by `enterprise.enabled`.
177+
178+
Enabling it requires **four** changes, because the operator image is swapped manually:
179+
180+
1. Turn on the subchart and set the component hostnames:
181+
182+
```yaml
183+
enterprise:
184+
enabled: true
185+
global:
186+
consoleHost: reloader-enterprise-console.apps.example.com
187+
gatewayHost: reloader-enterprise-gateway.apps.example.com
188+
```
189+
190+
2. Swap the operator image to the enterprise image:
191+
192+
```yaml
193+
image:
194+
repository: ghcr.io/stakater/reloader-enterprise
195+
tag: v0.0.43 # enterprise operator image tag (v-prefixed); use the latest release
196+
```
197+
198+
> **Version note:** three different numbers are in play here, don't mix them up:
199+
> - `image.tag` above is the **enterprise operator image** tag (e.g. `v0.0.43`).
200+
> - the `reloader-enterprise` **subchart** version (`0.1.0`, in `Chart.yaml`
201+
> dependencies) is the Helm chart version, not an image tag.
202+
> - the console and gateway images have their own tags again, set under
203+
> `enterprise.console.*` / `enterprise.gateway.*`.
204+
205+
3. Provide an image pull secret — the enterprise operator, console, and gateway
206+
images are in **private GHCR**:
207+
208+
```bash
209+
kubectl create secret docker-registry saap-dockerconfigjson \
210+
--docker-server=ghcr.io \
211+
--docker-username=<user> --docker-password=<token> \
212+
-n <release-namespace>
213+
```
214+
215+
```yaml
216+
global:
217+
imagePullSecrets:
218+
- name: saap-dockerconfigjson
219+
```
220+
221+
4. Deeper enterprise component settings pass through under `enterprise.console.*`,
222+
`enterprise.gateway.*`, and `enterprise.dragonfly.*` (see the reloader-enterprise
223+
chart values for the full list). Values you do not override fall back to the
224+
subchart defaults.
225+
226+
When `enterprise.enabled=false` (the default) none of the enterprise components are
227+
rendered and the operator uses the community image.
228+
173229
## Release Process
174230

175231
_Helm chart versioning_: The Reloader Helm chart is maintained in this repository. The Helm chart has its own semantic versioning. Helm charts and code releases are separate artifacts and separately versioned. Manifest making strategy relies on Kustomize. The Reloader Helm chart manages the two artifacts with these two fields:

deployments/kubernetes/chart/reloader/templates/NOTES.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,13 @@
55
{{ .Values.reloader.custom_annotations.secret | default "secret.reloader.stakater.com/reload" }}: "foo-secret"
66

77
- After successful installation, your pods will get rolling updates when a change in data of configmap or secret will happen.
8+
{{- if .Values.enterprise.enabled }}
9+
{{- $usingCommunityImage := ternary (eq .Values.image.name "stakater/reloader") (eq .Values.image.repository "ghcr.io/stakater/reloader") (not (empty .Values.global.imageRegistry)) }}
10+
{{- if $usingCommunityImage }}
11+
12+
WARNING: enterprise.enabled=true but the operator image still points at the
13+
community image. The operator will run, but without enterprise features. To use
14+
the enterprise operator, override {{ if .Values.global.imageRegistry }}image.name{{ else }}image.repository{{ end }}/image.tag — see the
15+
chart README "Enterprise mode".
16+
{{- end }}
17+
{{- end }}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
suite: Enterprise image swap
2+
templates:
3+
- deployment.yaml
4+
tests:
5+
- it: uses the community image by default
6+
asserts:
7+
- equal:
8+
path: spec.template.spec.containers[0].image
9+
value: ghcr.io/stakater/reloader:v2.0.0
10+
# The operator image is swapped manually via image.*; enterprise.enabled only
11+
# toggles the subchart and must NOT change the operator image on its own.
12+
- it: enterprise.enabled alone does not change the operator image
13+
set:
14+
enterprise:
15+
enabled: true
16+
asserts:
17+
- equal:
18+
path: spec.template.spec.containers[0].image
19+
value: ghcr.io/stakater/reloader:v2.0.0
20+
- it: uses the enterprise image when the image block is overridden
21+
set:
22+
image:
23+
repository: ghcr.io/stakater/reloader-enterprise
24+
tag: test-tag
25+
asserts:
26+
- equal:
27+
path: spec.template.spec.containers[0].image
28+
value: ghcr.io/stakater/reloader-enterprise:test-tag

deployments/kubernetes/chart/reloader/tests/namespaces_rbac_test.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ tests:
8282
of: RoleBinding
8383
- equal:
8484
path: roleRef.name
85-
value: reloader-reloader-role
85+
value: reloader-reloader-v2-role
8686
- equal:
8787
path: subjects[0].namespace
8888
value: reloader-ns
@@ -97,7 +97,7 @@ tests:
9797
template: role.yaml
9898
documentSelector:
9999
path: metadata.name
100-
value: reloader-reloader-metadata-role
100+
value: reloader-reloader-v2-metadata-role
101101
asserts:
102102
- equal:
103103
path: metadata.namespace
@@ -119,7 +119,7 @@ tests:
119119
template: role.yaml
120120
documentSelector:
121121
path: metadata.name
122-
value: reloader-reloader-metadata-role
122+
value: reloader-reloader-v2-metadata-role
123123
asserts:
124124
- contains:
125125
path: rules
@@ -143,7 +143,7 @@ tests:
143143
template: role.yaml
144144
documentSelector:
145145
path: metadata.name
146-
value: reloader-reloader-metadata-role
146+
value: reloader-reloader-v2-metadata-role
147147
asserts:
148148
- notContains:
149149
path: rules
@@ -194,7 +194,7 @@ tests:
194194
template: role.yaml
195195
- equal:
196196
path: metadata.name
197-
value: reloader-reloader-metadata-role
197+
value: reloader-reloader-v2-metadata-role
198198
template: role.yaml
199199
documentIndex: 0
200200

deployments/kubernetes/chart/reloader/values.yaml

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ global:
1010
#imagePullSecrets:
1111
# - my-pull-secret
1212

13+
## Required when enterprise.enabled=true (shared with the enterprise subchart)
14+
consoleHost: ""
15+
gatewayHost: ""
16+
gatewayScheme: https
17+
1318
kubernetes:
1419
host: https://kubernetes.default
1520

@@ -19,10 +24,42 @@ fullnameOverride: ""
1924
image:
2025
name: stakater/reloader
2126
repository: ghcr.io/stakater/reloader
22-
tag: v1.4.19
27+
tag: v2.0.0
2328
# digest: sha256:1234567
2429
pullPolicy: IfNotPresent
2530

31+
# Reloader Enterprise components (console + gateway + dragonfly cache).
32+
# When enabled, ALSO swap the operator image to the enterprise image and provide
33+
# global.imagePullSecrets — see the chart README "Enterprise mode".
34+
# NOTE: if global.imageRegistry is set, the operator image resolves from
35+
# global.imageRegistry + image.name (image.repository is ignored); in that mode
36+
# override image.name, not image.repository.
37+
enterprise:
38+
enabled: false
39+
console:
40+
enabled: true
41+
# deployment:
42+
# image:
43+
# tag: ""
44+
# OpenShift: router auto-creates a Route from the Ingress; this annotation
45+
# sets edge TLS termination on that Route.
46+
# ingress:
47+
# annotations:
48+
# route.openshift.io/termination: edge
49+
gateway:
50+
enabled: true
51+
dragonfly:
52+
enabled: true
53+
# deployment:
54+
# image:
55+
# Gateway images are published v-prefixed (WITH_V: true); latest is v0.0.23.
56+
# tag: ""
57+
# ingress:
58+
# annotations:
59+
# route.openshift.io/termination: edge
60+
dragonfly:
61+
fullnameOverride: reloader-enterprise-dragonfly
62+
2663
reloader:
2764
autoReloadAll: false
2865
isArgoRollouts: false

0 commit comments

Comments
 (0)