Skip to content

Commit

Permalink
helm: keep namespace in manager.yaml and remove from helm overlay
Browse files Browse the repository at this point in the history
Signed-off-by: Eguzki Astiz Lezaun <[email protected]>
  • Loading branch information
eguzki committed Oct 10, 2024
1 parent e3b68ee commit e2cc561
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 17 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified

deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
$(KUSTOMIZE) build config/deploy | kubectl apply -f -
$(KUSTOMIZE) build config/default | kubectl apply -f -
cd config/manager && $(KUSTOMIZE) edit set image controller=${DEFAULT_IMG}

deploy-develmode: manifests kustomize ## Deploy controller in debug mode to the K8s cluster specified in ~/.kube/config.
Expand All @@ -300,7 +300,7 @@ deploy-develmode: manifests kustomize ## Deploy controller in debug mode to the
cd config/manager && $(KUSTOMIZE) edit set image controller=${DEFAULT_IMG}

undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config.
$(KUSTOMIZE) build config/deploy | kubectl delete -f -
$(KUSTOMIZE) build config/default | kubectl delete -f -

.PHONY: install-olm
install-olm: $(OPERATOR_SDK)
Expand Down
16 changes: 16 additions & 0 deletions charts/limitador-operator/templates/manifests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.15.0
labels:
app.kubernetes.io/managed-by: helm
name: limitadors.limitador.kuadrant.io
spec:
group: limitador.kuadrant.io
Expand Down Expand Up @@ -1180,12 +1182,15 @@ kind: ServiceAccount
metadata:
labels:
app: limitador-operator
app.kubernetes.io/managed-by: helm
name: limitador-operator-controller-manager
namespace: '{{ .Release.Namespace }}'
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
labels:
app.kubernetes.io/managed-by: helm
name: limitador-operator-leader-election-role
namespace: '{{ .Release.Namespace }}'
rules:
Expand Down Expand Up @@ -1214,6 +1219,8 @@ rules:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
app.kubernetes.io/managed-by: helm
name: limitador-operator-manager-role
rules:
- apiGroups:
Expand Down Expand Up @@ -1290,6 +1297,8 @@ rules:
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
labels:
app.kubernetes.io/managed-by: helm
name: limitador-operator-leader-election-rolebinding
namespace: '{{ .Release.Namespace }}'
roleRef:
Expand All @@ -1304,6 +1313,8 @@ subjects:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
labels:
app.kubernetes.io/managed-by: helm
name: limitador-operator-manager-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
Expand All @@ -1330,13 +1341,16 @@ data:
resourceName: 3745a16e.kuadrant.io
kind: ConfigMap
metadata:
labels:
app.kubernetes.io/managed-by: helm
name: limitador-operator-manager-config
namespace: '{{ .Release.Namespace }}'
---
apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/managed-by: helm
control-plane: controller-manager
name: limitador-operator-metrics
namespace: '{{ .Release.Namespace }}'
Expand All @@ -1353,6 +1367,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/managed-by: helm
control-plane: controller-manager
name: limitador-operator-controller-manager
namespace: '{{ .Release.Namespace }}'
Expand All @@ -1365,6 +1380,7 @@ spec:
metadata:
labels:
app: limitador-operator
app.kubernetes.io/managed-by: helm
control-plane: controller-manager
spec:
containers:
Expand Down
2 changes: 1 addition & 1 deletion config/deploy-develmode/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../deploy
- ../default
patchesStrategicMerge:
- devel_mode_patch.yaml
7 changes: 0 additions & 7 deletions config/deploy/kustomization.yaml

This file was deleted.

7 changes: 0 additions & 7 deletions config/deploy/namespace.yaml

This file was deleted.

14 changes: 14 additions & 0 deletions config/helm/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,19 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: "{{ .Release.Namespace }}"

labels:
- pairs:
app.kubernetes.io/managed-by: helm
includeTemplates: true

resources:
- ../default

patches:
- patch: |-
$patch: delete
apiVersion: v1
kind: Namespace
metadata:
name: limitador-operator-system
6 changes: 6 additions & 0 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
apiVersion: v1
kind: Namespace
metadata:
labels:
control-plane: controller-manager
name: system
---
apiVersion: apps/v1
kind: Deployment
Expand Down

0 comments on commit e2cc561

Please sign in to comment.