Skip to content

Commit

Permalink
add Deployment match and template and Service selector labels contain…
Browse files Browse the repository at this point in the history
…ing operator name RamenDR#277

	- install kustomize version 3.8.8 including inline transformer support for hub and dr-cluster deployments
		- https://github.com/kubernetes-sigs/kustomize/releases/tag/kustomize%2Fv3.8.8
		- https://github.com/kubernetes-sigs/kustomize/releases/tag/api%2Fv0.6.6
		- kubernetes-sigs/kustomize#3225

Signed-off-by: hatfieldbrian <[email protected]>
  • Loading branch information
hatfieldbrian committed Sep 22, 2021
1 parent cea2012 commit 5f366d4
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ install-hub: manifests kustomize ## Install hub CRDs into the K8s cluster specif
uninstall-hub: manifests kustomize ## Uninstall hub CRDs from the K8s cluster specified in ~/.kube/config.
$(KUSTOMIZE) build --load_restrictor none config/hub/crd | kubectl delete -f -

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

Expand All @@ -161,7 +161,7 @@ install-dr-cluster: manifests kustomize ## Install dr-cluster CRDs into the K8s
uninstall-dr-cluster: manifests kustomize ## Uninstall dr-cluster CRDs from the K8s cluster specified in ~/.kube/config.
$(KUSTOMIZE) build --load_restrictor none config/dr-cluster/crd | kubectl delete -f -

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

Expand All @@ -178,6 +178,9 @@ KUSTOMIZE = $(shell pwd)/bin/kustomize
kustomize: ## Download kustomize locally if necessary.
$(call go-get-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/[email protected])

kustomize-v3.8.8: ## Download kustomize locally
$(call go-get-tool,'',sigs.k8s.io/kustomize/kustomize/[email protected])

# go-get-tool will 'go get' any package $2 and install it to $1.
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))
define go-get-tool
Expand Down
15 changes: 15 additions & 0 deletions config/dr-cluster/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,21 @@ namePrefix: ramen-dr-cluster-
# Labels to add to all resources and selectors.
#commonLabels:
# someName: someValue
transformers:
- |-
apiVersion: builtin
kind: LabelTransformer
metadata:
name: temporary
labels:
app: ramen-dr-cluster
fieldSpecs:
- kind: Deployment
path: spec/selector/matchLabels
- kind: Deployment
path: spec/template/metadata/labels
- kind: Service
path: spec/selector
bases:
- ../crd
Expand Down
15 changes: 15 additions & 0 deletions config/hub/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,21 @@ namePrefix: ramen-hub-
# Labels to add to all resources and selectors.
#commonLabels:
# someName: someValue
transformers:
- |-
apiVersion: builtin
kind: LabelTransformer
metadata:
name: temporary
labels:
app: ramen-hub
fieldSpecs:
- kind: Deployment
path: spec/selector/matchLabels
- kind: Deployment
path: spec/template/metadata/labels
- kind: Service
path: spec/selector
bases:
- ../crd
Expand Down

0 comments on commit 5f366d4

Please sign in to comment.