Skip to content

Commit 7fc28dd

Browse files
authored
Merge pull request #326 from 3scale-sre/fix/defaul-kustomize-overlay
Fix the "default" kustomize overlay for the controller
2 parents f83b153 + a56e7aa commit 7fc28dd

5 files changed

Lines changed: 51 additions & 8 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
- op: replace
2+
path: /kind
3+
value: ClusterRole
4+
- op: remove
5+
path: /metadata/namespace
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
- op: replace
2+
path: /kind
3+
value: ClusterRoleBinding
4+
- op: replace
5+
path: /roleRef/kind
6+
value: ClusterRole
7+
- op: remove
8+
path: /metadata/namespace
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
- op: replace
2+
path: /spec/ports
3+
value:
4+
- name: metrics
5+
port: 8080
6+
protocol: TCP
7+
targetPort: metrics

config/default/kustomization.yaml

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Adds namespace to all resources.
2-
namespace: saas-operatorsystem
2+
namespace: saas-operator-system
33

44
# Value of this field is prepended to the
55
# names of all resources, e.g. a deployment named
66
# "wordpress" becomes "alices-wordpress".
77
# Note that it should also match with the prefix (text before '-') of the namespace
88
# field above.
9-
namePrefix: saas-operator
9+
namePrefix: saas-operator-
1010

1111
# Labels to add to all resources and selectors.
1212
#labels:
@@ -37,12 +37,34 @@ resources:
3737
patches:
3838
# [METRICS] The following patch will enable the metrics endpoint using HTTPS and the port :8443.
3939
# More info: https://book.kubebuilder.io/reference/metrics
40-
- path: manager_metrics_patch.yaml
41-
target:
42-
kind: Deployment
40+
# - path: manager_metrics_patch.yaml
41+
# target:
42+
# kind: Deployment
4343

44-
# [CUSTOM] Custom changes specific to saas-operator
44+
# [CUSTOM] Modify manager settings
4545
- path: custom/manager_patch.yaml
46+
target:
47+
kind: Deployment
48+
name: controller-manager
49+
- path: custom/metrics_service_patch.yaml
50+
target:
51+
group: ""
52+
kind: Service
53+
name: controller-manager-metrics-service
54+
version: v1
55+
# [CUSTOM] Use ClusterRole and ClusterRoleBinding
56+
- path: custom/clusterrole_patch.yaml
57+
target:
58+
group: rbac.authorization.k8s.io
59+
kind: Role
60+
name: manager-role
61+
version: v1
62+
- path: custom/clusterrolebinding_patch.yaml
63+
target:
64+
group: rbac.authorization.k8s.io
65+
kind: RoleBinding
66+
name: manager-rolebinding
67+
version: v1
4668

4769
# Uncomment the patches line if you enable Metrics and CertManager
4870
# [METRICS-WITH-CERTS] To enable metrics protected with certManager, uncomment the following line.

config/rbac/role_binding.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
apiVersion: rbac.authorization.k8s.io/v1
2-
kind: ClusterRoleBinding
2+
kind: RoleBinding
33
metadata:
44
labels:
55
app.kubernetes.io/name: saas-operator
66
app.kubernetes.io/managed-by: kustomize
77
name: manager-rolebinding
8+
namespace: placeholder
89
roleRef:
910
apiGroup: rbac.authorization.k8s.io
10-
kind: ClusterRole
11+
kind: Role
1112
name: manager-role
1213
subjects:
1314
- kind: ServiceAccount

0 commit comments

Comments
 (0)