Skip to content

Commit 7c12644

Browse files
perdasilvaPer Goncalves da Silva
andauthored
🌱 OPRUN-4016: Split rbac generation into experimental/standard (#2099)
* Split rbac generation into experimental/standard Signed-off-by: Per Goncalves da Silva <[email protected]> * Add rbac standard/experimental split to catalogd Signed-off-by: Per Goncalves da Silva <[email protected]> * Add catalogd webhook exp/standard split Signed-off-by: Per Goncalves da Silva <[email protected]> * Fix merge conflicts Signed-off-by: Per Goncalves da Silva <[email protected]> --------- Signed-off-by: Per Goncalves da Silva <[email protected]> Co-authored-by: Per Goncalves da Silva <[email protected]>
1 parent 0491775 commit 7c12644

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+313
-63
lines changed

Makefile

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,18 +142,23 @@ tidy:
142142

143143
.PHONY: manifests
144144
KUSTOMIZE_CATD_RBAC_DIR := config/base/catalogd/rbac
145-
KUSTOMIZE_CATD_WEBHOOKS_DIR := config/base/catalogd/manager/webhook
145+
KUSTOMIZE_CATD_WEBHOOKS_DIR := config/base/catalogd/webhook
146146
KUSTOMIZE_OPCON_RBAC_DIR := config/base/operator-controller/rbac
147147
# Due to https://github.com/kubernetes-sigs/controller-tools/issues/837 we can't specify individual files
148148
# So we have to generate them together and then move them into place
149149
manifests: $(CONTROLLER_GEN) $(KUSTOMIZE) #EXHELP Generate WebhookConfiguration, ClusterRole, and CustomResourceDefinition objects.
150150
# Generate CRDs via our own generator
151151
hack/tools/update-crds.sh
152-
# Generate the remaining operator-controller manifests
153-
$(CONTROLLER_GEN) --load-build-tags=$(GO_BUILD_TAGS) rbac:roleName=manager-role paths="./internal/operator-controller/..." output:rbac:artifacts:config=$(KUSTOMIZE_OPCON_RBAC_DIR)
154-
# Generate the remaining catalogd manifests
155-
$(CONTROLLER_GEN) --load-build-tags=$(GO_BUILD_TAGS) rbac:roleName=manager-role paths="./internal/catalogd/..." output:rbac:artifacts:config=$(KUSTOMIZE_CATD_RBAC_DIR)
156-
$(CONTROLLER_GEN) --load-build-tags=$(GO_BUILD_TAGS) webhook paths="./internal/catalogd/..." output:webhook:artifacts:config=$(KUSTOMIZE_CATD_WEBHOOKS_DIR)
152+
# Generate the remaining operator-controller standard manifests
153+
$(CONTROLLER_GEN) --load-build-tags=$(GO_BUILD_TAGS),standard rbac:roleName=manager-role paths="./internal/operator-controller/..." output:rbac:artifacts:config=$(KUSTOMIZE_OPCON_RBAC_DIR)/standard
154+
# Generate the remaining operator-controller experimental manifests
155+
$(CONTROLLER_GEN) --load-build-tags=$(GO_BUILD_TAGS) rbac:roleName=manager-role paths="./internal/operator-controller/..." output:rbac:artifacts:config=$(KUSTOMIZE_OPCON_RBAC_DIR)/experimental
156+
# Generate the remaining catalogd standard manifests
157+
$(CONTROLLER_GEN) --load-build-tags=$(GO_BUILD_TAGS),standard rbac:roleName=manager-role paths="./internal/catalogd/..." output:rbac:artifacts:config=$(KUSTOMIZE_CATD_RBAC_DIR)/standard
158+
$(CONTROLLER_GEN) --load-build-tags=$(GO_BUILD_TAGS),standard webhook paths="./internal/catalogd/..." output:webhook:artifacts:config=$(KUSTOMIZE_CATD_WEBHOOKS_DIR)/standard
159+
# Generate the remaining catalogd experimental manifests
160+
$(CONTROLLER_GEN) --load-build-tags=$(GO_BUILD_TAGS) rbac:roleName=manager-role paths="./internal/catalogd/..." output:rbac:artifacts:config=$(KUSTOMIZE_CATD_RBAC_DIR)/experimental
161+
$(CONTROLLER_GEN) --load-build-tags=$(GO_BUILD_TAGS) webhook paths="./internal/catalogd/..." output:webhook:artifacts:config=$(KUSTOMIZE_CATD_WEBHOOKS_DIR)/experimental
157162
# Generate manifests stored in source-control
158163
mkdir -p $(MANIFEST_HOME)
159164
$(KUSTOMIZE) build $(KUSTOMIZE_STANDARD_OVERLAY) > $(STANDARD_MANIFEST)

config/base/catalogd/kustomization.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1
33
kind: Kustomization
44
namePrefix: catalogd-
55
resources:
6-
- rbac
76
- manager

config/base/catalogd/manager/kustomization.yaml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,9 @@ resources:
22
- manager.yaml
33
- service.yaml
44
- network_policy.yaml
5-
- webhook/manifests.yaml
65
apiVersion: kustomize.config.k8s.io/v1beta1
76
kind: Kustomization
87
images:
98
- name: controller
109
newName: quay.io/operator-framework/catalogd
1110
newTag: devel
12-
patches:
13-
- path: webhook/patch.yaml
14-
target:
15-
group: admissionregistration.k8s.io
16-
kind: MutatingWebhookConfiguration
17-
name: mutating-webhook-configuration
18-
version: v1
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
resources:
2+
# All RBAC will be applied under this service account in
3+
# the deployment namespace. You may comment out this resource
4+
# if your manager will use a service account that exists at
5+
# runtime. Be sure to update RoleBinding and ClusterRoleBinding
6+
# subjects if changing service account names.
7+
- service_account.yaml
8+
- role_binding.yaml
9+
- leader_election_role.yaml
10+
- leader_election_role_binding.yaml
11+
# The following RBAC configurations are used to protect
12+
# the metrics endpoint with authn/authz. These configurations
13+
# ensure that only authorized users and service accounts
14+
# can access the metrics endpoint. Comment the following
15+
# permissions if you want to disable this protection.
16+
# More info: https://book.kubebuilder.io/reference/metrics.html
17+
- auth_proxy_role.yaml
18+
- auth_proxy_role_binding.yaml
19+
- auth_proxy_client_clusterrole.yaml

0 commit comments

Comments
 (0)