Skip to content

Commit e30768c

Browse files
committed
Deploy providers in the same namespace
To do this it is required to remove the namespace and object prefix fields from the default kustomization.yaml. Without these changes the namespace objects in the manager manifest would get prefixed and thus would change between the providers. Now it will be required to directly name and namespace resources when creating them.
1 parent a3ef39e commit e30768c

35 files changed

+84
-122
lines changed

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ help: ## Display this help.
5454

5555
.PHONY: manifests
5656
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
57-
cd bootstrap && $(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=./config/crd/bases
58-
cd controlplane && $(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=./config/crd/bases
57+
cd bootstrap && $(CONTROLLER_GEN) rbac:roleName=capoa-bootstrap-manager-role crd webhook paths="./..." output:crd:artifacts:config=./config/crd/bases
58+
cd controlplane && $(CONTROLLER_GEN) rbac:roleName=capoa-controlplane-manager-role crd webhook paths="./..." output:crd:artifacts:config=./config/crd/bases
5959

6060
.PHONY: generate
6161
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.

bootstrap-components.yaml

+9-11
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v1
22
kind: Namespace
33
metadata:
4-
name: capoa-bootstrap-system
4+
name: capoa-system
55
---
66
apiVersion: apiextensions.k8s.io/v1
77
kind: CustomResourceDefinition
@@ -583,13 +583,13 @@ apiVersion: v1
583583
kind: ServiceAccount
584584
metadata:
585585
name: capoa-bootstrap-controller-manager
586-
namespace: capoa-bootstrap-system
586+
namespace: capoa-system
587587
---
588588
apiVersion: rbac.authorization.k8s.io/v1
589589
kind: Role
590590
metadata:
591591
name: capoa-bootstrap-leader-election-role
592-
namespace: capoa-bootstrap-system
592+
namespace: capoa-system
593593
rules:
594594
- apiGroups:
595595
- ""
@@ -756,15 +756,15 @@ apiVersion: rbac.authorization.k8s.io/v1
756756
kind: RoleBinding
757757
metadata:
758758
name: capoa-bootstrap-leader-election-rolebinding
759-
namespace: capoa-bootstrap-system
759+
namespace: capoa-system
760760
roleRef:
761761
apiGroup: rbac.authorization.k8s.io
762762
kind: Role
763763
name: capoa-bootstrap-leader-election-role
764764
subjects:
765765
- kind: ServiceAccount
766766
name: capoa-bootstrap-controller-manager
767-
namespace: capoa-bootstrap-system
767+
namespace: capoa-system
768768
---
769769
apiVersion: rbac.authorization.k8s.io/v1
770770
kind: ClusterRoleBinding
@@ -777,7 +777,7 @@ roleRef:
777777
subjects:
778778
- kind: ServiceAccount
779779
name: capoa-bootstrap-controller-manager
780-
namespace: capoa-bootstrap-system
780+
namespace: capoa-system
781781
---
782782
apiVersion: rbac.authorization.k8s.io/v1
783783
kind: ClusterRoleBinding
@@ -790,13 +790,13 @@ roleRef:
790790
subjects:
791791
- kind: ServiceAccount
792792
name: capoa-bootstrap-controller-manager
793-
namespace: capoa-bootstrap-system
793+
namespace: capoa-system
794794
---
795795
apiVersion: v1
796796
kind: Service
797797
metadata:
798798
name: capoa-bootstrap-controller-manager-metrics-service
799-
namespace: capoa-bootstrap-system
799+
namespace: capoa-system
800800
spec:
801801
ports:
802802
- name: https
@@ -810,16 +810,14 @@ apiVersion: apps/v1
810810
kind: Deployment
811811
metadata:
812812
name: capoa-bootstrap-controller-manager
813-
namespace: capoa-bootstrap-system
813+
namespace: capoa-system
814814
spec:
815815
replicas: 1
816816
selector:
817817
matchLabels:
818818
control-plane: capoa-bootstrap-controller-manager
819819
template:
820820
metadata:
821-
annotations:
822-
kubectl.kubernetes.io/default-container: manager
823821
labels:
824822
control-plane: capoa-bootstrap-controller-manager
825823
spec:

bootstrap/config/default/kustomization.yaml

-16
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,3 @@
1-
# Adds namespace to all resources.
2-
namespace: capoa-bootstrap-system
3-
4-
# Value of this field is prepended to the
5-
# names of all resources, e.g. a deployment named
6-
# "wordpress" becomes "alices-wordpress".
7-
# Note that it should also match with the prefix (text before '-') of the namespace
8-
# field above.
9-
namePrefix: capoa-bootstrap-
10-
11-
# Labels to add to all resources and selectors.
12-
#labels:
13-
#- includeSelectors: true
14-
# pairs:
15-
# someName: someValue
16-
171
resources:
182
- ../crd
193
- ../rbac

bootstrap/config/default/manager_auth_proxy_patch.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
apiVersion: apps/v1
44
kind: Deployment
55
metadata:
6-
name: controller-manager
7-
namespace: system
6+
name: capoa-bootstrap-controller-manager
7+
namespace: capoa-system
88
spec:
99
template:
1010
spec:

bootstrap/config/manager/manager.yaml

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
apiVersion: v1
22
kind: Namespace
33
metadata:
4-
name: system
4+
name: capoa-system
55
---
66
apiVersion: apps/v1
77
kind: Deployment
88
metadata:
9-
name: controller-manager
10-
namespace: system
9+
name: capoa-bootstrap-controller-manager
10+
namespace: capoa-system
1111
spec:
1212
selector:
1313
matchLabels:
1414
control-plane: capoa-bootstrap-controller-manager
1515
replicas: 1
1616
template:
1717
metadata:
18-
annotations:
19-
kubectl.kubernetes.io/default-container: manager
2018
labels:
2119
control-plane: capoa-bootstrap-controller-manager
2220
spec:
@@ -59,5 +57,5 @@ spec:
5957
requests:
6058
cpu: 10m
6159
memory: 64Mi
62-
serviceAccountName: controller-manager
60+
serviceAccountName: capoa-bootstrap-controller-manager
6361
terminationGracePeriodSeconds: 10

bootstrap/config/prometheus/monitor.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
apiVersion: monitoring.coreos.com/v1
33
kind: ServiceMonitor
44
metadata:
5-
name: controller-manager-metrics-monitor
6-
namespace: system
5+
name: capoa-bootstrap-controller-manager-metrics-monitor
6+
namespace: capoa-system
77
spec:
88
endpoints:
99
- path: /metrics

bootstrap/config/rbac/auth_proxy_client_clusterrole.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: rbac.authorization.k8s.io/v1
22
kind: ClusterRole
33
metadata:
4-
name: metrics-reader
4+
name: capoa-bootstrap-metrics-reader
55
rules:
66
- nonResourceURLs:
77
- "/metrics"

bootstrap/config/rbac/auth_proxy_role.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: rbac.authorization.k8s.io/v1
22
kind: ClusterRole
33
metadata:
4-
name: proxy-role
4+
name: capoa-bootstrap-proxy-role
55
rules:
66
- apiGroups:
77
- authentication.k8s.io
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
apiVersion: rbac.authorization.k8s.io/v1
22
kind: ClusterRoleBinding
33
metadata:
4-
name: proxy-rolebinding
4+
name: capoa-bootstrap-proxy-rolebinding
55
roleRef:
66
apiGroup: rbac.authorization.k8s.io
77
kind: ClusterRole
8-
name: proxy-role
8+
name: capoa-bootstrap-proxy-role
99
subjects:
1010
- kind: ServiceAccount
11-
name: controller-manager
12-
namespace: system
11+
name: capoa-bootstrap-controller-manager
12+
namespace: capoa-system

bootstrap/config/rbac/auth_proxy_service.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
apiVersion: v1
22
kind: Service
33
metadata:
4-
name: controller-manager-metrics-service
5-
namespace: system
4+
name: capoa-bootstrap-controller-manager-metrics-service
5+
namespace: capoa-system
66
spec:
77
ports:
88
- name: https

bootstrap/config/rbac/leader_election_role.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
apiVersion: rbac.authorization.k8s.io/v1
33
kind: Role
44
metadata:
5-
name: leader-election-role
5+
name: capoa-bootstrap-leader-election-role
6+
namespace: capoa-system
67
rules:
78
- apiGroups:
89
- ""
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
apiVersion: rbac.authorization.k8s.io/v1
22
kind: RoleBinding
33
metadata:
4-
name: leader-election-rolebinding
4+
name: capoa-bootstrap-leader-election-rolebinding
5+
namespace: capoa-system
56
roleRef:
67
apiGroup: rbac.authorization.k8s.io
78
kind: Role
8-
name: leader-election-role
9+
name: capoa-bootstrap-leader-election-role
910
subjects:
1011
- kind: ServiceAccount
11-
name: controller-manager
12-
namespace: system
12+
name: capoa-bootstrap-controller-manager
13+
namespace: capoa-system

bootstrap/config/rbac/openshiftassistedconfig_editor_role.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
apiVersion: rbac.authorization.k8s.io/v1
33
kind: ClusterRole
44
metadata:
5-
name: openshiftassistedconfig-editor-role
5+
name: capoa-bootstrap-openshiftassistedconfig-editor-role
66
rules:
77
- apiGroups:
88
- bootstrap.cluster.x-k8s.io

bootstrap/config/rbac/openshiftassistedconfig_viewer_role.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
apiVersion: rbac.authorization.k8s.io/v1
33
kind: ClusterRole
44
metadata:
5-
name: openshiftassistedconfig-viewer-role
5+
name: capoa-bootstrap-openshiftassistedconfig-viewer-role
66
rules:
77
- apiGroups:
88
- bootstrap.cluster.x-k8s.io

bootstrap/config/rbac/openshiftassistedconfigtemplate_editor_role.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
apiVersion: rbac.authorization.k8s.io/v1
33
kind: ClusterRole
44
metadata:
5-
name: openshiftassistedconfigtemplate-editor-role
5+
name: capoa-bootstrap-openshiftassistedconfigtemplate-editor-role
66
rules:
77
- apiGroups:
88
- bootstrap.cluster.x-k8s.io

bootstrap/config/rbac/openshiftassistedconfigtemplate_viewer_role.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
apiVersion: rbac.authorization.k8s.io/v1
33
kind: ClusterRole
44
metadata:
5-
name: openshiftassistedconfigtemplate-viewer-role
5+
name: capoa-bootstrap-openshiftassistedconfigtemplate-viewer-role
66
rules:
77
- apiGroups:
88
- bootstrap.cluster.x-k8s.io

bootstrap/config/rbac/role.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
apiVersion: rbac.authorization.k8s.io/v1
33
kind: ClusterRole
44
metadata:
5-
name: manager-role
5+
name: capoa-bootstrap-manager-role
66
rules:
77
- apiGroups:
88
- ""
+4-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
apiVersion: rbac.authorization.k8s.io/v1
22
kind: ClusterRoleBinding
33
metadata:
4-
name: manager-rolebinding
4+
name: capoa-bootstrap-manager-rolebinding
55
roleRef:
66
apiGroup: rbac.authorization.k8s.io
77
kind: ClusterRole
8-
name: manager-role
8+
name: capoa-bootstrap-manager-role
99
subjects:
1010
- kind: ServiceAccount
11-
name: controller-manager
12-
namespace: system
11+
name: capoa-bootstrap-controller-manager
12+
namespace: capoa-system
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
apiVersion: v1
22
kind: ServiceAccount
33
metadata:
4-
name: controller-manager
5-
namespace: system
4+
name: capoa-bootstrap-controller-manager
5+
namespace: capoa-system

0 commit comments

Comments
 (0)