Skip to content

Commit bf6aa81

Browse files
Merge pull request #573 from openstack-k8s-operators/OSPRH-11017/add-nad-metricstorages
Allow attaching MetricStorage pod to additional networks
2 parents 2daa14d + 5bcff84 commit bf6aa81

19 files changed

+239
-0
lines changed

api/bases/telemetry.openstack.org_ceilometers.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ spec:
185185
items:
186186
type: string
187187
type: array
188+
x-kubernetes-list-type: atomic
188189
nodeSelector:
189190
additionalProperties:
190191
type: string

api/bases/telemetry.openstack.org_metricstorages.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ spec:
1515
scope: Namespaced
1616
versions:
1717
- additionalPrinterColumns:
18+
- description: NetworkAttachments
19+
jsonPath: .status.networkAttachments
20+
name: NetworkAttachments
21+
type: string
1822
- description: Status
1923
jsonPath: .status.conditions[0].status
2024
name: Status
@@ -1299,6 +1303,13 @@ spec:
12991303
type: string
13001304
type: object
13011305
type: object
1306+
networkAttachments:
1307+
description: NetworkAttachments is a list of NetworkAttachment resource
1308+
names to expose the services to the given network
1309+
items:
1310+
type: string
1311+
type: array
1312+
x-kubernetes-list-type: atomic
13021313
prometheusTls:
13031314
description: TLS - Parameters related to the TLS
13041315
properties:
@@ -1357,6 +1368,11 @@ spec:
13571368
- type
13581369
type: object
13591370
type: array
1371+
networkAttachments:
1372+
additionalProperties:
1373+
type: string
1374+
description: NetworkAttachments status of the Prometheus pods
1375+
type: object
13601376
observedGeneration:
13611377
description: |-
13621378
ObservedGeneration - the most recent generation observed for this

api/bases/telemetry.openstack.org_telemetries.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,7 @@ spec:
481481
items:
482482
type: string
483483
type: array
484+
x-kubernetes-list-type: atomic
484485
nodeSelector:
485486
additionalProperties:
486487
type: string
@@ -1868,6 +1869,13 @@ spec:
18681869
type: string
18691870
type: object
18701871
type: object
1872+
networkAttachments:
1873+
description: NetworkAttachments is a list of NetworkAttachment
1874+
resource names to expose the services to the given network
1875+
items:
1876+
type: string
1877+
type: array
1878+
x-kubernetes-list-type: atomic
18711879
prometheusTls:
18721880
description: TLS - Parameters related to the TLS
18731881
properties:

api/v1beta1/ceilometer_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ type CeilometerSpecCore struct {
111111
DefaultConfigOverwrite map[string]string `json:"defaultConfigOverwrite,omitempty"`
112112

113113
// NetworkAttachmentDefinitions list of network attachment definitions the service pod gets attached to
114+
// +listType=atomic
114115
NetworkAttachmentDefinitions []string `json:"networkAttachmentDefinitions,omitempty"`
115116

116117
// Whether kube-state-metrics should be deployed

api/v1beta1/conditions.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,9 @@ const (
181181
// PrometheusUnableToRemoveTLSMessage
182182
PrometheusUnableToRemoveTLSMessage = "Error occured when trying to remove TLS config: %s"
183183

184+
// PrometheusUnableToRemoveNADMessage
185+
PrometheusUnableToRemoveNADMessage = "Error occured when trying to remove NAD config: %s"
186+
184187
//
185188
// LoggingReady condition messages
186189
//

api/v1beta1/metricstorage_types.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@ type MetricStorageSpec struct {
9090
// +kubebuilder:default=ctlplane
9191
DataplaneNetwork *infranetworkv1.NetNameStr `json:"dataplaneNetwork"`
9292

93+
// NetworkAttachments is a list of NetworkAttachment resource names to expose the services to the given network
94+
// +kubebuilder:validation:Optional
95+
// +listType=atomic
96+
NetworkAttachments []string `json:"networkAttachments,omitempty"`
97+
9398
// MonitoringStack allows to define a metric storage with
9499
// options supported by Red Hat
95100
// +kubebuilder:validation:Optional
@@ -127,10 +132,13 @@ type MetricStorageStatus struct {
127132
// then the controller has not processed the latest changes injected by
128133
// the openstack-operator in the top-level CR (e.g. the ContainerImage)
129134
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
135+
// NetworkAttachments status of the Prometheus pods
136+
NetworkAttachments map[string]string `json:"networkAttachments,omitempty"`
130137
}
131138

132139
//+kubebuilder:object:root=true
133140
//+kubebuilder:subresource:status
141+
//+kubebuilder:printcolumn:name="NetworkAttachments",type="string",JSONPath=".status.networkAttachments",description="NetworkAttachments"
134142
//+kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.conditions[0].status",description="Status"
135143
//+kubebuilder:printcolumn:name="Message",type="string",JSONPath=".status.conditions[0].message",description="Message"
136144

api/v1beta1/metricstorage_webhook.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ func (spec *MetricStorageSpec) Default() {
5959
if *spec.DataplaneNetwork == "" {
6060
*spec.DataplaneNetwork = "ctlplane"
6161
}
62+
6263
if spec.MonitoringStack != nil {
6364
spec.MonitoringStack.Default()
6465
}

api/v1beta1/zz_generated.deepcopy.go

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/telemetry.openstack.org_ceilometers.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ spec:
185185
items:
186186
type: string
187187
type: array
188+
x-kubernetes-list-type: atomic
188189
nodeSelector:
189190
additionalProperties:
190191
type: string

config/crd/bases/telemetry.openstack.org_metricstorages.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ spec:
1515
scope: Namespaced
1616
versions:
1717
- additionalPrinterColumns:
18+
- description: NetworkAttachments
19+
jsonPath: .status.networkAttachments
20+
name: NetworkAttachments
21+
type: string
1822
- description: Status
1923
jsonPath: .status.conditions[0].status
2024
name: Status
@@ -1299,6 +1303,13 @@ spec:
12991303
type: string
13001304
type: object
13011305
type: object
1306+
networkAttachments:
1307+
description: NetworkAttachments is a list of NetworkAttachment resource
1308+
names to expose the services to the given network
1309+
items:
1310+
type: string
1311+
type: array
1312+
x-kubernetes-list-type: atomic
13021313
prometheusTls:
13031314
description: TLS - Parameters related to the TLS
13041315
properties:
@@ -1357,6 +1368,11 @@ spec:
13571368
- type
13581369
type: object
13591370
type: array
1371+
networkAttachments:
1372+
additionalProperties:
1373+
type: string
1374+
description: NetworkAttachments status of the Prometheus pods
1375+
type: object
13601376
observedGeneration:
13611377
description: |-
13621378
ObservedGeneration - the most recent generation observed for this

0 commit comments

Comments
 (0)