Skip to content

Commit 46e1163

Browse files
authored
⚠️ OPRUN-4075: Move to a helm-based configuration (#2145)
* Move to a helm-based configuration This does not remove the kustomize config, but instead puts a helm chart into the repo, that should give very close (but not identical) results. * Adds a new chart: helm/olmv1/ - standard - experimental - openshift - cert-manager - e2e - tilt * Adds "values" files in helm/ * Adds helm executable to .bingo/ * Updates documents int docs/drafts/ * Update tests in tests/ * Update `make manifests` to use helm chart - Update the checked-in manifests - Use a tool like `dyff` to properly diff the manifests * Pull RBAC and WebHook config out of the goland code - controller-tools is not longer used to generate RBAC/Wehbooks - These resources are not part of the helm chart - The CRDs are still generated via kubebuilder Significant changes to the resulting manifests are listed in the RFC. Signed-off-by: Todd Short <[email protected]> Assisted-by: Gemini (research) Assisted-by: Claude Code (analysis) * Move files into directories Signed-off-by: Todd Short <[email protected]> Assisted-by: Gemini (research) Assisted-by: Claude Code (analysis) * Add variable settings to Makefile to control Helm charts Signed-off-by: Todd Short <[email protected]> Assisted-by: Gemini (research) Assisted-by: Claude Code (analysis) * Add prometheus Helm chart This is currently separate due to the ordering of application. If we change the order, this could be included in the main Helm Chart. Signed-off-by: Todd Short <[email protected]> Assisted-by: Gemini (research) Assisted-by: Claude Code (analysis) * Add lint-helm target and CI Signed-off-by: Todd Short <[email protected]> Assisted-by: Gemini (research) Assisted-by: Claude Code (analysis) * Add Boxcutter support Signed-off-by: Todd Short <[email protected]> * Update catalogs to use 4.20 Signed-off-by: Todd Short <[email protected]> * Remove clusterextension editor role Signed-off-by: Todd Short <[email protected]> * Remove configmaps from leader election role Signed-off-by: Todd Short <[email protected]> * Remove stale comment from config manager role Signed-off-by: Todd Short <[email protected]> * Add templating failure for featureSet Signed-off-by: Todd Short <[email protected]> --------- Signed-off-by: Todd Short <[email protected]>
1 parent 67098e7 commit 46e1163

File tree

95 files changed

+7820
-2800
lines changed

Some content is hidden

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

95 files changed

+7820
-2800
lines changed

.bingo/Variables.mk

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ $(GORELEASER): $(BINGO_DIR)/goreleaser.mod
5353
@echo "(re)installing $(GOBIN)/goreleaser-v1.26.2"
5454
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=goreleaser.mod -o=$(GOBIN)/goreleaser-v1.26.2 "github.com/goreleaser/goreleaser"
5555

56+
HELM := $(GOBIN)/helm-v3.18.4
57+
$(HELM): $(BINGO_DIR)/helm.mod
58+
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
59+
@echo "(re)installing $(GOBIN)/helm-v3.18.4"
60+
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=helm.mod -o=$(GOBIN)/helm-v3.18.4 "helm.sh/helm/v3/cmd/helm"
61+
5662
KIND := $(GOBIN)/kind-v0.29.0
5763
$(KIND): $(BINGO_DIR)/kind.mod
5864
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.

.bingo/helm.mod

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
2+
3+
go 1.24.3
4+
5+
require helm.sh/helm/v3 v3.18.4 // cmd/helm

.bingo/helm.sum

Lines changed: 303 additions & 0 deletions
Large diffs are not rendered by default.

.bingo/variables.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ GOLANGCI_LINT="${GOBIN}/golangci-lint-v2.1.6"
2020

2121
GORELEASER="${GOBIN}/goreleaser-v1.26.2"
2222

23+
HELM="${GOBIN}/helm-v3.18.4"
24+
2325
KIND="${GOBIN}/kind-v0.29.0"
2426

2527
KUSTOMIZE="${GOBIN}/kustomize-v5.6.0"

.github/workflows/sanity.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,15 @@ jobs:
3030

3131
- name: Run golangci linting checks
3232
run: make lint
33+
34+
lint-helm:
35+
runs-on: ubuntu-latest
36+
steps:
37+
- uses: actions/checkout@v5
38+
39+
- uses: actions/setup-go@v5
40+
with:
41+
go-version-file: "go.mod"
42+
43+
- name: Run helm linting checks
44+
run: make lint-helm

.tilt-support

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,4 +150,4 @@ def deploy_repo(data, tags="", debug=True):
150150
local_port = repo['starting_debug_port']
151151
build_binary(reponame, repo['binary'], repo['deps'], repo['image'], tags, debug)
152152
k8s_resource(repo['deployment'], port_forwards=['{}:30000'.format(local_port)])
153-
process_yaml(kustomize(data['yaml']))
153+
process_yaml(helm('helm/olmv1', name="olmv1", values=[data['yaml']]))

Makefile

Lines changed: 42 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,12 @@ export EXPERIMENTAL_RELEASE_INSTALL := install-experimental.sh
8383
export RELEASE_CATALOGS := default-catalogs.yaml
8484

8585
# List of manifests that are checked in
86-
MANIFEST_HOME := ./manifests
87-
STANDARD_MANIFEST := ./manifests/standard.yaml
88-
STANDARD_E2E_MANIFEST := ./manifests/standard-e2e.yaml
89-
EXPERIMENTAL_MANIFEST := ./manifests/experimental.yaml
90-
EXPERIMENTAL_E2E_MANIFEST := ./manifests/experimental-e2e.yaml
91-
CATALOGS_MANIFEST := ./manifests/default-catalogs.yaml
86+
MANIFEST_HOME := manifests
87+
STANDARD_MANIFEST := $(MANIFEST_HOME)/standard.yaml
88+
STANDARD_E2E_MANIFEST := $(MANIFEST_HOME)/standard-e2e.yaml
89+
EXPERIMENTAL_MANIFEST := $(MANIFEST_HOME)/experimental.yaml
90+
EXPERIMENTAL_E2E_MANIFEST := $(MANIFEST_HOME)/experimental-e2e.yaml
91+
CATALOGS_MANIFEST := $(MANIFEST_HOME)/default-catalogs.yaml
9292

9393
# Disable -j flag for make
9494
.NOTPARALLEL:
@@ -123,6 +123,10 @@ help-extended: #HELP Display extended help.
123123
lint: lint-custom $(GOLANGCI_LINT) #HELP Run golangci linter.
124124
$(GOLANGCI_LINT) run --build-tags $(GO_BUILD_TAGS) $(GOLANGCI_LINT_ARGS)
125125

126+
lint-helm: $(HELM) #HELP Run helm linter
127+
helm lint helm/olmv1
128+
helm lint helm/prometheus
129+
126130
.PHONY: custom-linter-build
127131
custom-linter-build: #EXHELP Build custom linter
128132
go build -tags $(GO_BUILD_TAGS) -o ./bin/custom-linter ./hack/ci/custom-linters/cmd
@@ -139,31 +143,39 @@ k8s-pin: #EXHELP Pin k8s staging modules based on k8s.io/kubernetes version (in
139143
tidy:
140144
go mod tidy
141145

142-
.PHONY: manifests
143-
KUSTOMIZE_CATD_RBAC_DIR := config/base/catalogd/rbac
144-
KUSTOMIZE_CATD_WEBHOOKS_DIR := config/base/catalogd/webhook
145-
KUSTOMIZE_OPCON_RBAC_DIR := config/base/operator-controller/rbac
146146
# Due to https://github.com/kubernetes-sigs/controller-tools/issues/837 we can't specify individual files
147147
# So we have to generate them together and then move them into place
148-
manifests: $(CONTROLLER_GEN) $(KUSTOMIZE) #EXHELP Generate WebhookConfiguration, ClusterRole, and CustomResourceDefinition objects.
149-
# Generate CRDs via our own generator
148+
.PHONY: update-crds
149+
update-crds:
150150
hack/tools/update-crds.sh
151-
# Generate the remaining operator-controller standard manifests
152-
$(CONTROLLER_GEN) --load-build-tags=$(GO_BUILD_TAGS),standard rbac:roleName=manager-role paths="./internal/operator-controller/..." output:rbac:artifacts:config=$(KUSTOMIZE_OPCON_RBAC_DIR)/standard
153-
# Generate the remaining operator-controller experimental manifests
154-
$(CONTROLLER_GEN) --load-build-tags=$(GO_BUILD_TAGS) rbac:roleName=manager-role paths="./internal/operator-controller/..." output:rbac:artifacts:config=$(KUSTOMIZE_OPCON_RBAC_DIR)/experimental
155-
# Generate the remaining catalogd standard manifests
156-
$(CONTROLLER_GEN) --load-build-tags=$(GO_BUILD_TAGS),standard rbac:roleName=manager-role paths="./internal/catalogd/..." output:rbac:artifacts:config=$(KUSTOMIZE_CATD_RBAC_DIR)/standard
157-
$(CONTROLLER_GEN) --load-build-tags=$(GO_BUILD_TAGS),standard webhook paths="./internal/catalogd/..." output:webhook:artifacts:config=$(KUSTOMIZE_CATD_WEBHOOKS_DIR)/standard
158-
# Generate the remaining catalogd experimental manifests
159-
$(CONTROLLER_GEN) --load-build-tags=$(GO_BUILD_TAGS) rbac:roleName=manager-role paths="./internal/catalogd/..." output:rbac:artifacts:config=$(KUSTOMIZE_CATD_RBAC_DIR)/experimental
160-
$(CONTROLLER_GEN) --load-build-tags=$(GO_BUILD_TAGS) webhook paths="./internal/catalogd/..." output:webhook:artifacts:config=$(KUSTOMIZE_CATD_WEBHOOKS_DIR)/experimental
161-
# Generate manifests stored in source-control
162-
mkdir -p $(MANIFEST_HOME)
163-
$(KUSTOMIZE) build $(KUSTOMIZE_STANDARD_OVERLAY) > $(STANDARD_MANIFEST)
164-
$(KUSTOMIZE) build $(KUSTOMIZE_STANDARD_E2E_OVERLAY) > $(STANDARD_E2E_MANIFEST)
165-
$(KUSTOMIZE) build $(KUSTOMIZE_EXPERIMENTAL_OVERLAY) > $(EXPERIMENTAL_MANIFEST)
166-
$(KUSTOMIZE) build $(KUSTOMIZE_EXPERIMENTAL_E2E_OVERLAY) > $(EXPERIMENTAL_E2E_MANIFEST)
151+
152+
# The filename variables can be overridden on the command line if you want to change the set of values files:
153+
# e.g. make "manifests/standard.yaml=helm/cert-manager.yaml my-values-file.yaml" manifests
154+
#
155+
# The set of MANIFESTS to be generated can be changed; you can generate your own custom manifest
156+
# e.g. make MANIFESTS=test.yaml "test.yaml=helm/e2e.yaml" manifests
157+
#
158+
# Override HELM_SETTINGS on the command line to include additional Helm settings
159+
# e.g. make HELM_SETTINGS="options.openshift.enabled=true" manifests
160+
# e.g. make HELM_SETTINGS="operatorControllerFeatures={WebhookProviderCertManager}" manifests
161+
#
162+
MANIFESTS ?= $(STANDARD_MANIFEST) $(STANDARD_E2E_MANIFEST) $(EXPERIMENTAL_MANIFEST) $(EXPERIMENTAL_E2E_MANIFEST)
163+
$(STANDARD_MANIFEST) ?= helm/cert-manager.yaml
164+
$(STANDARD_E2E_MANIFEST) ?= helm/cert-manager.yaml helm/e2e.yaml
165+
$(EXPERIMENTAL_MANIFEST) ?= helm/cert-manager.yaml helm/experimental.yaml
166+
$(EXPERIMENTAL_E2E_MANIFEST) ?= helm/cert-manager.yaml helm/experimental.yaml helm/e2e.yaml
167+
HELM_SETTINGS ?=
168+
.PHONY: $(MANIFESTS)
169+
$(MANIFESTS): $(HELM)
170+
@mkdir -p $(MANIFEST_HOME)
171+
$(HELM) template olmv1 helm/olmv1 $(addprefix --values ,$($@)) $(addprefix --set ,$(HELM_SETTINGS)) > $@
172+
173+
# Generate manifests stored in source-control
174+
.PHONY: manifests
175+
manifests: update-crds $(MANIFESTS) $(HELM) #EXHELP Generate OLMv1 manifests
176+
# These are testing existing manifest options without saving the results
177+
$(HELM) template olmv1 helm/olmv1 --values helm/tilt.yaml $(addprefix --set ,$(HELM_SETTINGS)) > /dev/null
178+
$(HELM) template olmv1 helm/olmv1 --set "options.openshift.enabled=true" > /dev/null
167179

168180
.PHONY: generate
169181
generate: $(CONTROLLER_GEN) #EXHELP Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
@@ -285,8 +297,8 @@ test-experimental-e2e: run-internal image-registry prometheus experimental-e2e e
285297
.PHONY: prometheus
286298
prometheus: PROMETHEUS_NAMESPACE := olmv1-system
287299
prometheus: PROMETHEUS_VERSION := v0.83.0
288-
prometheus: #EXHELP Deploy Prometheus into specified namespace
289-
./hack/test/install-prometheus.sh $(PROMETHEUS_NAMESPACE) $(PROMETHEUS_VERSION) $(KUSTOMIZE) $(VERSION)
300+
prometheus: $(KUSTOMIZE) #EXHELP Deploy Prometheus into specified namespace
301+
./hack/test/install-prometheus.sh $(PROMETHEUS_NAMESPACE) $(PROMETHEUS_VERSION) $(VERSION)
290302

291303
.PHONY: test-extension-developer-e2e
292304
test-extension-developer-e2e: SOURCE_MANIFEST := $(STANDARD_E2E_MANIFEST)

Tiltfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ olmv1 = {
1717
'starting_debug_port': 30000,
1818
},
1919
},
20-
'yaml': 'config/overlays/tilt-local-dev',
20+
'yaml': 'helm/tilt.yaml',
2121
}
2222

