Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deploy: fix setting rbac-proxy image in kustomize files #108

Merged
merged 1 commit into from
Feb 1, 2022

Conversation

Rakshith-R
Copy link
Member

cd config/manager && $(KUSTOMIZE) edit set image controller=${CONTROLLER_IMG} $(KUSTOMIZE_RBAC_PROXY)
The above command did not set rbax-proxy image since this
image variable was part of config/default/kustomization.yaml.
This commit fixes this issue and does some cleanup in the Makefile
and config/default/kustomization.yaml(running the cmd moved
/removed some default parameters).

Signed-off-by: Rakshith R [email protected]

Currently

[rakshith@fedora kubernetes-csi-addons]$ RBAC_PROXY_IMG=gcr.io/kubebuilder/kube-rbac-proxy:v0.9.0 make manifests 
make: go: Permission denied
go build -o /home/rakshith/workspace/src/github.com/csi-addons/kubernetes-csi-addons/bin/controller-gen ./vendor/sigs.k8s.io/controller-tools/cmd/controller-gen
go build -o /home/rakshith/workspace/src/github.com/csi-addons/kubernetes-csi-addons/bin/kustomize ./vendor/sigs.k8s.io/kustomize/kustomize/v4
/home/rakshith/workspace/src/github.com/csi-addons/kubernetes-csi-addons/bin/controller-gen rbac:roleName=manager-role crd webhook paths="{./api/...,./cmd/...,./controllers/...,./sidecar/...}" output:crd:artifacts:config=config/crd/bases
cd config/manager && /home/rakshith/workspace/src/github.com/csi-addons/kubernetes-csi-addons/bin/kustomize edit set image controller=quay.io/csiaddons/k8s-controller:latest rbac-proxy=gcr.io/kubebuilder/kube-rbac-proxy:v0.9.0
/home/rakshith/workspace/src/github.com/csi-addons/kubernetes-csi-addons/bin/kustomize build config/default > deploy/controller/setup-controller.yaml
[rakshith@fedora kubernetes-csi-addons]$ git diff
diff --git a/config/manager/kustomization.yaml b/config/manager/kustomization.yaml
index 98ef21b..7956db1 100644
--- a/config/manager/kustomization.yaml
+++ b/config/manager/kustomization.yaml
@@ -14,3 +14,6 @@ images:
 - name: controller
   newName: quay.io/csiaddons/k8s-controller
   newTag: latest
+- name: rbac-proxy
+  newName: gcr.io/kubebuilder/kube-rbac-proxy
+  newTag: v0.9.0

After fix

[rakshith@fedora kubernetes-csi-addons]$ RBAC_PROXY_IMG=gcr.io/kubebuilder/kube-rbac-proxy:v0.9.0 make manifests 
make: go: Permission denied
go build -o /home/rakshith/workspace/src/github.com/csi-addons/kubernetes-csi-addons/bin/controller-gen ./vendor/sigs.k8s.io/controller-tools/cmd/controller-gen
go build -o /home/rakshith/workspace/src/github.com/csi-addons/kubernetes-csi-addons/bin/kustomize ./vendor/sigs.k8s.io/kustomize/kustomize/v4
/home/rakshith/workspace/src/github.com/csi-addons/kubernetes-csi-addons/bin/controller-gen rbac:roleName=manager-role crd webhook paths="{./api/...,./cmd/...,./controllers/...,./sidecar/...}" output:crd:artifacts:config=config/crd/bases
cd config/default && /home/rakshith/workspace/src/github.com/csi-addons/kubernetes-csi-addons/bin/kustomize edit set image rbac-proxy=gcr.io/kubebuilder/kube-rbac-proxy:v0.9.0
cd config/manager && /home/rakshith/workspace/src/github.com/csi-addons/kubernetes-csi-addons/bin/kustomize edit set image controller=quay.io/csiaddons/k8s-controller:latest
/home/rakshith/workspace/src/github.com/csi-addons/kubernetes-csi-addons/bin/kustomize build config/default > deploy/controller/setup-controller.yaml
[rakshith@fedora kubernetes-csi-addons]$ git diff
diff --git a/config/default/kustomization.yaml b/config/default/kustomization.yaml
index 8250834..62b9329 100644
--- a/config/default/kustomization.yaml
+++ b/config/default/kustomization.yaml
@@ -73,7 +73,7 @@ patchesStrategicMerge:
 images:
 - name: rbac-proxy
   newName: gcr.io/kubebuilder/kube-rbac-proxy
-  newTag: v0.8.0
+  newTag: v0.9.0
 apiVersion: kustomize.config.k8s.io/v1beta1
 kind: Kustomization
 resources:
diff --git a/deploy/controller/setup-controller.yaml b/deploy/controller/setup-controller.yaml
index 490d38f..a628c18 100644
--- a/deploy/controller/setup-controller.yaml
+++ b/deploy/controller/setup-controller.yaml
@@ -1009,7 +1009,7 @@ spec:
         - --upstream=http://127.0.0.1:8080/
         - --logtostderr=true
         - --v=10
-        image: gcr.io/kubebuilder/kube-rbac-proxy:v0.8.0
+        image: gcr.io/kubebuilder/kube-rbac-proxy:v0.9.0
         name: kube-rbac-proxy
         ports:
         - containerPort: 8443

@mergify mergify bot requested review from nixpanic, yati1998 and Yuggupta27 January 31, 2022 11:20
@Rakshith-R Rakshith-R requested a review from Madhu-1 February 1, 2022 04:47
` cd config/manager && $(KUSTOMIZE) edit set image
 controller=${CONTROLLER_IMG} $(KUSTOMIZE_RBAC_PROXY)`
The above command did not set rbax-proxy image since this
image variable was part of config/default/kustomization.yaml.
This commit fixes this issue and does some cleanup in the Makefile
and config/default/kustomization.yaml(running the cmd moved
/removed some default parameters).

Signed-off-by: Rakshith R <[email protected]>
@mergify mergify bot merged commit 383733b into csi-addons:main Feb 1, 2022
nixpanic pushed a commit to nixpanic/kubernetes-csi-addons that referenced this pull request Jan 12, 2024
Syncing latest changes from upstream main for kubernetes-csi-addons
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants