Skip to content

Commit f67e6ee

Browse files
committed
Create active development CRDs and RBAC for dev installer and for check-generate.
1 parent 9832d31 commit f67e6ee

12 files changed

+44536
-6
lines changed

Makefile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,7 @@ generate-kuttl: ## Generate kuttl tests
233233
.PHONY: check-generate
234234
check-generate: ## Check everything generated is also committed
235235
check-generate: generate
236-
git diff --exit-code -- config/crd
237-
git diff --exit-code -- config/rbac
236+
git diff --exit-code -- config/dev
238237
git diff --exit-code -- internal/collector
239238
git diff --exit-code -- pkg/apis
240239

@@ -249,7 +248,7 @@ generate: generate-rbac
249248
generate-crd: ## Generate Custom Resource Definitions (CRDs)
250249
$(CONTROLLER) $(\
251250
) crd paths='./pkg/apis/...' $(\
252-
) output:dir='config/crd/bases' # {directory}/{group}_{plural}.yaml
251+
) output:dir='config/dev/crd/bases' # {directory}/{group}_{plural}.yaml
253252
$(GO) generate ./internal/crd
254253

255254
.PHONY: generate-collector
@@ -267,7 +266,7 @@ generate-rbac: ## Generate RBAC
267266
$(CONTROLLER) $(\
268267
) rbac:roleName='postgres-operator' $(\
269268
) paths='./cmd/...' paths='./internal/...' $(\
270-
) output:dir='config/rbac' # {directory}/role.yaml
269+
) output:dir='config/dev/rbac/cluster' # {directory}/role.yaml
271270

272271
# https://www.gnu.org/software/make/manual/make.html#Multi_002dLine
273272
define newline

config/dev/crd/bases/postgres-operator.crunchydata.com_pgadmins.yaml

Lines changed: 3018 additions & 0 deletions
Large diffs are not rendered by default.

config/dev/crd/bases/postgres-operator.crunchydata.com_pgupgrades.yaml

Lines changed: 1226 additions & 0 deletions
Large diffs are not rendered by default.

config/dev/crd/bases/postgres-operator.crunchydata.com_postgresclusters.yaml

Lines changed: 40057 additions & 0 deletions
Large diffs are not rendered by default.

config/dev/crd/kustomization.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
resources:
2+
- bases/postgres-operator.crunchydata.com_pgadmins.yaml
3+
- bases/postgres-operator.crunchydata.com_pgupgrades.yaml
4+
- bases/postgres-operator.crunchydata.com_postgresclusters.yaml

config/dev/kustomization.yaml

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,39 @@
11
apiVersion: kustomize.config.k8s.io/v1beta1
22
kind: Kustomization
33

4+
namespace: postgres-operator
5+
6+
labels:
7+
- includeSelectors: false
8+
includeTemplates: true
9+
pairs:
10+
app.kubernetes.io/name: pgo
11+
app.kubernetes.io/version: 6.0.0
12+
- includeSelectors: true
13+
includeTemplates: true
14+
pairs:
15+
postgres-operator.crunchydata.com/control-plane: postgres-operator
16+
417
resources:
5-
- ../default
18+
- ./crd
19+
- ./rbac/cluster
20+
- ../manager
21+
22+
components:
23+
- ../components/images-by-tag
624

725
patches:
26+
- patch: |-
27+
apiVersion: apps/v1
28+
kind: Deployment
29+
metadata:
30+
name: pgo
31+
spec:
32+
template:
33+
spec:
34+
containers:
35+
- name: operator
36+
env:
37+
- name: PGO_FEATURE_GATES
38+
value: ""
839
- path: manager-dev.yaml
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
resources:
2+
- role_binding.yaml
3+
- role.yaml
4+
- service_account.yaml

