Skip to content

Commit adcb6da

Browse files
committed
fix: ensure resources have unique names
Signed-off-by: Andrew Rynhard <[email protected]>
1 parent 8004bbe commit adcb6da

11 files changed

+75
-65
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ ARG TAG
4040
RUN cd config/manager \
4141
&& kustomize edit set image controller=${REGISTRY_AND_USERNAME}/${NAME}:${TAG} \
4242
&& cd - \
43-
&& kubectl kustomize config >/release.yaml
43+
&& kubectl kustomize config/default >/release.yaml
4444
FROM scratch AS release
4545
COPY --from=release-build /release.yaml /release.yaml
4646

config/default/kustomization.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
14
# Adds namespace to all resources.
2-
namespace: tmp-system
5+
namespace: cabpt-system
36

47
# Value of this field is prepended to the
58
# names of all resources, e.g. a deployment named
69
# "wordpress" becomes "alices-wordpress".
710
# Note that it should also match with the prefix (text before '-') of the namespace
811
# field above.
9-
namePrefix: tmp-
12+
namePrefix: cabpt-
1013

1114
# Labels to add to all resources and selectors.
12-
#commonLabels:
13-
# someName: someValue
15+
commonLabels:
16+
control-plane: cabpt-controller-manager
1417

1518
bases:
1619
- ../crd

config/kustomization.yaml

Lines changed: 0 additions & 9 deletions
This file was deleted.

config/manager/manager.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ spec:
2828
args:
2929
- --enable-leader-election
3030
image: controller:latest
31+
imagePullPolicy: Always
3132
name: manager
3233
resources:
3334
limits:

config/rbac/auth_proxy_role.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
apiVersion: rbac.authorization.k8s.io/v1
22
kind: ClusterRole
33
metadata:
4-
name: proxy-role
4+
name: controller-manager-proxy-role
55
rules:
6-
- apiGroups: ["authentication.k8s.io"]
7-
resources:
8-
- tokenreviews
9-
verbs: ["create"]
10-
- apiGroups: ["authorization.k8s.io"]
11-
resources:
12-
- subjectaccessreviews
13-
verbs: ["create"]
6+
- apiGroups: ['authentication.k8s.io']
7+
resources:
8+
- tokenreviews
9+
verbs: ['create']
10+
- apiGroups: ['authorization.k8s.io']
11+
resources:
12+
- subjectaccessreviews
13+
verbs: ['create']
Lines changed: 5 additions & 5 deletions
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: controller-manager-proxy-rolebinding
55
roleRef:
66
apiGroup: rbac.authorization.k8s.io
77
kind: ClusterRole
8-
name: proxy-role
8+
name: controller-manager-proxy-role
99
subjects:
10-
- kind: ServiceAccount
11-
name: default
12-
namespace: system
10+
- kind: ServiceAccount
11+
name: default
12+
namespace: system

config/rbac/kustomization.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
resources:
22
- role.yaml
3+
- talosconfig_editor_role.yaml
34
- role_binding.yaml
45
- leader_election_role.yaml
56
- leader_election_role_binding.yaml

config/rbac/leader_election_role.yaml

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,31 @@
22
apiVersion: rbac.authorization.k8s.io/v1
33
kind: Role
44
metadata:
5-
name: leader-election-role
5+
name: controller-manager-leader-election-role
66
rules:
7-
- apiGroups:
8-
- ""
9-
resources:
10-
- configmaps
11-
verbs:
12-
- get
13-
- list
14-
- watch
15-
- create
16-
- update
17-
- patch
18-
- delete
19-
- apiGroups:
20-
- ""
21-
resources:
22-
- configmaps/status
23-
verbs:
24-
- get
25-
- update
26-
- patch
27-
- apiGroups:
28-
- ""
29-
resources:
30-
- events
31-
verbs:
32-
- create
7+
- apiGroups:
8+
- ''
9+
resources:
10+
- configmaps
11+
verbs:
12+
- get
13+
- list
14+
- watch
15+
- create
16+
- update
17+
- patch
18+
- delete
19+
- apiGroups:
20+
- ''
21+
resources:
22+
- configmaps/status
23+
verbs:
24+
- get
25+
- update
26+
- patch
27+
- apiGroups:
28+
- ''
29+
resources:
30+
- events
31+
verbs:
32+
- create
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
apiVersion: rbac.authorization.k8s.io/v1
22
kind: RoleBinding
33
metadata:
4-
name: leader-election-rolebinding
4+
name: controller-manager-leader-election-rolebinding
55
roleRef:
66
apiGroup: rbac.authorization.k8s.io
77
kind: Role
8-
name: leader-election-role
8+
name: controller-manager-leader-election-role
99
subjects:
10-
- kind: ServiceAccount
11-
name: default
12-
namespace: system
10+
- kind: ServiceAccount
11+
name: default
12+
namespace: system

config/rbac/role_binding.yaml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,25 @@
11
apiVersion: rbac.authorization.k8s.io/v1
22
kind: ClusterRoleBinding
33
metadata:
4-
name: manager-rolebinding
4+
name: controller-manager-rolebinding
55
roleRef:
66
apiGroup: rbac.authorization.k8s.io
77
kind: ClusterRole
8-
name: manager-role
8+
name: controller-manager-role
99
subjects:
10-
- kind: ServiceAccount
11-
name: default
12-
namespace: system
10+
- kind: ServiceAccount
11+
name: default
12+
namespace: system
13+
---
14+
apiVersion: rbac.authorization.k8s.io/v1
15+
kind: ClusterRoleBinding
16+
metadata:
17+
name: talosconfig-editor-rolebinding
18+
roleRef:
19+
apiGroup: rbac.authorization.k8s.io
20+
kind: ClusterRole
21+
name: talosconfig-editor-role
22+
subjects:
23+
- kind: ServiceAccount
24+
name: default
25+
namespace: system

0 commit comments

Comments
 (0)