Skip to content

Commit 05402ab

Browse files
committed
update
1 parent 1fe2542 commit 05402ab

6 files changed

Lines changed: 365 additions & 225 deletions

File tree

apis/bases/operator.openstack.org_openstacks.yaml

Lines changed: 35 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -35,39 +35,17 @@ spec:
3535
spec:
3636
properties:
3737
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
6138
items:
6239
properties:
6340
controllerManager:
6441
default:
65-
limits:
66-
cpu: 500m
67-
memory: 128Mi
68-
requests:
69-
cpu: 10m
70-
memory: 256Mi
42+
resources:
43+
limits:
44+
cpu: 500m
45+
memory: 256Mi
46+
requests:
47+
cpu: 10m
48+
memory: 128Mi
7149
properties:
7250
resources:
7351
properties:
@@ -103,12 +81,13 @@ spec:
10381
type: object
10482
kubeRbacProxy:
10583
default:
106-
limits:
107-
cpu: 500m
108-
memory: 128Mi
109-
requests:
110-
cpu: 5m
111-
memory: 64Mi
84+
resources:
85+
limits:
86+
cpu: 500m
87+
memory: 128Mi
88+
requests:
89+
cpu: 5m
90+
memory: 64Mi
11291
properties:
11392
resources:
11493
properties:
@@ -143,6 +122,27 @@ spec:
143122
type: object
144123
type: object
145124
name:
125+
enum:
126+
- barbican
127+
- cinder
128+
- designate
129+
- glance
130+
- heat
131+
- horizon
132+
- infra
133+
- keystone
134+
- manila
135+
- mariadb
136+
- neutron
137+
- nova
138+
- octavia
139+
- openstack-baremetal
140+
- ovn
141+
- placement
142+
- rabbitmq-cluster
143+
- swift
144+
- telemetry
145+
- test
146146
minLength: 1
147147
type: string
148148
replicas:
@@ -158,9 +158,6 @@ spec:
158158
x-kubernetes-list-map-keys:
159159
- name
160160
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)
164161
type: object
165162
status:
166163
properties:

apis/operator/v1beta1/openstack_types.go

Lines changed: 100 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -19,62 +19,113 @@ package v1beta1
1919
import (
2020
condition "github.com/openstack-k8s-operators/lib-common/modules/common/condition"
2121
corev1 "k8s.io/api/core/v1"
22+
"k8s.io/apimachinery/pkg/api/resource"
2223
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2324
)
2425

2526
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"
27+
BarbicanOperatorName = "barbican"
28+
CinderOperatorName = "cinder"
29+
DesignateOperatorName = "designate"
30+
GlanceOperatorName = "glance"
31+
HeatOperatorName = "heat"
32+
HorizonOperatorName = "horizon"
33+
InfraOperatorName = "infra"
34+
IronicOperatorName = "ironic"
35+
KeystoneOperatorName = "keystone"
36+
ManilaOperatorName = "manila"
37+
MariaDBOperatorName = "mariadb"
38+
NeutronOperatorName = "neutron"
39+
NovaOperatorName = "nova"
40+
OctaviaOperatorName = "octavia"
41+
OpenStackBaremetalOperatorName = "openstack-baremetal"
42+
OvnOperatorName = "ovn"
43+
PlacementOperatorName = "placement"
44+
RabbitMQOperatorName = "rabbitmq-cluster"
45+
SwiftOperatorName = "swift"
46+
TelemetryOperatorName = "telemetry"
47+
TestOperatorName = "test"
48+
ReplicasEnabled int32 = 1
49+
ReplicasDisabled int32 = 0
4850
)
4951

