Skip to content

Commit 84ea530

Browse files
committed
Fix up resources
- Remove unnecessary labels on resources - Rename namePrefix and namespace to match the repo rename - Ensure labels and selectors are unique to the provider (for when they run in the same namespace)
1 parent f834751 commit 84ea530

28 files changed

+12
-266
lines changed

Diff for: bootstrap/config/default/kustomization.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Adds namespace to all resources.
2-
namespace: capi-agent-bootstrap-system
2+
namespace: capoa-bootstrap-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: capi-agent-bootstrap
9+
namePrefix: capoa-bootstrap-
1010

1111
# Labels to add to all resources and selectors.
1212
#labels:

Diff for: bootstrap/config/manager/manager.yaml

+2-47
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,27 @@
11
apiVersion: v1
22
kind: Namespace
33
metadata:
4-
labels:
5-
control-plane: controller-manager
6-
app.kubernetes.io/name: namespace
7-
app.kubernetes.io/instance: system
8-
app.kubernetes.io/component: manager
9-
app.kubernetes.io/created-by: cluster-api-agent
10-
app.kubernetes.io/part-of: cluster-api-agent
11-
app.kubernetes.io/managed-by: kustomize
124
name: system
135
---
146
apiVersion: apps/v1
157
kind: Deployment
168
metadata:
179
name: controller-manager
1810
namespace: system
19-
labels:
20-
control-plane: controller-manager
21-
app.kubernetes.io/name: deployment
22-
app.kubernetes.io/instance: controller-manager
23-
app.kubernetes.io/component: manager
24-
app.kubernetes.io/created-by: cluster-api-agent
25-
app.kubernetes.io/part-of: cluster-api-agent
26-
app.kubernetes.io/managed-by: kustomize
2711
spec:
2812
selector:
2913
matchLabels:
30-
control-plane: controller-manager
14+
control-plane: capoa-bootstrap-controller-manager
3115
replicas: 1
3216
template:
3317
metadata:
3418
annotations:
3519
kubectl.kubernetes.io/default-container: manager
3620
labels:
37-
control-plane: controller-manager
21+
control-plane: capoa-bootstrap-controller-manager
3822
spec:
39-
# TODO(user): Uncomment the following code to configure the nodeAffinity expression
40-
# according to the platforms which are supported by your solution.
41-
# It is considered best practice to support multiple architectures. You can
42-
# build your manager image using the makefile target docker-buildx.
43-
# affinity:
44-
# nodeAffinity:
45-
# requiredDuringSchedulingIgnoredDuringExecution:
46-
# nodeSelectorTerms:
47-
# - matchExpressions:
48-
# - key: kubernetes.io/arch
49-
# operator: In
50-
# values:
51-
# - amd64
52-
# - arm64
53-
# - ppc64le
54-
# - s390x
55-
# - key: kubernetes.io/os
56-
# operator: In
57-
# values:
58-
# - linux
5923
securityContext:
6024
runAsNonRoot: true
61-
# TODO(user): For common cases that do not require escalating privileges
62-
# it is recommended to ensure that all your Pods/Containers are restrictive.
63-
# More info: https://kubernetes.io/docs/concepts/security/pod-security-standards/#restricted
64-
# Please uncomment the following code if your project does NOT have to work on old Kubernetes
65-
# versions < 1.19 or on vendors versions which do NOT support this field by default (i.e. Openshift < 4.11 ).
66-
# seccompProfile:
67-
# type: RuntimeDefault
6825
containers:
6926
- command:
7027
- /manager
@@ -95,8 +52,6 @@ spec:
9552
port: 8081
9653
initialDelaySeconds: 5
9754
periodSeconds: 10
98-
# TODO(user): Configure the resources accordingly based on the project requirements.
99-
# More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
10055
resources:
10156
limits:
10257
cpu: 500m

Diff for: bootstrap/config/prometheus/monitor.yaml

