Skip to content

Commit 1fe2542

Browse files
committed
[wip]
Jira: OSPRH-17785 Signed-off-by: Martin Schuppert <mschuppert@redhat.com>
1 parent 81d5bc1 commit 1fe2542

5 files changed

Lines changed: 402 additions & 9 deletions

File tree

apis/bases/operator.openstack.org_openstacks.yaml

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,134 @@ spec:
3333
metadata:
3434
type: object
3535
spec:
36+
properties:
37+
serviceOperators:
38+
default:
39+
- name: barbican
40+
- name: cinder
41+
- name: designate
42+
- name: glance
43+
- name: heat
44+
- name: horizon
45+
- name: infra
46+
- name: keystone
47+
- name: manila
48+
- name: mariadb
49+
- name: neutron
50+
- name: nova
51+
- name: octavia
52+
- name: openstack-baremetal
53+
- name: ovn
54+
- name: placement
55+
- name: rabbitmq-cluster
56+
- name: swift
57+
- name: telemetry
58+
- name: test
59+
- name: okr
60+
replicas: 0
61+
items:
62+
properties:
63+
controllerManager:
64+
default:
65+
limits:
66+
cpu: 500m
67+
memory: 128Mi
68+
requests:
69+
cpu: 10m
70+
memory: 256Mi
71+
properties:
72+
resources:
73+
properties:
74+
claims:
75+
items:
76+
properties:
77+
name:
78+
type: string
79+
required:
80+
- name
81+
type: object
82+
type: array
83+
x-kubernetes-list-map-keys:
84+
- name
85+
x-kubernetes-list-type: map
86+
limits:
87+
additionalProperties:
88+
anyOf:
89+
- type: integer
90+
- type: string
91+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
92+
x-kubernetes-int-or-string: true
93+
type: object
94+
requests:
95+
additionalProperties:
96+
anyOf:
97+
- type: integer
98+
- type: string
99+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
100+
x-kubernetes-int-or-string: true
101+
type: object
102+
type: object
103+
type: object
104+
kubeRbacProxy:
105+
default:
106+
limits:
107+
cpu: 500m
108+
memory: 128Mi
109+
requests:
110+
cpu: 5m
111+
memory: 64Mi
112+
properties:
113+
resources:
114+
properties:
115+
claims:
116+
items:
117+
properties:
118+
name:
119+
type: string
120+
required:
121+
- name
122+
type: object
123+
type: array
124+
x-kubernetes-list-map-keys:
125+
- name
126+
x-kubernetes-list-type: map
127+
limits:
128+
additionalProperties:
129+
anyOf:
130+
- type: integer
131+
- type: string
132+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
133+
x-kubernetes-int-or-string: true
134+
type: object
135+
requests:
136+
additionalProperties:
137+
anyOf:
138+
- type: integer
139+
- type: string
140+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
141+
x-kubernetes-int-or-string: true
142+
type: object
143+
type: object
144+
type: object
145+
name:
146+
minLength: 1
147+
type: string
148+
replicas:
149+
default: 1
150+
format: int32
151+
maximum: 1
152+
minimum: 0
153+
type: integer
154+
required:
155+
- name
156+
type: object
157+
type: array
158+
x-kubernetes-list-map-keys:
159+
- name
160+
x-kubernetes-list-type: map
161+
x-kubernetes-validations:
162+
- message: names in ServiceOperators must be unique
163+
rule: self.all(x, self.filter(y, y.name == x.name).size() == 1)
36164
type: object
37165
status:
38166
properties:

apis/operator/v1beta1/openstack_types.go

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,110 @@ package v1beta1
1818

1919
import (
2020
condition "github.com/openstack-k8s-operators/lib-common/modules/common/condition"
21+
corev1 "k8s.io/api/core/v1"
2122
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2223
)
2324

