Skip to content

Commit 1f098c1

Browse files
committed
cyborg: Add CRD type definitions and webhook validation
Define CRD specs for Cyborg, CyborgAPI and CyborgConductor resources: - Add CyborgSpec with DB, RabbitMQ, Keystone and TLS configuration - Add CyborgAPISpec and CyborgConductorSpec with configSecret, replicas, resources, nodeSelector and TLS fields - Implement defaulting and validation webhooks for all three CRDs - Register CRDs in the operator scheme - Update CRD YAML manifests and CSV for OLM Reconcile and configuration logic will be created in next commits. Assisted-By: Claude Signed-off-by: Alfredo Moralejo <amoralej@redhat.com>
1 parent ef88319 commit 1f098c1

30 files changed

Lines changed: 2954 additions & 58 deletions

api/bases/cyborg.openstack.org_cyborgapis.yaml

Lines changed: 292 additions & 3 deletions
Large diffs are not rendered by default.

api/bases/cyborg.openstack.org_cyborgconductors.yaml

Lines changed: 103 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,110 @@ spec:
3939
spec:
4040
description: CyborgConductorSpec defines the desired state of CyborgConductor.
4141
properties:
42-
foo:
43-
description: Foo is an example field of CyborgConductor. Edit cyborgconductor_types.go
44-
to remove/update
42+
configSecret:
43+
description: ConfigSecret - containing all the configuration needed
44+
provided by Cyborg object
4545
type: string
46+
customServiceConfig:
47+
description: |-
48+
CustomServiceConfig - customize the service config using this parameter to change service defaults,
49+
or overwrite rendered information using raw OpenStack config format. The content gets added to
50+
to /etc/<service>/<service>.conf.d directory as custom.conf file.
51+
type: string
52+
nodeSelector:
53+
additionalProperties:
54+
type: string
55+
description: |-
56+
NodeSelector to target subset of worker nodes running this service. Setting here overrides
57+
any global NodeSelector settings within the Cyborg CR.
58+
type: object
59+
replicas:
60+
default: 1
61+
description: Replicas of the service to run
62+
format: int32
63+
maximum: 32
64+
minimum: 0
65+
type: integer
66+
resources:
67+
description: |-
68+
Resources - Compute Resources required by this service (Limits/Requests).
69+
https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
70+
properties:
71+
claims:
72+
description: |-
73+
Claims lists the names of resources, defined in spec.resourceClaims,
74+
that are used by this container.
75+
76+
This is an alpha field and requires enabling the
77+
DynamicResourceAllocation feature gate.
78+
79+
This field is immutable. It can only be set for containers.
80+
items:
81+
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
82+
properties:
83+
name:
84+
description: |-
85+
Name must match the name of one entry in pod.spec.resourceClaims of
86+
the Pod where this field is used. It makes that resource available
87+
inside a container.
88+
type: string
89+
request:
90+
description: |-
91+
Request is the name chosen for a request in the referenced claim.
92+
If empty, everything from the claim is made available, otherwise
93+
only the result of this request.
94+
type: string
95+
required:
96+
- name
97+
type: object
98+
type: array
99+
x-kubernetes-list-map-keys:
100+
- name
101+
x-kubernetes-list-type: map
102+
limits:
103+
additionalProperties:
104+
anyOf:
105+
- type: integer
106+
- type: string
107+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
108+
x-kubernetes-int-or-string: true
109+
description: |-
110+
Limits describes the maximum amount of compute resources allowed.
111+
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
112+
type: object
113+
requests:
114+
additionalProperties:
115+
anyOf:
116+
- type: integer
117+
- type: string
118+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
119+
x-kubernetes-int-or-string: true
120+
description: |-
121+
Requests describes the minimum amount of compute resources required.
122+
If Requests is omitted for a container, it defaults to Limits if that is explicitly specified,
123+
otherwise to an implementation-defined value. Requests cannot exceed Limits.
124+
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
125+
type: object
126+
type: object
127+
topologyRef:
128+
description: |-
129+
TopologyRef to apply the Topology defined by the associated CR referenced
130+
by name
131+
properties:
132+
name:
133+
description: Name - The Topology CR name that the Service references
134+
type: string
135+
namespace:
136+
description: |-
137+
Namespace - The Namespace to fetch the Topology CR referenced
138+
NOTE: Namespace currently points by default to the same namespace where
139+
the Service is deployed. Customizing the namespace is not supported and
140+
webhooks prevent editing this field to a value different from the
141+
current project
142+
type: string
143+
type: object
144+
required:
145+
- configSecret
46146
type: object
47147
status:
48148
description: CyborgConductorStatus defines the observed state of CyborgConductor.

0 commit comments

Comments
 (0)