Skip to content

Commit b0c00fc

Browse files
committed
Create active development CRDs and RBAC for dev installer and for check-generate.
1 parent 71bd415 commit b0c00fc

14 files changed

+23157
-47
lines changed

Makefile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,7 @@ generate-kuttl: ## Generate kuttl tests
261261
.PHONY: check-generate
262262
check-generate: ## Check everything generated is also committed
263263
check-generate: generate
264-
git diff --exit-code -- config/crd
265-
git diff --exit-code -- config/rbac
264+
git diff --exit-code -- config/dev
266265
git diff --exit-code -- internal/collector
267266
git diff --exit-code -- pkg/apis
268267

@@ -279,7 +278,7 @@ generate-crd: tools/controller-gen
279278
$(CONTROLLER) \
280279
crd:crdVersions='v1' \
281280
paths='./pkg/apis/...' \
282-
output:dir='config/crd/bases' # {directory}/{group}_{plural}.yaml
281+
output:dir='config/dev/crd/bases' # {directory}/{group}_{plural}.yaml
283282

284283
.PHONY: generate-collector
285284
generate-collector: ## Generate OTel Collector files
@@ -298,7 +297,7 @@ generate-rbac: tools/controller-gen
298297
$(CONTROLLER) \
299298
rbac:roleName='postgres-operator' \
300299
paths='./cmd/...' paths='./internal/...' \
301-
output:dir='config/rbac' # {directory}/role.yaml
300+
output:dir='config/dev/rbac/cluster' # {directory}/role.yaml
302301

303302
##@ Tools
304303

config/LICENSE.txt