25+
const (
26+
BarbicanOperatorName = "barbican"
27+
CinderOperatorName = "cinder"
28+
DesignateOperatorName = "designate"
29+
GlanceOperatorName = "glance"
30+
HeatOperatorName = "heat"
31+
HorizonOperatorName = "horizon"
32+
InfraOperatorName = "infra"
33+
IronicOperatorName = "ironic"
34+
KeystoneOperatorName = "keystone"
35+
ManilaOperatorName = "manila"
36+
MariaDBOperatorName = "mariadb"
37+
NeutronOperatorName = "neutron"
38+
NovaOperatorName = "nova"
39+
OctaviaOperatorName = "octavia"
40+
OpenStackBaremetalOperatorName = "openstack-baremetal"
41+
OvnOperatorName = "ovn"
42+
PlacementOperatorName = "placement"
43+
RabbitMQOperatorName = "rabbitmq-cluster"
44+
SwiftOperatorName = "swift"
45+
TelemetryOperatorName = "telemetry"
46+
TestOperatorName = "test"
47+
OkrOperatorName = "okr"
48+
)
49+
50+
// NOTE: test-operator was deployed as a independant package so it may or may not be installed
51+
// NOTE: depending on how watcher-operator is released for FR2 and then in FR3 it may need to be
52+
// added into this list in the future
53+
// IMPORTANT: have this list in synce with the kubebuilder annotations of the ServiceOperators parameter
54+
var (
55+
ServiceOperatorNames []string = []string{
56+
BarbicanOperatorName,
57+
CinderOperatorName,
58+
DesignateOperatorName,
59+
GlanceOperatorName,
60+
HeatOperatorName,
61+
HorizonOperatorName,
62+
InfraOperatorName,
63+
IronicOperatorName,
64+
KeystoneOperatorName,
65+
ManilaOperatorName,
66+
MariaDBOperatorName,
67+
NeutronOperatorName,
68+
NovaOperatorName,
69+
OctaviaOperatorName,
70+
OpenStackBaremetalOperatorName,
71+
OvnOperatorName,
72+
PlacementOperatorName,
73+
RabbitMQOperatorName,
74+
SwiftOperatorName,
75+
TelemetryOperatorName,
76+
TestOperatorName,
77+
OkrOperatorName,
78+
}
79+
)
80+
2481
// OpenStackSpec defines the desired state of OpenStack
2582
type OpenStackSpec struct {
83+
// +kubebuilder:validation:Optional
84+
// +listType=map
85+
// +listMapKey=name
86+
// +kubebuilder:validation:XValidation:rule="self.all(x, self.filter(y, y.name == x.name).size() == 1)",message="names in ServiceOperators must be unique"
87+
// +kubebuilder:default={{name: barbican}, {name: cinder}, {name: designate}, {name: glance}, {name: heat}, {name: horizon}, {name: infra}, {name: keystone}, {name: manila}, {name: mariadb}, {name: neutron}, {name: nova}, {name: octavia}, {name: openstack-baremetal}, {name: ovn}, {name: placement}, {name: rabbitmq-cluster}, {name: swift}, {name: telemetry}, {name: test}, {name: okr, replicas: 0}}
88+
// ServiceOperators - list of service operators to deploy with tunings
89+
// NOTE: test-operator was deployed as a independant package so it may or may not be installed
90+
// NOTE: depending on how watcher-operator is released for FR2 and then in FR3 it may need to be
91+
// added into this list in the future
92+
ServiceOperators []OperatorSpec `json:"serviceOperators"`
93+
}
94+
95+
// OperatorSpec - customization for the operator deployment
96+
type OperatorSpec struct {
97+
// +kubebuilder:validation:Required
98+
// +kubebuilder:validation:MinLength=1
99+
// Name of the service operators.
100+
Name string `json:"name"`
101+
// +kubebuilder:validation:Optional
102+
// +kubebuilder:default=1
103+
// +kubebuilder:validation:Maximum=1
104+
// +kubebuilder:validation:Minimum=0
105+
// Replicas of the operator deployment
106+
Replicas *int32 `json:"replicas"`
107+
108+
// +kubebuilder:validation:Optional
109+
// +kubebuilder:default={limits: {cpu: "500m", memory: "128Mi"},requests: {cpu: "10m", memory: "256Mi"}}
110+
// ControllerManager - tunings for the controller manager container
111+
ControllerManager ContainerSpec `json:"controllerManager"`
112+
113+
// +kubebuilder:validation:Optional
114+
// +kubebuilder:default={limits: {cpu: "500m", memory: "128Mi"},requests: {cpu: "5m", memory: "64Mi"}}
115+
// ControllerManager - tunings for the kube-rbac-proxy container
116+
KubeRbacProxy ContainerSpec `json:"kubeRbacProxy"`
117+
}
118+
119+
// ContainerSpec - customizion for the container spec
120+
type ContainerSpec struct {
121+
// +kubebuilder:validation:Optional
122+
// Resources - Compute Resources for the service operator controller manager
123+
// https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
124+
Resources corev1.ResourceRequirements `json:"resources,omitempty"`
26125
}
27126

28127
// OpenStackStatus defines the observed state of OpenStack

apis/operator/v1beta1/zz_generated.deepcopy.go

Lines changed: 46 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)