+1-9
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,6 @@
22
apiVersion: monitoring.coreos.com/v1
33
kind: ServiceMonitor
44
metadata:
5-
labels:
6-
control-plane: controller-manager
7-
app.kubernetes.io/name: servicemonitor
8-
app.kubernetes.io/instance: controller-manager-metrics-monitor
9-
app.kubernetes.io/component: metrics
10-
app.kubernetes.io/created-by: cluster-api-agent
11-
app.kubernetes.io/part-of: cluster-api-agent
12-
app.kubernetes.io/managed-by: kustomize
135
name: controller-manager-metrics-monitor
146
namespace: system
157
spec:
@@ -22,4 +14,4 @@ spec:
2214
insecureSkipVerify: true
2315
selector:
2416
matchLabels:
25-
control-plane: controller-manager
17+
control-plane: capoa-bootstrap-controller-manager

Diff for: bootstrap/config/rbac/auth_proxy_client_clusterrole.yaml

-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
apiVersion: rbac.authorization.k8s.io/v1
22
kind: ClusterRole
33
metadata:
4-
labels:
5-
app.kubernetes.io/name: clusterrole
6-
app.kubernetes.io/instance: metrics-reader
7-
app.kubernetes.io/component: kube-rbac-proxy
8-
app.kubernetes.io/created-by: cluster-api-agent
9-
app.kubernetes.io/part-of: cluster-api-agent
10-
app.kubernetes.io/managed-by: kustomize
114
name: metrics-reader
125
rules:
136
- nonResourceURLs:

Diff for: bootstrap/config/rbac/auth_proxy_role.yaml

-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
apiVersion: rbac.authorization.k8s.io/v1
22
kind: ClusterRole
33
metadata:
4-
labels:
5-
app.kubernetes.io/name: clusterrole
6-
app.kubernetes.io/instance: proxy-role
7-
app.kubernetes.io/component: kube-rbac-proxy
8-
app.kubernetes.io/created-by: cluster-api-agent
9-
app.kubernetes.io/part-of: cluster-api-agent
10-
app.kubernetes.io/managed-by: kustomize
114
name: proxy-role
125
rules:
136
- apiGroups:

Diff for: bootstrap/config/rbac/auth_proxy_role_binding.yaml

-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
apiVersion: rbac.authorization.k8s.io/v1
22
kind: ClusterRoleBinding
33
metadata:
4-
labels:
5-
app.kubernetes.io/name: clusterrolebinding
6-
app.kubernetes.io/instance: proxy-rolebinding
7-
app.kubernetes.io/component: kube-rbac-proxy
8-
app.kubernetes.io/created-by: cluster-api-agent
9-
app.kubernetes.io/part-of: cluster-api-agent
10-
app.kubernetes.io/managed-by: kustomize
114
name: proxy-rolebinding
125
roleRef:
136
apiGroup: rbac.authorization.k8s.io

Diff for: bootstrap/config/rbac/auth_proxy_service.yaml

+1-9
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
apiVersion: v1
22
kind: Service
33
metadata:
4-
labels:
5-
control-plane: controller-manager
6-
app.kubernetes.io/name: service
7-
app.kubernetes.io/instance: controller-manager-metrics-service
8-
app.kubernetes.io/component: kube-rbac-proxy
9-
app.kubernetes.io/created-by: cluster-api-agent
10-
app.kubernetes.io/part-of: cluster-api-agent
11-
app.kubernetes.io/managed-by: kustomize
124
name: controller-manager-metrics-service
135
namespace: system
146
spec:
@@ -18,4 +10,4 @@ spec:
1810
protocol: TCP
1911
targetPort: https
2012
selector:
21-
control-plane: controller-manager
13+
control-plane: capoa-bootstrap-controller-manager

Diff for: bootstrap/config/rbac/leader_election_role.yaml

-7
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,6 @@
22
apiVersion: rbac.authorization.k8s.io/v1
33
kind: Role
44
metadata:
5-
labels:
6-
app.kubernetes.io/name: role
7-
app.kubernetes.io/instance: leader-election-role
8-
app.kubernetes.io/component: rbac
9-
app.kubernetes.io/created-by: cluster-api-agent
10-
app.kubernetes.io/part-of: cluster-api-agent
11-
app.kubernetes.io/managed-by: kustomize
125
name: leader-election-role
136
rules:
147
- apiGroups:

