Skip to content

Commit b5187de

Browse files
committed
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]>
1 parent 35bcd7a commit b5187de

File tree

78 files changed

+7363
-2706
lines changed

Some content is hidden

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

78 files changed

+7363
-2706
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"

.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: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -140,30 +140,21 @@ tidy:
140140
go mod tidy
141141

142142
.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
143+
KUSTOMIZE_CATD_RBAC_DIR := helm/olmv1/base/catalogd/rbac
144+
KUSTOMIZE_CATD_WEBHOOKS_DIR := helm/olmv1/base/catalogd/webhook
145+
KUSTOMIZE_OPCON_RBAC_DIR := helm/olmv1/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.
148+
manifests: $(CONTROLLER_GEN) $(HELM) #EXHELP Generate WebhookConfiguration, ClusterRole, and CustomResourceDefinition objects.
149149
# Generate CRDs via our own generator
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
161151
# Generate manifests stored in source-control
162152
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)
153+
$(HELM) template olmv1 helm/olmv1 --values helm/cert-manager.yaml > $(STANDARD_MANIFEST)
154+
$(HELM) template olmv1 helm/olmv1 --values helm/cert-manager.yaml --values helm/e2e.yaml > $(STANDARD_E2E_MANIFEST)
155+
$(HELM) template olmv1 helm/olmv1 --values helm/cert-manager.yaml --values helm/experimental.yaml > $(EXPERIMENTAL_MANIFEST)
156+
$(HELM) template olmv1 helm/olmv1 --values helm/cert-manager.yaml --values helm/experimental.yaml --values helm/e2e.yaml > $(EXPERIMENTAL_E2E_MANIFEST)
157+
$(HELM) template olmv1 helm/olmv1 --values helm/tilt.yaml > /dev/null
167158

168159
.PHONY: generate
169160
generate: $(CONTROLLER_GEN) #EXHELP Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
@@ -285,7 +276,7 @@ test-experimental-e2e: run-internal image-registry prometheus experimental-e2e e
285276
.PHONY: prometheus
286277
prometheus: PROMETHEUS_NAMESPACE := olmv1-system
287278
prometheus: PROMETHEUS_VERSION := v0.83.0
288-
prometheus: #EXHELP Deploy Prometheus into specified namespace
279+
prometheus: $(KUSTOMIZE) #EXHELP Deploy Prometheus into specified namespace
289280
./hack/test/install-prometheus.sh $(PROMETHEUS_NAMESPACE) $(PROMETHEUS_VERSION) $(KUSTOMIZE) $(VERSION)
290281

291282
.PHONY: test-extension-developer-e2e

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/

docs/draft/howto/enable-helm-chart-support.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ To enable the Helm Chart support feature gate, you need to patch the `operator-c
2424
2. **Wait for the controller manager pods to be ready:**
2525

2626
```bash
27-
$ kubectl -n olmv1-system wait --for condition=ready pods -l control-plane=operator-controller-controller-manager
27+
$ kubectl -n olmv1-system wait --for condition=ready pods -l apps.kubernetes.io/name=operator-controller
2828
```
2929

3030
Once the above wait condition is met, the `HelmChartSupport` feature gate should be enabled in operator controller.

0 commit comments

Comments
 (0)