Lines changed: 0 additions & 43 deletions
This file was deleted.
Lines changed: 291 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,291 @@
1+
---
2+
apiVersion: apiextensions.k8s.io/v1
3+
kind: CustomResourceDefinition
4+
metadata:
5+
annotations:
6+
controller-gen.kubebuilder.io/version: v0.17.2
7+
name: crunchybridgeclusters.postgres-operator.crunchydata.com
8+
spec:
9+
group: postgres-operator.crunchydata.com
10+
names:
11+
kind: CrunchyBridgeCluster
12+
listKind: CrunchyBridgeClusterList
13+
plural: crunchybridgeclusters
14+
singular: crunchybridgecluster
15+
scope: Namespaced
16+
versions:
17+
- name: v1beta1
18+
schema:
19+
openAPIV3Schema:
20+
description: CrunchyBridgeCluster is the Schema for the crunchybridgeclusters
21+
API
22+
properties:
23+
apiVersion:
24+
description: |-
25+
APIVersion defines the versioned schema of this representation of an object.
26+
Servers should convert recognized schemas to the latest internal value, and
27+
may reject unrecognized values.
28+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
29+
type: string
30+
kind:
31+
description: |-
32+
Kind is a string value representing the REST resource this object represents.
33+
Servers may infer this from the endpoint the client submits requests to.
34+
Cannot be updated.
35+
In CamelCase.
36+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
37+
type: string
38+
metadata:
39+
type: object
40+
spec:
41+
description: |-
42+
CrunchyBridgeClusterSpec defines the desired state of CrunchyBridgeCluster
43+
to be managed by Crunchy Data Bridge
44+
properties:
45+
clusterName:
46+
description: The name of the cluster
47+
maxLength: 50
48+
minLength: 5
49+
pattern: ^[A-Za-z][A-Za-z0-9\-_ ]*[A-Za-z0-9]$
50+
type: string
51+
isHa:
52+
description: |-
53+
Whether the cluster is high availability,
54+
meaning that it has a secondary it can fail over to quickly
55+
in case the primary becomes unavailable.
56+
type: boolean
57+
isProtected:
58+
description: |-
59+
Whether the cluster is protected. Protected clusters can't be destroyed until
60+
their protected flag is removed
61+
type: boolean
62+
majorVersion:
63+
description: |-
64+
The ID of the cluster's major Postgres version.
65+
Currently Bridge offers 13-17
66+
maximum: 17
67+
minimum: 13
68+
type: integer
69+
metadata:
70+
description: Metadata contains metadata for custom resources
71+
properties:
72+
annotations:
73+
additionalProperties:
74+
type: string
75+
type: object
76+
labels:
77+
additionalProperties:
78+
type: string
79+
type: object
80+
type: object
81+
plan:
82+
description: The ID of the cluster's plan. Determines instance, CPU,
83+
and memory.
84+
type: string
85+
provider:
86+
description: |-
87+
The cloud provider where the cluster is located.
88+
Currently Bridge offers aws, azure, and gcp only
89+
enum:
90+
- aws
91+
- azure
92+
- gcp
93+
maxLength: 10
94+
type: string
95+
x-kubernetes-validations:
96+
- message: immutable
97+
rule: self == oldSelf
98+
region:
99+
description: The provider region where the cluster is located.
100+
type: string
101+
x-kubernetes-validations:
102+
- message: immutable
103+
rule: self == oldSelf
104+
roles:
105+
description: |-
106+
Roles for which to create Secrets that contain their credentials which
107+
are retrieved from the Bridge API. An empty list creates no role secrets.
108+
Removing a role from this list does NOT drop the role nor revoke their
109+
access, but it will delete that role's secret from the kube cluster.
110+
items:
111+
properties:
112+
name:
113+
description: |-
114+
Name of the role within Crunchy Bridge.
115+
More info: https://docs.crunchybridge.com/concepts/users
116+
type: string
117+
secretName:
118+
description: The name of the Secret that will hold the role
119+
credentials.
120+
maxLength: 253
121+
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
122+
type: string
123+
required:
124+
- name
125+
- secretName
126+
type: object
127+
type: array
128+
x-kubernetes-list-map-keys:
129+
- name
130+
x-kubernetes-list-type: map
131+
secret:
132+
description: The name of the secret containing the API key and team
133+
id
134+
type: string
135+
storage:
136+
anyOf:
137+
- type: integer
138+
- type: string
139+
description: |-
140+
The amount of storage available to the cluster in gigabytes.
141+
The amount must be an integer, followed by Gi (gibibytes) or G (gigabytes) to match Kubernetes conventions.
142+
If the amount is given in Gi, we round to the nearest G value.
143+
The minimum value allowed by Bridge is 10 GB.
144+
The maximum value allowed by Bridge is 65535 GB.
145+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
146+
x-kubernetes-int-or-string: true
147+
required:
148+
- clusterName
149+
- isHa
150+
- majorVersion
151+
- plan
152+
- provider
153+
- region
154+
- secret
155+
- storage
156+
type: object
157+
status:
158+
description: CrunchyBridgeClusterStatus defines the observed state of
159+
CrunchyBridgeCluster
160+
properties:
161+
conditions:
162+
description: conditions represent the observations of postgres cluster's
163+
current state.
164+
items:
165+
description: Condition contains details for one aspect of the current
166+
state of this API Resource.
167+
properties:
168+
lastTransitionTime:
169+
description: |-
170+
lastTransitionTime is the last time the condition transitioned from one status to another.
171+
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
172+
format: date-time
173+
type: string
174+
message:
175+
description: |-
176+
message is a human readable message indicating details about the transition.
177+
This may be an empty string.
178+
maxLength: 32768
179+
type: string
180+
observedGeneration:
181+
description: |-
182+
observedGeneration represents the .metadata.generation that the condition was set based upon.
183+
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
184+
with respect to the current state of the instance.
185+
format: int64
186+
minimum: 0
187+
type: integer
188+
reason:
189+
description: |-
190+
reason contains a programmatic identifier indicating the reason for the condition's last transition.
191+
Producers of specific condition types may define expected values and meanings for this field,
192+
and whether the values are considered a guaranteed API.
193+
The value should be a CamelCase string.
194+
This field may not be empty.
195+
maxLength: 1024
196+
minLength: 1
197+
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
198+
type: string
199+
status:
200+
description: status of the condition, one of True, False, Unknown.
201+
enum:
202+
- "True"
203+
- "False"
204+
- Unknown
205+
type: string
206+
type:
207+
description: type of condition in CamelCase or in foo.example.com/CamelCase.
208+
maxLength: 316
209+
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
210+
type: string
211+
required:
212+
- lastTransitionTime
213+
- message
214+
- reason
215+
- status
216+
- type
217+
type: object
218+
type: array
219+
x-kubernetes-list-map-keys:
220+
- type
221+
x-kubernetes-list-type: map
222+
host:
223+
description: The Hostname of the postgres cluster in Bridge, provided
224+
by Bridge API and null until then.
225+
type: string
226+
id:
227+
description: The ID of the postgres cluster in Bridge, provided by
228+
Bridge API and null until then.
229+
type: string
230+
isHa:
231+
description: |-
232+
Whether the cluster is high availability, meaning that it has a secondary it can fail
233+
over to quickly in case the primary becomes unavailable.
234+
type: boolean
235+
isProtected:
236+
description: |-
237+
Whether the cluster is protected. Protected clusters can't be destroyed until
238+
their protected flag is removed
239+
type: boolean
240+
majorVersion:
241+
description: The cluster's major Postgres version.
242+
type: integer
243+
name:
244+
description: The name of the cluster in Bridge.
245+
type: string
246+
observedGeneration:
247+
description: observedGeneration represents the .metadata.generation
248+
on which the status was based.
249+
format: int64
250+
minimum: 0
251+
type: integer
252+
ongoingUpgrade:
253+
description: The cluster upgrade as represented by Bridge
254+
items:
255+
properties:
256+
flavor:
257+
type: string
258+
starting_from:
259+
type: string
260+
state:
261+
type: string
262+
required:
263+
- flavor
264+
- starting_from
265+
- state
266+
type: object
267+
type: array
268+
plan:
269+
description: The ID of the cluster's plan. Determines instance, CPU,
270+
and memory.
271+
type: string
272+
responses:
273+
description: Most recent, raw responses from Bridge API
274+
type: object
275+
x-kubernetes-preserve-unknown-fields: true
276+
state:
277+
description: State of cluster in Bridge.
278+
type: string
279+
storage:
280+
anyOf:
281+
- type: integer
282+
- type: string
283+
description: The amount of storage available to the cluster.
284+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
285+
x-kubernetes-int-or-string: true
286+
type: object
287+
type: object
288+
served: true
289+
storage: true
290+
subresources:
291+
status: {}

0 commit comments

Comments
 (0)