Diff for: bootstrap/config/rbac/leader_election_role_binding.yaml

-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
apiVersion: rbac.authorization.k8s.io/v1
22
kind: RoleBinding
33
metadata:
4-
labels:
5-
app.kubernetes.io/name: rolebinding
6-
app.kubernetes.io/instance: leader-election-rolebinding
7-
app.kubernetes.io/component: rbac
8-
app.kubernetes.io/created-by: cluster-api-agent
9-
app.kubernetes.io/part-of: cluster-api-agent
10-
app.kubernetes.io/managed-by: kustomize
114
name: leader-election-rolebinding
125
roleRef:
136
apiGroup: rbac.authorization.k8s.io

Diff for: bootstrap/config/rbac/openshiftassistedconfig_editor_role.yaml

-7
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,6 @@
22
apiVersion: rbac.authorization.k8s.io/v1
33
kind: ClusterRole
44
metadata:
5-
labels:
6-
app.kubernetes.io/name: clusterrole
7-
app.kubernetes.io/instance: openshiftassistedconfig-editor-role
8-
app.kubernetes.io/component: rbac
9-
app.kubernetes.io/created-by: cluster-api-agent
10-
app.kubernetes.io/part-of: cluster-api-agent
11-
app.kubernetes.io/managed-by: kustomize
125
name: openshiftassistedconfig-editor-role
136
rules:
147
- apiGroups:

Diff for: bootstrap/config/rbac/openshiftassistedconfig_viewer_role.yaml

-7
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,6 @@
22
apiVersion: rbac.authorization.k8s.io/v1
33
kind: ClusterRole
44
metadata:
5-
labels:
6-
app.kubernetes.io/name: clusterrole
7-
app.kubernetes.io/instance: openshiftassistedconfig-viewer-role
8-
app.kubernetes.io/component: rbac
9-
app.kubernetes.io/created-by: cluster-api-agent
10-
app.kubernetes.io/part-of: cluster-api-agent
11-
app.kubernetes.io/managed-by: kustomize
125
name: openshiftassistedconfig-viewer-role
136
rules:
147
- apiGroups:

Diff for: bootstrap/config/rbac/openshiftassistedconfigtemplate_editor_role.yaml

-7
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,6 @@
22
apiVersion: rbac.authorization.k8s.io/v1
33
kind: ClusterRole
44
metadata:
5-
labels:
6-
app.kubernetes.io/name: clusterrole
7-
app.kubernetes.io/instance: openshiftassistedconfigtemplate-editor-role
8-
app.kubernetes.io/component: rbac
9-
app.kubernetes.io/created-by: cluster-api-agent
10-
app.kubernetes.io/part-of: cluster-api-agent
11-
app.kubernetes.io/managed-by: kustomize
125
name: openshiftassistedconfigtemplate-editor-role
136
rules:
147
- apiGroups:

Diff for: bootstrap/config/rbac/openshiftassistedconfigtemplate_viewer_role.yaml

-7
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,6 @@
22
apiVersion: rbac.authorization.k8s.io/v1
33
kind: ClusterRole
44
metadata:
5-
labels:
6-
app.kubernetes.io/name: clusterrole
7-
app.kubernetes.io/instance: openshiftassistedconfigtemplate-viewer-role
8-
app.kubernetes.io/component: rbac
9-
app.kubernetes.io/created-by: cluster-api-agent
10-
app.kubernetes.io/part-of: cluster-api-agent
11-
app.kubernetes.io/managed-by: kustomize
125
name: openshiftassistedconfigtemplate-viewer-role
136
rules:
147
- apiGroups:

Diff for: bootstrap/config/rbac/role_binding.yaml

-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
apiVersion: rbac.authorization.k8s.io/v1
22
kind: ClusterRoleBinding
33
metadata:
4-
labels:
5-
app.kubernetes.io/name: clusterrolebinding
6-
app.kubernetes.io/instance: manager-rolebinding
7-
app.kubernetes.io/component: rbac
8-
app.kubernetes.io/created-by: cluster-api-agent
9-
app.kubernetes.io/part-of: cluster-api-agent
10-
app.kubernetes.io/managed-by: kustomize
114
name: manager-rolebinding
125
roleRef:
136
apiGroup: rbac.authorization.k8s.io