2323
deploy_repo(olmv1, '-tags containers_image_openpgp')

docs/draft/api-reference/network-policies.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ NetworkPolicy is implemented for both catalogd and operator-controller component
1919

2020
Each component has a dedicated NetworkPolicy that applies to its respective pod through label selectors:
2121

22-
* For catalogd: `control-plane=catalogd-controller-manager`
23-
* For operator-controller: `control-plane=operator-controller-controller-manager`
22+
* For catalogd: `app.kubernetes.io/name=catalogd`
23+
* For operator-controller: `app.kubernetes.io/name=operator-controller`
2424

2525
### Catalogd NetworkPolicy
2626

@@ -78,10 +78,10 @@ If you encounter network connectivity issues after deploying OLMv1, consider the
7878

7979
```bash
8080
# Verify catalogd pod labels
81-
kubectl get pods -n olmv1-system --selector=control-plane=catalogd-controller-manager
81+
kubectl get pods -n olmv1-system --selector=apps.kubernetes.io/name=catalogd
8282

8383
# Verify operator-controller pod labels
84-
kubectl get pods -n olmv1-system --selector=control-plane=operator-controller-controller-manager
84+
kubectl get pods -n olmv1-system --selector=apps.kubernetes.io/name=operator-controller
8585

8686
# Compare with actual pod names
8787
kubectl get pods -n olmv1-system | grep -E 'catalogd|operator-controller'

docs/draft/howto/consuming-metrics.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ apiVersion: monitoring.coreos.com/v1
226226
kind: ServiceMonitor
227227
metadata:
228228
labels:
229-
control-plane: operator-controller-controller-manager
229+
apps.kubernetes.io/name: operator-controller
230230
name: controller-manager-metrics-monitor
231231
namespace: olmv1-system
232232
spec:
@@ -251,7 +251,7 @@ spec:
251251
key: tls.key
252252
selector:
253253
matchLabels:
254-
control-plane: operator-controller-controller-manager
254+
apps.kubernetes.io/name: operator-controller
255255
EOF
256256
```
257257

@@ -268,7 +268,7 @@ apiVersion: monitoring.coreos.com/v1
268268
kind: ServiceMonitor
269269
metadata:
270270
labels:
271-
control-plane: catalogd-controller-manager
271+
apps.kubernetes.io/name: catalogd
272272
name: catalogd-metrics-monitor
273273
namespace: olmv1-system
274274
spec:
@@ -298,4 +298,4 @@ EOF
298298
```
299299

300300
[prometheus-operator]: https://github.com/prometheus-operator/kube-prometheus
301-
[rbac-k8s-docs]: https://kubernetes.io/docs/reference/access-authn-authz/rbac/
301+
[rbac-k8s-docs]: https://kubernetes.io/docs/reference/access-authn-authz/rbac/

0 commit comments

Comments
 (0)