Skip to content

Commit 36b1193

Browse files
authored
feat: Split ngrok-operators CRDs into their own chart (#732)
Signed-off-by: Jonathan Stacks <[email protected]>
1 parent ea488a0 commit 36b1193

40 files changed

+243
-36
lines changed

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ PROJECT linguist-generated=true
77
api/**/zz_generated*go linguist-generated=true
88

99
# These files are generated by kubebuilder. See Makefile for details.
10-
helm/ngrok-operator/templates/crds/** linguist-generated=true
10+
helm/ngrok-crds/templates/*.yaml linguist-generated=true
1111
helm/ngrok-operator/templates/rbac/role.yaml linguist-generated=true
1212
manifest-bundle.yaml linguist-generated=true
1313

.github/actions/changes/action.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,10 @@ runs:
3737
- '.github/actions/**'
3838
chartyaml:
3939
- 'helm/ngrok-operator/Chart.yaml'
40+
- 'helm/ngrok-crds/Chart.yaml'
4041
charts:
4142
- 'helm/ngrok-operator/**'
43+
- 'helm/ngrok-crds/**'
4244
- 'scripts/e2e.sh'
4345
go:
4446
- '**.go'

.github/workflows/helm_release.yaml

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
branches:
66
- main
77
paths:
8+
- 'helm/ngrok-crds/Chart.yaml'
89
- 'helm/ngrok-operator/Chart.yaml'
910

1011
jobs:
@@ -13,7 +14,8 @@ jobs:
1314
runs-on: ubuntu-latest
1415
timeout-minutes: 10
1516
outputs:
16-
charts: ${{ steps.filter.outputs.charts }}
17+
ngrok-operator: ${{ steps.filter.outputs.ngrok-operator }}
18+
ngrok-crds: ${{ steps.filter.outputs.ngrok-crds }}
1719
permissions:
1820
contents: read
1921
pull-requests: read
@@ -26,19 +28,24 @@ jobs:
2628
uses: dorny/[email protected]
2729
with:
2830
filters: |
29-
charts:
31+
ngrok-operator:
3032
- 'helm/ngrok-operator/Chart.yaml'
33+
ngrok-crds:
34+
- 'helm/ngrok-crds/Chart.yaml'
3135
3236
chart:
33-
name: Release Chart
37+
name: Release Charts
3438
runs-on: ubuntu-latest
3539
timeout-minutes: 15
3640
permissions:
3741
contents: write # need to write releases
3842
needs: [changes]
3943
if: |
4044
(github.repository == 'ngrok/ngrok-operator') &&
41-
(needs.changes.outputs.charts == 'true')
45+
(
46+
(needs.changes.outputs.ngrok-operator == 'true') ||
47+
(needs.changes.outputs.ngrok-crds == 'true')
48+
)
4249
steps:
4350
- name: Checkout repo
4451
uses: actions/checkout@v6
@@ -69,7 +76,7 @@ jobs:
6976
uses: helm/[email protected]
7077
env:
7178
CR_TOKEN: ${{ secrets.GITHUB_TOKEN }}
72-
CR_RELEASE_NAME_TEMPLATE: "helm-chart-{{ .Version }}" # Publishes a new release. Ex: helm-chart-0.1.0
79+
CR_RELEASE_NAME_TEMPLATE: "helm-chart-{{ .Name }}-{{ .Version }}" # Publishes a new release. Ex: helm-chart-ngrok-operator-0.1.0
7380
CR_SKIP_EXISTING: "true"
7481
CR_KEY: "Team Eng Infra (ngrok.com) (Key for signing ngrok-operator Helm chart) <[email protected]>" # full key name
7582
CR_KEYRING: keyring.gpg
@@ -80,9 +87,25 @@ jobs:
8087

8188
- run: ls -alth .
8289
working-directory: ./.cr-release-packages
83-
shell: bash
8490

85-
- name: Push to charts.ngrok.com
91+
- name: Push ngrok-crds to charts.ngrok.com
92+
if: needs.changes.outputs.ngrok-crds == 'true'
93+
working-directory: ./.cr-release-packages
94+
env:
95+
CHART_PUSH_AUTH: ${{ secrets.CHART_PUSH_AUTH }}
96+
run: |
97+
for chart in ngrok-crds-*.tgz; do
98+
if [ -f "${chart}.prov" ]; then
99+
echo "Uploading ${chart} and ${chart}.prov"
100+
curl -H "Authorization: Basic ${CHART_PUSH_AUTH}" -F "chart=@${chart}" -F "prov=@${chart}.prov" "https://charts.ngrok.com/api/charts"
101+
else
102+
echo "Uploading ${chart}"
103+
curl -H "Authorization: Basic ${CHART_PUSH_AUTH}" -F "chart=@${chart}" "https://charts.ngrok.com/api/charts"
104+
fi
105+
done
106+
107+
- name: Push ngrok-operator to charts.ngrok.com
108+
if: needs.changes.outputs.ngrok-operator == 'true'
86109
working-directory: ./.cr-release-packages
87110
env:
88111
CHART_PUSH_AUTH: ${{ secrets.CHART_PUSH_AUTH }}

.github/workflows/pr-comments.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@ jobs:
2828
filters: |
2929
chartyaml:
3030
- 'helm/ngrok-operator/Chart.yaml'
31+
- 'helm/ngrok-crds/Chart.yaml'
3132
charts:
3233
- 'helm/ngrok-operator/**'
34+
- 'helm/ngrok-crds/**'
3335
- 'scripts/e2e.sh'
3436
go:
3537
- '**.go'
@@ -63,7 +65,7 @@ jobs:
6365
issue_number: context.issue.number,
6466
owner: context.repo.owner,
6567
repo: context.repo.repo,
66-
body: ":wave: Looks like there are changes in the Helm Chart's Chart.yaml file. Upon merge, a new release of the helm chart will be created if the Chart's version was changed."
68+
body: ":wave: Looks like there are changes in a Helm Chart's Chart.yaml file. Upon merge, a new release of the helm chart will be created if the Chart's version was changed."
6769
})
6870
- if: needs.changes.outputs.tag == 'true'
6971
name: Notify about version change

docs/developer-guide/releasing.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
- [Artifacts](#artifacts)
44
- [Docker Image](#docker-image)
55
- [Helm Chart](#helm-chart)
6+
- [CRDs Helm Chart](#crds-helm-chart)
67
- [Semantic Versioning](#semantic-versioning)
78
- [Release Process](#release-process)
89
- [Tagging](#tagging)
910
- [Helm Chart](#helm-chart-1)
11+
- [CRDs Helm Chart](#crds-helm-chart-1)
1012
- [Controller](#controller)
1113

1214
# Release Steps
@@ -55,6 +57,13 @@ support `amd64` and `arm64` architectures, with future plans to build for other
5557
The helm chart is packaged and published to its own [helm repository](https://charts.ngrok.com/index.yaml)
5658
and can be installed by following the instructions in the chart's [README](../helm/ingress-operator/README.md).
5759

60+
### CRDs Helm Chart
61+
62+
The `ngrok-crds` helm chart contains the Custom Resource Definitions (CRDs) for the ngrok operator.
63+
This chart is published to the same [helm repository](https://charts.ngrok.com/index.yaml) as the
64+
main operator chart. It allows users to manage CRD lifecycle separately from the operator, which
65+
is useful for GitOps workflows and when multiple operators share the same CRDs.
66+
5867
## Semantic Versioning
5968

6069
This project uses [semantic versioning](https://semver.org/) for both the the docker image
@@ -79,8 +88,8 @@ There is a different git tag pattern for each artifact.
7988
#### Helm Chart
8089

8190
Releases of the helm chart will be tagged with a prefix of `helm-chart-`. For example, version `1.2.0`
82-
of the helm chart will have a git tag of `helm-chart-1.2.0` which contains the code used to package
83-
and publish version `1.2.0` of the helm chart.
91+
of the helm chart will have a git tag of `helm-chart-1.2.0` or `helm-chart-ngrok-operator-1.2.0` which
92+
contains the code used to package and publish version `1.2.0` of the helm chart.
8493

8594
When changes are made to the helm chart's `Chart.yaml` file, a github workflow will trigger upon
8695
merging the PR to the `main` branch. The workflow will package and publish the helm chart for
@@ -89,6 +98,16 @@ consumption. The workflow will also create a git tag as described above.
8998
When changing `version` in the helm chart's `Chart.yaml` file, the version should be bumped according
9099
to the semantic versioning spec as described above.
91100

101+
#### CRDs Helm Chart
102+
103+
Releases of the CRDs helm chart will be tagged with a prefix of `helm-chart-`. For example, version `0.1.0`
104+
of the CRDs helm chart will have a git tag of `helm-chart-ngrok-crds-0.1.0` which contains the code used to package
105+
and publish version `0.1.0` of the CRDs helm chart.
106+
107+
When changes are made to the CRDs helm chart's `Chart.yaml` file in `helm/ngrok-crds/`, a github workflow
108+
will trigger upon merging the PR to the `main` branch. The workflow will package and publish the CRDs
109+
helm chart for consumption. The workflow will also create a git tag as described above.
110+
92111
#### Controller
93112

94113
Releases of the controller will be tagged with a prefix of `ngrok-operator-`. For example,

helm/ngrok-crds/.helmignore

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Source: https://github.com/helm/helm/blob/main/pkg/repo/repotest/testdata/examplechart/.helmignore
2+
# Patterns to ignore when building packages.
3+
# This supports shell glob matching, relative path matching, and
4+
# negation (prefixed with !). Only one pattern per line.
5+
.DS_Store
6+
# Common VCS dirs
7+
.git/
8+
.gitignore
9+
.bzr/
10+
.bzrignore
11+
.hg/
12+
.hgignore
13+
.svn/
14+
# Common backup files
15+
*.swp
16+
*.bak
17+
*.tmp
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
24+
# helmtest plugin tests
25+
tests
26+
27+
# Makefile used in development
28+
Makefile

helm/ngrok-crds/Chart.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
apiVersion: v2
2+
name: ngrok-crds
3+
description: ngrok Custom Resource Definitions for Kubernetes.
4+
version: 0.1.0
5+
appVersion: 0.1.0
6+
keywords:
7+
- ngrok
8+
- networking
9+
- ingress
10+
- edge
11+
- api gateway
12+
home: https://ngrok.com
13+
sources:
14+
- https://github.com/ngrok/ngrok-operator
15+
icon: https://charts.ngrok.com/assets/ngrok-favicon.svg

helm/ngrok-crds/README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# ngrok Custom Resource Definitions
2+
3+
This Helm chart installs the ngrok Custom Resource Definitions (CRDs) for Kubernetes.
4+
5+
## Usage
6+
7+
### Prerequisites
8+
9+
[Helm](https://helm.sh) must be installed to use the charts.
10+
Please refer to Helm's [documentation](https://helm.sh/docs) to get started.
11+
12+
### Installation
13+
14+
Once Helm has been set up correctly, add the repo as follows:
15+
16+
`helm repo add ngrok https://charts.ngrok.com`
17+
18+
If you had already added this repo earlier, run `helm repo update` to retrieve the latest versions of the packages.
19+
You can then run `helm search repo ngrok` to see the charts.
20+
21+
To install the ngrok-crds chart:
22+
23+
`helm install ngrok-crds ngrok/ngrok-crds`
24+
25+
To uninstall the chart:
26+
27+
`helm delete ngrok-crds`
28+
29+
### Using with ngrok-operator
30+
31+
The `ngrok-operator` chart can install these CRDs automatically via the `installCRDs` value (enabled by default).
32+
You only need to install this chart separately if you want to manage CRD lifecycle independently from the operator.
33+
34+
## More Information
35+
36+
For more information about the ngrok Kubernetes Operator, see https://github.com/ngrok/ngrok-operator

helm/ngrok-crds/templates/NOTES.txt

Whitespace-only changes.

helm/ngrok-operator/templates/crds/bindings.k8s.ngrok.com_boundendpoints.yaml renamed to helm/ngrok-crds/templates/bindings.k8s.ngrok.com_boundendpoints.yaml

File renamed without changes.

0 commit comments

Comments
 (0)