Diff for: bootstrap/config/rbac/service_account.yaml

-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
apiVersion: v1
22
kind: ServiceAccount
33
metadata:
4-
labels:
5-
app.kubernetes.io/name: cluster-api-agent
6-
app.kubernetes.io/managed-by: kustomize
74
name: controller-manager
85
namespace: system

Diff for: controlplane/config/default/kustomization.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Adds namespace to all resources.
2-
namespace: capi-agent-controlplane-system
2+
namespace: capoa-controlplane-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: capi-agent-controlplane
9+
namePrefix: capoa-controlplane-
1010

1111
# Labels to add to all resources and selectors.
1212
#labels:

Diff for: controlplane/config/manager/manager.yaml

+2-47
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,27 @@
11
apiVersion: v1
22
kind: Namespace
33
metadata:
4-
labels:
5-
control-plane: controller-manager
6-
app.kubernetes.io/name: namespace
7-
app.kubernetes.io/instance: system
8-
app.kubernetes.io/component: manager
9-
app.kubernetes.io/created-by: cluster-api-agent
10-
app.kubernetes.io/part-of: cluster-api-agent
11-
app.kubernetes.io/managed-by: kustomize
124
name: system
135
---
146
apiVersion: apps/v1
157
kind: Deployment
168
metadata:
179
name: controller-manager
1810
namespace: system
19-
labels:
20-
control-plane: controller-manager
21-
app.kubernetes.io/name: deployment
22-
app.kubernetes.io/instance: controller-manager
23-
app.kubernetes.io/component: manager
24-
app.kubernetes.io/created-by: cluster-api-agent
25-
app.kubernetes.io/part-of: cluster-api-agent
26-
app.kubernetes.io/managed-by: kustomize
2711
spec:
2812
selector:
2913
matchLabels:
30-
control-plane: controller-manager
14+
control-plane: capoa-controlplane-controller-manager
3115
replicas: 1
3216
template:
3317
metadata:
3418
annotations:
3519
kubectl.kubernetes.io/default-container: manager
3620
labels:
37-
control-plane: controller-manager
21+
control-plane: capoa-controlplane-controller-manager
3822
spec:
39-
# TODO(user): Uncomment the following code to configure the nodeAffinity expression
40-
# according to the platforms which are supported by your solution.
41-
# It is considered best practice to support multiple architectures. You can
42-
# build your manager image using the makefile target docker-buildx.
43-
# affinity:
44-
# nodeAffinity:
45-
# requiredDuringSchedulingIgnoredDuringExecution:
46-
# nodeSelectorTerms:
47-
# - matchExpressions:
48-
# - key: kubernetes.io/arch
49-
# operator: In
50-
# values:
51-
# - amd64
52-
# - arm64
53-
# - ppc64le
54-
# - s390x
55-
# - key: kubernetes.io/os
56-
# operator: In
57-
# values:
58-
# - linux
5923
securityContext:
6024
runAsNonRoot: true
61-
# TODO(user): For common cases that do not require escalating privileges
62-
# it is recommended to ensure that all your Pods/Containers are restrictive.
63-
# More info: https://kubernetes.io/docs/concepts/security/pod-security-standards/#restricted
64-
# Please uncomment the following code if your project does NOT have to work on old Kubernetes
65-
# versions < 1.19 or on vendors versions which do NOT support this field by default (i.e. Openshift < 4.11 ).
66-
# seccompProfile:
67-
# type: RuntimeDefault
6825
containers:
6926
- command:
7027
- /manager
@@ -90,8 +47,6 @@ spec:
9047
port: 8081
9148
initialDelaySeconds: 5
9249
periodSeconds: 10
93-
# TODO(user): Configure the resources accordingly based on the project requirements.
94-
# More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
9550
resources:
9651
limits:
9752
cpu: 500m

0 commit comments

Comments
 (0)