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

Update to Kustomize v5 #646

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,12 @@ CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
ENVTEST ?= $(LOCALBIN)/setup-envtest

## Tool Versions
KUSTOMIZE_VERSION ?= 4.5.5
KUSTOMIZE_VERSION ?= 5.4.2
KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/kustomize/v${KUSTOMIZE_VERSION}/hack/install_kustomize.sh"
.PHONY: kustomize
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.
$(KUSTOMIZE): $(LOCALBIN)
test -s $(LOCALBIN)/kustomize || curl -s $(KUSTOMIZE_INSTALL_SCRIPT) | bash -s $(KUSTOMIZE_VERSION) $(LOCALBIN)
test -s $(LOCALBIN)/kustomize || GOBIN=$(LOCALBIN) GO111MODULE=on go install sigs.k8s.io/kustomize/kustomize/v5@v$(KUSTOMIZE_VERSION)

CONTROLLER_TOOLS_VERSION ?= 0.14.0
.PHONY: controller-gen
Expand Down
10 changes: 5 additions & 5 deletions bundle/manifests/runtime-component.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ metadata:
"name": "runtimecomponent-sample"
},
"spec": {
"applicationImage": "icr.io/appcafe/open-liberty/samples/getting-started@sha256:fd04ce5a5870387a379b54da5c47d0338c5f4a1254611d2418f1f959d018ba7e",
"applicationImage": "icr.io/appcafe/open-liberty/samples/getting-started@sha256:422a7a00edc338497c0a91890b09204b8505ef0e377bb9b5944ace0102055e91",
"expose": true,
"manageTLS": true,
"replicas": 1,
Expand Down Expand Up @@ -44,7 +44,7 @@ metadata:
"name": "runtimecomponent-sample"
},
"spec": {
"applicationImage": "icr.io/appcafe/open-liberty/samples/getting-started@sha256:fd04ce5a5870387a379b54da5c47d0338c5f4a1254611d2418f1f959d018ba7e",
"applicationImage": "icr.io/appcafe/open-liberty/samples/getting-started@sha256:422a7a00edc338497c0a91890b09204b8505ef0e377bb9b5944ace0102055e91",
"expose": true,
"replicas": 1,
"service": {
Expand All @@ -71,7 +71,7 @@ metadata:
categories: Application Runtime
certified: "true"
containerImage: icr.io/appcafe/runtime-component-operator:daily
createdAt: "2024-07-11T19:05:26Z"
createdAt: "2024-07-25T13:54:09Z"
description: Deploys any runtime component with dynamic and auto-tuning configuration
olm.skipRange: '>=0.8.0 <1.3.2'
operators.openshift.io/infrastructure-features: '["disconnected"]'
Expand Down Expand Up @@ -1012,7 +1012,7 @@ spec:
fieldRef:
fieldPath: metadata.annotations['olm.targetNamespaces']
- name: RELATED_IMAGE_LIBERTY_SAMPLE_APP
value: icr.io/appcafe/open-liberty/samples/getting-started@sha256:fd04ce5a5870387a379b54da5c47d0338c5f4a1254611d2418f1f959d018ba7e
value: icr.io/appcafe/open-liberty/samples/getting-started@sha256:422a7a00edc338497c0a91890b09204b8505ef0e377bb9b5944ace0102055e91
- name: RELATED_IMAGE_RUNTIME_COMPONENT_OPERATOR
value: icr.io/appcafe/runtime-component-operator:daily
image: icr.io/appcafe/runtime-component-operator:daily
Expand Down Expand Up @@ -1295,7 +1295,7 @@ spec:
provider:
name: Community
relatedImages:
- image: icr.io/appcafe/open-liberty/samples/getting-started@sha256:fd04ce5a5870387a379b54da5c47d0338c5f4a1254611d2418f1f959d018ba7e
- image: icr.io/appcafe/open-liberty/samples/getting-started@sha256:422a7a00edc338497c0a91890b09204b8505ef0e377bb9b5944ace0102055e91
name: liberty-sample-app
- image: icr.io/appcafe/runtime-component-operator:daily
name: runtime-component-operator
Expand Down
6 changes: 3 additions & 3 deletions config/crd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ resources:
- bases/rc.app.stacks_runtimeoperations.yaml
# +kubebuilder:scaffold:crdkustomizeresource

patchesStrategicMerge:
patches:
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix.
# patches here are for enabling the conversion webhook for each CRD
#- patches/webhook_in_runtimecomponents.yaml
Expand All @@ -19,8 +19,8 @@ patchesStrategicMerge:
#- patches/cainjection_in_runtimeoperations.yaml
# +kubebuilder:scaffold:crdkustomizecainjectionpatch

- patches/preserveUnknownFields_runtimecomponents.yaml
- patches/preserveUnknownFields_runtimeoperations.yaml
- path: patches/preserveUnknownFields_runtimecomponents.yaml
- path: patches/preserveUnknownFields_runtimeoperations.yaml
# +kubebuilder:scaffold:preserveunknownfieldspatch

# the following config is for teaching kustomize how to do kustomization for CRDs.
Expand Down
6 changes: 3 additions & 3 deletions config/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ commonLabels:
app.kubernetes.io/managed-by: olm
app.kubernetes.io/name: runtime-component-operator

bases:
resources:
- ../crd
- ../rbac
- ../manager
Expand All @@ -26,7 +26,7 @@ bases:
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
#- ../prometheus

patchesStrategicMerge:
# patches:
# Protect the /metrics endpoint by putting it behind auth.
# If you want your controller-manager to expose the /metrics
# endpoint w/o any authn/z, please comment the following line.
Expand All @@ -42,7 +42,7 @@ patchesStrategicMerge:
#- webhookcainjection_patch.yaml

# the following config is for teaching kustomize how to do var substitution
vars:
# vars:
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER' prefix.
#- name: CERTIFICATE_NAMESPACE # namespace of the certificate CR
# objref:
Expand Down
56 changes: 27 additions & 29 deletions config/kubectl/operator/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,30 @@ patches:
- path: patches/delete-namespace.yaml
target:
kind: Namespace

patchesJson6902:
- target:
namespace: system
name: .*
patch: |-
- op: remove
path: /metadata/namespace
- target:
namespace: runtime-component-operator
name: .*
patch: |-
- op: remove
path: /metadata/namespace
- target:
kind: RoleBinding
name: .*
patch: |-
- op: remove
path: /subjects/0/namespace
- target:
kind: Deployment
name: rco-controller-manager
patch: |-
- op: remove
path: /spec/template/spec/containers/0/env/1/valueFrom
- op: add
path: /spec/template/spec/containers/0/env/1/value
value: RUNTIME_COMPONENT_WATCH_NAMESPACE
- target:
namespace: system
name: .*
patch: |-
- op: remove
path: /metadata/namespace
- target:
namespace: runtime-component-operator
name: .*
patch: |-
- op: remove
path: /metadata/namespace
- target:
kind: RoleBinding
name: .*
patch: |-
- op: remove
path: /subjects/0/namespace
- target:
kind: Deployment
name: rco-controller-manager
patch: |-
- op: remove
path: /spec/template/spec/containers/0/env/1/valueFrom
- op: add
path: /spec/template/spec/containers/0/env/1/value
value: RUNTIME_COMPONENT_WATCH_NAMESPACE
110 changes: 54 additions & 56 deletions config/kubectl/rbac-watch-all/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,59 +14,57 @@ patches:
- path: patches/delete-service-account.yaml
target:
kind: ServiceAccount

patchesJson6902:
- target:
namespace: runtime-component-operator
name: .*
patch: |-
- op: remove
path: /metadata/namespace
- target:
kind: Role
name: .*
patch: |-
- op: replace
path: /kind
value: ClusterRole
- target:
kind: RoleBinding
name: .*
patch: |-
- op: replace
path: /kind
value: ClusterRoleBinding
- target:
kind: ClusterRoleBinding
name: .*
patch: |-
- op: replace
path: /subjects/0/name
value: rco-controller-manager
- op: replace
path: /subjects/0/namespace
value: RUNTIME_COMPONENT_OPERATOR_NAMESPACE
- op: replace
path: /roleRef/kind
value: ClusterRole
- target:
kind: ClusterRoleBinding
name: rco-cluster-leader-election-rolebinding
patch: |-
- op: replace
path: /roleRef/name
value: rco-cluster-leader-election-role
- target:
kind: ClusterRoleBinding
name: rco-cluster-manager-rolebinding
patch: |-
- op: replace
path: /roleRef/name
value: rco-cluster-manager-role
- target:
kind: ClusterRole
name: rco-cluster-manager-role
patch: |-
- op: add
path: /rules/-
value: {"apiGroups":[""],"resources":["namespaces"],"verbs":["get","list","watch"]}
- target:
namespace: runtime-component-operator
name: .*
patch: |-
- op: remove
path: /metadata/namespace
- target:
kind: Role
name: .*
patch: |-
- op: replace
path: /kind
value: ClusterRole
- target:
kind: RoleBinding
name: .*
patch: |-
- op: replace
path: /kind
value: ClusterRoleBinding
- target:
kind: ClusterRoleBinding
name: .*
patch: |-
- op: replace
path: /subjects/0/name
value: rco-controller-manager
- op: replace
path: /subjects/0/namespace
value: RUNTIME_COMPONENT_OPERATOR_NAMESPACE
- op: replace
path: /roleRef/kind
value: ClusterRole
- target:
kind: ClusterRoleBinding
name: rco-cluster-leader-election-rolebinding
patch: |-
- op: replace
path: /roleRef/name
value: rco-cluster-leader-election-role
- target:
kind: ClusterRoleBinding
name: rco-cluster-manager-rolebinding
patch: |-
- op: replace
path: /roleRef/name
value: rco-cluster-manager-role
- target:
kind: ClusterRole
name: rco-cluster-manager-role
patch: |-
- op: add
path: /rules/-
value: {"apiGroups":[""],"resources":["namespaces"],"verbs":["get","list","watch"]}
64 changes: 31 additions & 33 deletions config/kubectl/rbac-watch-another/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,37 +14,35 @@ patches:
- path: patches/delete-service-account.yaml
target:
kind: ServiceAccount
- target:
name: .*
patch: |-
- op: replace
path: /metadata/namespace
value: RUNTIME_COMPONENT_WATCH_NAMESPACE
- target:
kind: RoleBinding
name: .*
patch: |-
- op: replace
path: /subjects/0/namespace
value: RUNTIME_COMPONENT_OPERATOR_NAMESPACE
- op: replace
path: /subjects/0/name
value: rco-controller-manager
- target:
kind: RoleBinding
name: rco-watched-leader-election-rolebinding
patch: |-
- op: replace
path: /roleRef/name
value: rco-watched-leader-election-role
- target:
kind: RoleBinding
name: rco-watched-manager-rolebinding
patch: |-
- op: replace
path: /roleRef/name
value: rco-watched-manager-role

patchesJson6902:
- target:
name: .*
patch: |-
- op: replace
path: /metadata/namespace
value: RUNTIME_COMPONENT_WATCH_NAMESPACE
- target:
kind: RoleBinding
name: .*
patch: |-
- op: replace
path: /subjects/0/namespace
value: RUNTIME_COMPONENT_OPERATOR_NAMESPACE
- op: replace
path: /subjects/0/name
value: rco-controller-manager
- target:
kind: RoleBinding
name: rco-watched-leader-election-rolebinding
patch: |-
- op: replace
path: /roleRef/name
value: rco-watched-leader-election-role
- target:
kind: RoleBinding
name: rco-watched-manager-rolebinding
patch: |-
- op: replace
path: /roleRef/name
value: rco-watched-manager-role



2 changes: 1 addition & 1 deletion config/kustomize/crd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ commonLabels:
app.kubernetes.io/instance: runtime-component-operator
app.kubernetes.io/name: runtime-component-operator

bases:
resources:
- ../../crd
6 changes: 3 additions & 3 deletions config/kustomize/operator/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ commonLabels:
app.kubernetes.io/instance: runtime-component-operator
app.kubernetes.io/name: runtime-component-operator

patchesStrategicMerge:
- patches/delete-namespace.yaml
- patches/watch-namespace.yaml
patches:
- path: patches/delete-namespace.yaml
- path: patches/watch-namespace.yaml
Loading