diff --git a/Makefile b/Makefile index d7fdd3004..a73ec0260 100644 --- a/Makefile +++ b/Makefile @@ -183,6 +183,7 @@ uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified deploy: update-mgr-env manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config. cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG} && $(KUSTOMIZE) edit set nameprefix ${MANAGER_NAME_PREFIX} cd config/default && $(KUSTOMIZE) edit set image rbac-proxy=$(RBAC_PROXY_IMG) + cd config/webhook && $(KUSTOMIZE) edit set nameprefix ${MANAGER_NAME_PREFIX} $(KUSTOMIZE) build config/default | kubectl apply -f - undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config. @@ -232,6 +233,7 @@ bundle: update-mgr-env manifests kustomize operator-sdk rename-csv build-prometh rm -rf bundle # $(OPERATOR_SDK) generate kustomize manifests --package $(BUNDLE_PACKAGE) -q cd config/default && $(KUSTOMIZE) edit set namespace $(OPERATOR_NAMESPACE) + cd config/webhook && $(KUSTOMIZE) edit set nameprefix ${MANAGER_NAME_PREFIX} cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG} && $(KUSTOMIZE) edit set nameprefix ${MANAGER_NAME_PREFIX} cd config/default && $(KUSTOMIZE) edit set image rbac-proxy=$(RBAC_PROXY_IMG) $(KUSTOMIZE) build config/manifests | $(OPERATOR_SDK) generate bundle -q --package $(BUNDLE_PACKAGE) --version $(VERSION) $(BUNDLE_METADATA_OPTS) diff --git a/config/default/kustomization.yaml b/config/default/kustomization.yaml index 9dfa92b46..830454df6 100644 --- a/config/default/kustomization.yaml +++ b/config/default/kustomization.yaml @@ -46,6 +46,7 @@ resources: - ../rbac - ../manager - ../prometheus +- ../webhook images: - name: rbac-proxy newName: gcr.io/kubebuilder/kube-rbac-proxy diff --git a/config/webhook/kustomization.yaml b/config/webhook/kustomization.yaml index 9cf26134e..40b9a143f 100644 --- a/config/webhook/kustomization.yaml +++ b/config/webhook/kustomization.yaml @@ -1,3 +1,8 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +namePrefix: lvm-operator- + resources: - manifests.yaml - service.yaml diff --git a/config/webhook/service.yaml b/config/webhook/service.yaml index 3f638bd9c..08b24d4b1 100644 --- a/config/webhook/service.yaml +++ b/config/webhook/service.yaml @@ -10,4 +10,4 @@ spec: protocol: TCP targetPort: 9443 selector: - control-plane: controller-manager + app.kubernetes.io/name: lvm-operator