config/dev/rbac/cluster/role.yaml

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
---
2+
apiVersion: rbac.authorization.k8s.io/v1
3+
kind: ClusterRole
4+
metadata:
5+
name: postgres-operator
6+
rules:
7+
- apiGroups:
8+
- ""
9+
resources:
10+
- configmaps
11+
- persistentvolumeclaims
12+
- secrets
13+
- serviceaccounts
14+
- services
15+
verbs:
16+
- create
17+
- delete
18+
- get
19+
- list
20+
- patch
21+
- watch
22+
- apiGroups:
23+
- ""
24+
resources:
25+
- endpoints
26+
verbs:
27+
- create
28+
- delete
29+
- deletecollection
30+
- get
31+
- list
32+
- patch
33+
- watch
34+
- apiGroups:
35+
- ""
36+
resources:
37+
- endpoints/restricted
38+
- pods/exec
39+
verbs:
40+
- create
41+
- apiGroups:
42+
- ""
43+
resources:
44+
- events
45+
verbs:
46+
- create
47+
- patch
48+
- apiGroups:
49+
- ""
50+
resources:
51+
- pods
52+
verbs:
53+
- delete
54+
- get
55+
- list
56+
- patch
57+
- watch
58+
- apiGroups:
59+
- apps
60+
resources:
61+
- deployments
62+
- statefulsets
63+
verbs:
64+
- create
65+
- delete
66+
- get
67+
- list
68+
- patch
69+
- watch
70+
- apiGroups:
71+
- authentication.k8s.io
72+
resources:
73+
- tokenreviews
74+
verbs:
75+
- create
76+
- apiGroups:
77+
- authorization.k8s.io
78+
resources:
79+
- subjectaccessreviews
80+
verbs:
81+
- create
82+
- apiGroups:
83+
- batch
84+
resources:
85+
- cronjobs
86+
- jobs
87+
verbs:
88+
- create
89+
- delete
90+
- get
91+
- list
92+
- patch
93+
- watch
94+
- apiGroups:
95+
- coordination.k8s.io
96+
resources:
97+
- leases
98+
verbs:
99+
- create
100+
- get
101+
- update
102+
- watch
103+
- apiGroups:
104+
- policy
105+
resources:
106+
- poddisruptionbudgets
107+
verbs:
108+
- create
109+
- delete
110+
- get
111+
- list
112+
- patch
113+
- watch
114+
- apiGroups:
115+
- postgres-operator.crunchydata.com
116+
resources:
117+
- pgadmins
118+
- pgupgrades
119+
verbs:
120+
- get
121+
- list
122+
- watch
123+
- apiGroups:
124+
- postgres-operator.crunchydata.com
125+
resources:
126+
- pgadmins/finalizers
127+
- pgupgrades/finalizers
128+
- postgresclusters/finalizers
129+
verbs:
130+
- update
131+
- apiGroups:
132+
- postgres-operator.crunchydata.com
133+
resources:
134+
- pgadmins/status
135+
- pgupgrades/status
136+
- postgresclusters/status
137+
verbs:
138+
- patch
139+
- apiGroups:
140+
- postgres-operator.crunchydata.com
141+
resources:
142+
- postgresclusters
143+
verbs:
144+
- get
145+
- list
146+
- patch
147+
- watch
148+
- apiGroups:
149+
- rbac.authorization.k8s.io
150+
resources:
151+
- rolebindings
152+
- roles
153+
verbs:
154+
- create
155+
- delete
156+
- get
157+
- list
158+
- patch
159+
- watch
160+
- apiGroups:
161+
- snapshot.storage.k8s.io
162+
resources:
163+
- volumesnapshots
164+
verbs:
165+
- create
166+
- delete
167+
- get
168+
- list
169+
- patch
170+
- watch
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
apiVersion: rbac.authorization.k8s.io/v1
3+
kind: ClusterRoleBinding
4+
metadata:
5+
name: postgres-operator
6+
roleRef:
7+
apiGroup: rbac.authorization.k8s.io
8+
kind: ClusterRole
9+
name: postgres-operator
10+
subjects:
11+
- kind: ServiceAccount
12+
name: pgo
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
apiVersion: v1
3+
kind: ServiceAccount
4+
metadata:
5+
name: pgo

0 commit comments

Comments
 (0)