Skip to content

Commit 53cafeb

Browse files
committed
Add deployment of Watcher operator in openstack-operator
This patch is adding watcher operator deployment into the openstack-operator. Until now, it has been deployed as an standalone operator. Jira: OSPRH-16240
1 parent 69d50de commit 53cafeb

14 files changed

+2287
-2
lines changed

apis/bases/operator.openstack.org_openstacks.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ spec:
9595
- swift
9696
- telemetry
9797
- test
98+
- watcher
9899
minLength: 1
99100
type: string
100101
replicas:

apis/operator/v1beta1/openstack_types.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ const (
4646
SwiftOperatorName = "swift"
4747
TelemetryOperatorName = "telemetry"
4848
TestOperatorName = "test"
49+
WatcherOperatorName = "watcher"
4950
// ReplicasEnabled - default replicas count when enabled
5051
ReplicasEnabled int32 = 1
5152
// ReplicasDisabled - replicas when disabled
@@ -173,6 +174,9 @@ var (
173174
{
174175
Name: TestOperatorName,
175176
},
177+
{
178+
Name: WatcherOperatorName,
179+
},
176180
}
177181
)
178182

@@ -189,7 +193,7 @@ type OpenStackSpec struct {
189193
type OperatorSpec struct {
190194
// +kubebuilder:validation:Required
191195
// +kubebuilder:validation:MinLength=1
192-
// +kubebuilder:validation:Enum:=openstack;barbican;cinder;designate;glance;heat;horizon;infra;ironic;keystone;manila;mariadb;neutron;nova;octavia;openstack-baremetal;ovn;placement;rabbitmq-cluster;swift;telemetry;test
196+
// +kubebuilder:validation:Enum:=openstack;barbican;cinder;designate;glance;heat;horizon;infra;ironic;keystone;manila;mariadb;neutron;nova;octavia;openstack-baremetal;ovn;placement;rabbitmq-cluster;swift;telemetry;test;watcher
193197
// Name of the service operators.
194198
Name string `json:"name"`
195199

bindata/crds/watcher.openstack.org_watcherapis.yaml

Lines changed: 476 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 288 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,288 @@
1+
apiVersion: apiextensions.k8s.io/v1
2+
kind: CustomResourceDefinition
3+
metadata:
4+
annotations:
5+
controller-gen.kubebuilder.io/version: v0.14.0
6+
creationTimestamp: null
7+
name: watcherappliers.watcher.openstack.org
8+
spec:
9+
group: watcher.openstack.org
10+
names:
11+
kind: WatcherApplier
12+
listKind: WatcherApplierList
13+
plural: watcherappliers
14+
singular: watcherapplier
15+
scope: Namespaced
16+
versions:
17+
- additionalPrinterColumns:
18+
- description: Status
19+
jsonPath: .status.conditions[0].status
20+
name: Status
21+
type: string
22+
- description: Message
23+
jsonPath: .status.conditions[0].message
24+
name: Message
25+
type: string
26+
name: v1beta1
27+
schema:
28+
openAPIV3Schema:
29+
description: WatcherApplier is the Schema for the watcherappliers API
30+
properties:
31+
apiVersion:
32+
description: |-
33+
APIVersion defines the versioned schema of this representation of an object.
34+
Servers should convert recognized schemas to the latest internal value, and
35+
may reject unrecognized values.
36+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
37+
type: string
38+
kind:
39+
description: |-
40+
Kind is a string value representing the REST resource this object represents.
41+
Servers may infer this from the endpoint the client submits requests to.
42+
Cannot be updated.
43+
In CamelCase.
44+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
45+
type: string
46+
metadata:
47+
type: object
48+
spec:
49+
description: WatcherApplierSpec defines the desired state of WatcherApplier
50+
properties:
51+
containerImage:
52+
description: The service specific Container Image URL (will be set
53+
to environmental default if empty)
54+
type: string
55+
customServiceConfig:
56+
description: |-
57+
CustomServiceConfig - customize the service config using this parameter to change service defaults,
58+
or overwrite rendered information using raw OpenStack config format. The content gets added to
59+
to /etc/<service>/<service>.conf.d directory as a custom config file.
60+
type: string
61+
memcachedInstance:
62+
default: memcached
63+
description: MemcachedInstance is the name of the Memcached CR that
64+
all watcher service will use.
65+
type: string
66+
nodeSelector:
67+
additionalProperties:
68+
type: string
69+
description: |-
70+
NodeSelector to target subset of worker nodes running this component. Setting here overrides
71+
any global NodeSelector settings within the Watcher CR.
72+
type: object
73+
passwordSelectors:
74+
default:
75+
service: WatcherPassword
76+
description: PasswordSelectors - Selectors to identify the ServiceUser
77+
password from the Secret
78+
properties:
79+
service:
80+
default: WatcherPassword
81+
description: Service - Selector to get the watcher service user
82+
password from the Secret
83+
type: string
84+
type: object
85+
preserveJobs:
86+
default: false
87+
description: PreserveJobs - do not delete jobs after they finished
88+
e.g. to check logs
89+
type: boolean
90+
prometheusSecret:
91+
default: metric-storage-prometheus-endpoint
92+
description: Secret containing prometheus connection parameters
93+
type: string
94+
replicas:
95+
default: 1
96+
description: Replicas of Watcher service to run
97+
format: int32
98+
maximum: 1
99+
minimum: 0
100+
type: integer
101+
resources:
102+
description: |-
103+
Resources - Compute Resources required by this service (Limits/Requests).
104+
https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
105+
properties:
106+
claims:
107+
description: |-
108+
Claims lists the names of resources, defined in spec.resourceClaims,
109+
that are used by this container.
110+
111+
112+
This is an alpha field and requires enabling the
113+
DynamicResourceAllocation feature gate.
114+
115+
116+
This field is immutable. It can only be set for containers.
117+
items:
118+
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
119+
properties:
120+
name:
121+
description: |-
122+
Name must match the name of one entry in pod.spec.resourceClaims of
123+
the Pod where this field is used. It makes that resource available
124+
inside a container.
125+
type: string
126+
required:
127+
- name
128+
type: object
129+
type: array
130+
x-kubernetes-list-map-keys:
131+
- name
132+
x-kubernetes-list-type: map
133+
limits:
134+
additionalProperties:
135+
anyOf:
136+
- type: integer
137+
- type: string
138+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
139+
x-kubernetes-int-or-string: true
140+
description: |-
141+
Limits describes the maximum amount of compute resources allowed.
142+
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
143+
type: object
144+
requests:
145+
additionalProperties:
146+
anyOf:
147+
- type: integer
148+
- type: string
149+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
150+
x-kubernetes-int-or-string: true
151+
description: |-
152+
Requests describes the minimum amount of compute resources required.
153+
If Requests is omitted for a container, it defaults to Limits if that is explicitly specified,
154+
otherwise to an implementation-defined value. Requests cannot exceed Limits.
155+
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
156+
type: object
157+
type: object
158+
secret:
159+
description: Secret containing all passwords / keys needed
160+
type: string
161+
serviceAccount:
162+
description: |-
163+
ServiceAccount - service account name used internally to provide
164+
Watcher services the default SA name
165+
type: string
166+
serviceUser:
167+
default: watcher
168+
description: ServiceUser - optional username used for this service
169+
to register in keystone
170+
type: string
171+
tls:
172+
description: TLS - Parameters related to the TLS
173+
properties:
174+
caBundleSecretName:
175+
description: CaBundleSecretName - holding the CA certs in a pre-created
176+
bundle file
177+
type: string
178+
type: object
179+
topologyRef:
180+
description: |-
181+
TopologyRef to apply the Topology defined by the associated CR referenced
182+
by name
183+
properties:
184+
name:
185+
description: Name - The Topology CR name that the Service references
186+
type: string
187+
namespace:
188+
description: |-
189+
Namespace - The Namespace to fetch the Topology CR referenced
190+
NOTE: Namespace currently points by default to the same namespace where
191+
the Service is deployed. Customizing the namespace is not supported and
192+
webhooks prevent editing this field to a value different from the
193+
current project
194+
type: string
195+
type: object
196+
required:
197+
- secret
198+
- serviceAccount
199+
type: object
200+
status:
201+
description: WatcherApplierStatus defines the observed state of WatcherApplier
202+
properties:
203+
conditions:
204+
description: Conditions
205+
items:
206+
description: Condition defines an observation of a API resource
207+
operational state.
208+
properties:
209+
lastTransitionTime:
210+
description: |-
211+
Last time the condition transitioned from one status to another.
212+
This should be when the underlying condition changed. If that is not known, then using the time when
213+
the API field changed is acceptable.
214+
format: date-time
215+
type: string
216+
message:
217+
description: A human readable message indicating details about
218+
the transition.
219+
type: string
220+
reason:
221+
description: The reason for the condition's last transition
222+
in CamelCase.
223+
type: string
224+
severity:
225+
description: |-
226+
Severity provides a classification of Reason code, so the current situation is immediately
227+
understandable and could act accordingly.
228+
It is meant for situations where Status=False and it should be indicated if it is just
229+
informational, warning (next reconciliation might fix it) or an error (e.g. DB create issue
230+
and no actions to automatically resolve the issue can/should be done).
231+
For conditions where Status=Unknown or Status=True the Severity should be SeverityNone.
232+
type: string
233+
status:
234+
description: Status of the condition, one of True, False, Unknown.
235+
type: string
236+
type:
237+
description: Type of condition in CamelCase.
238+
type: string
239+
required:
240+
- lastTransitionTime
241+
- status
242+
- type
243+
type: object
244+
type: array
245+
hash:
246+
additionalProperties:
247+
type: string
248+
description: Map of hashes to track e.g. job status
249+
type: object
250+
lastAppliedTopology:
251+
description: LastAppliedTopology - the last applied Topology
252+
properties:
253+
name:
254+
description: Name - The Topology CR name that the Service references
255+
type: string
256+
namespace:
257+
description: |-
258+
Namespace - The Namespace to fetch the Topology CR referenced
259+
NOTE: Namespace currently points by default to the same namespace where
260+
the Service is deployed. Customizing the namespace is not supported and
261+
webhooks prevent editing this field to a value different from the
262+
current project
263+
type: string
264+
type: object
265+
observedGeneration:
266+
description: |-
267+
ObservedGeneration - the most recent generation observed for this
268+
service. If the observed generation is less than the spec generation,
269+
then the controller has not processed the latest changes injected by
270+
the openstack-operator in the top-level CR (e.g. the ContainerImage)
271+
format: int64
272+
type: integer
273+
readyCount:
274+
description: ReadyCount of watcher Applier instances
275+
format: int32
276+
type: integer
277+
type: object
278+
type: object
279+
served: true
280+
storage: true
281+
subresources:
282+
status: {}
283+
status:
284+
acceptedNames:
285+
kind: ""
286+
plural: ""
287+
conditions: null
288+
storedVersions: null

0 commit comments

Comments
 (0)