5052
// NOTE: test-operator was deployed as a independant package so it may or may not be installed
5153
// NOTE: depending on how watcher-operator is released for FR2 and then in FR3 it may need to be
5254
// added into this list in the future
5355
// IMPORTANT: have this list in synce with the kubebuilder annotations of the ServiceOperators parameter
5456
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,
57+
DefaultManagerCPULimit resource.Quantity = resource.MustParse("500m")
58+
DefaultManagerCPURequests resource.Quantity = resource.MustParse("10m")
59+
DefaultManagerMemoryLimit resource.Quantity = resource.MustParse("256Mi")
60+
DefaultManagerMemoryRequests resource.Quantity = resource.MustParse("128Mi")
61+
DefaultRbacProxyCPULimit resource.Quantity = resource.MustParse("500m")
62+
DefaultRbacProxyCPURequests resource.Quantity = resource.MustParse("5m")
63+
DefaultRbacProxyMemoryLimit resource.Quantity = resource.MustParse("128Mi")
64+
DefaultRbacProxyMemoryRequests resource.Quantity = resource.MustParse("64Mi")
65+
ServiceOperatorList []OperatorSpec = []OperatorSpec{
66+
{
67+
Name: BarbicanOperatorName,
68+
},
69+
{
70+
Name: CinderOperatorName,
71+
},
72+
{
73+
Name: DesignateOperatorName,
74+
},
75+
{
76+
Name: GlanceOperatorName,
77+
},
78+
{
79+
Name: HeatOperatorName,
80+
},
81+
{
82+
Name: HorizonOperatorName,
83+
},
84+
{
85+
Name: InfraOperatorName,
86+
},
87+
{
88+
Name: IronicOperatorName,
89+
},
90+
{
91+
Name: KeystoneOperatorName,
92+
},
93+
{
94+
Name: ManilaOperatorName,
95+
},
96+
{
97+
Name: MariaDBOperatorName,
98+
},
99+
{
100+
Name: NeutronOperatorName,
101+
},
102+
{
103+
Name: NovaOperatorName,
104+
},
105+
{
106+
Name: OctaviaOperatorName,
107+
},
108+
{
109+
Name: OpenStackBaremetalOperatorName,
110+
},
111+
{
112+
Name: OvnOperatorName,
113+
},
114+
{
115+
Name: PlacementOperatorName,
116+
},
117+
{
118+
Name: RabbitMQOperatorName,
119+
},
120+
{
121+
Name: SwiftOperatorName,
122+
},
123+
{
124+
Name: TelemetryOperatorName,
125+
},
126+
{
127+
Name: TestOperatorName,
128+
},
78129
}
79130
)
80131

@@ -83,8 +134,6 @@ type OpenStackSpec struct {
83134
// +kubebuilder:validation:Optional
84135
// +listType=map
85136
// +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}}
88137
// ServiceOperators - list of service operators to deploy with tunings
89138
// NOTE: test-operator was deployed as a independant package so it may or may not be installed
90139
// NOTE: depending on how watcher-operator is released for FR2 and then in FR3 it may need to be
@@ -96,8 +145,10 @@ type OpenStackSpec struct {
96145
type OperatorSpec struct {
97146
// +kubebuilder:validation:Required
98147
// +kubebuilder:validation:MinLength=1
148+
// +kubebuilder:validation:Enum:=barbican;cinder;designate;glance;heat;horizon;infra;keystone;manila;mariadb;neutron;nova;octavia;openstack-baremetal;ovn;placement;rabbitmq-cluster;swift;telemetry;test
99149
// Name of the service operators.
100150
Name string `json:"name"`
151+
101152
// +kubebuilder:validation:Optional
102153
// +kubebuilder:default=1
103154
// +kubebuilder:validation:Maximum=1
@@ -106,12 +157,12 @@ type OperatorSpec struct {
106157
Replicas *int32 `json:"replicas"`
107158

108159
// +kubebuilder:validation:Optional
109-
// +kubebuilder:default={limits: {cpu: "500m", memory: "128Mi"},requests: {cpu: "10m", memory: "256Mi"}}
160+
// +kubebuilder:default={resources: {limits: {cpu: "500m", memory: "256Mi"},requests: {cpu: "10m", memory: "128Mi"}}}
110161
// ControllerManager - tunings for the controller manager container
111162
ControllerManager ContainerSpec `json:"controllerManager"`
112163

113164
// +kubebuilder:validation:Optional
114-
// +kubebuilder:default={limits: {cpu: "500m", memory: "128Mi"},requests: {cpu: "5m", memory: "64Mi"}}
165+
// +kubebuilder:default={resources: {limits: {cpu: "500m", memory: "128Mi"},requests: {cpu: "5m", memory: "64Mi"}}}
115166
// ControllerManager - tunings for the kube-rbac-proxy container
116167
KubeRbacProxy ContainerSpec `json:"kubeRbacProxy"`
117168
}

0 commit comments

Comments
 (0)