Skip to content

Commit 12fd78e

Browse files
committed
[tls] Support for telemetry
Public/Internal service cert secrets and the CA bundle secret can be passed to configure httpd virtual hosts for tls termination. The certs get direct mounted to the appropriate place in etc/pki/tls/certs/%s.crt|key and a CA bundle to /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem . Job deployments for bootstrap/cron get the CA bundle added if configured. Signed-off-by: Veronika Fisarova <[email protected]> Depends-On: openstack-k8s-operators/lib-common#428
1 parent cce4d37 commit 12fd78e

20 files changed

+623
-19
lines changed

api/bases/telemetry.openstack.org_autoscalings.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,36 @@ spec:
316316
maximum: 65535
317317
minimum: 1
318318
type: integer
319+
tls:
320+
description: TLS - Parameters related to the TLS
321+
properties:
322+
api:
323+
description: API tls type which encapsulates for API services
324+
properties:
325+
internal:
326+
description: Internal GenericService - holds the secret for
327+
the internal endpoint
328+
properties:
329+
secretName:
330+
description: SecretName - holding the cert, key for the
331+
service
332+
type: string
333+
type: object
334+
public:
335+
description: Public GenericService - holds the secret for
336+
the public endpoint
337+
properties:
338+
secretName:
339+
description: SecretName - holding the cert, key for the
340+
service
341+
type: string
342+
type: object
343+
type: object
344+
caBundleSecretName:
345+
description: CaBundleSecretName - holding the CA certs in a pre-created
346+
bundle file
347+
type: string
348+
type: object
319349
required:
320350
- heatInstance
321351
type: object

api/bases/telemetry.openstack.org_ceilometers.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,17 @@ spec:
105105
type: string
106106
sgCoreImage:
107107
type: string
108+
tls:
109+
description: TLS - Parameters related to the TLS
110+
properties:
111+
caBundleSecretName:
112+
description: CaBundleSecretName - holding the CA certs in a pre-created
113+
bundle file
114+
type: string
115+
secretName:
116+
description: SecretName - holding the cert, key for the service
117+
type: string
118+
type: object
108119
required:
109120
- centralImage
110121
- computeImage

api/bases/telemetry.openstack.org_telemetries.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,36 @@ spec:
335335
maximum: 65535
336336
minimum: 1
337337
type: integer
338+
tls:
339+
description: TLS - Parameters related to the TLS
340+
properties:
341+
api:
342+
description: API tls type which encapsulates for API services
343+
properties:
344+
internal:
345+
description: Internal GenericService - holds the secret
346+
for the internal endpoint
347+
properties:
348+
secretName:
349+
description: SecretName - holding the cert, key for
350+
the service
351+
type: string
352+
type: object
353+
public:
354+
description: Public GenericService - holds the secret
355+
for the public endpoint
356+
properties:
357+
secretName:
358+
description: SecretName - holding the cert, key for
359+
the service
360+
type: string
361+
type: object
362+
type: object
363+
caBundleSecretName:
364+
description: CaBundleSecretName - holding the CA certs in
365+
a pre-created bundle file
366+
type: string
367+
type: object
338368
required:
339369
- heatInstance
340370
type: object
@@ -416,6 +446,17 @@ spec:
416446
type: string
417447
sgCoreImage:
418448
type: string
449+
tls:
450+
description: TLS - Parameters related to the TLS
451+
properties:
452+
caBundleSecretName:
453+
description: CaBundleSecretName - holding the CA certs in
454+
a pre-created bundle file
455+
type: string
456+
secretName:
457+
description: SecretName - holding the cert, key for the service
458+
type: string
459+
type: object
419460
required:
420461
- centralImage
421462
- computeImage

api/v1beta1/autoscaling_types.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ package v1beta1
1818

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

23-
"github.com/openstack-k8s-operators/lib-common/modules/common/util"
2424
"github.com/openstack-k8s-operators/lib-common/modules/common/service"
25+
"github.com/openstack-k8s-operators/lib-common/modules/common/util"
2526
)
2627

2728
const (
@@ -37,7 +38,6 @@ const (
3738
DbSyncHash = "dbsync"
3839
)
3940

40-
4141
// Aodh defines the aodh component spec
4242
type Aodh struct {
4343
// RabbitMQ instance name
@@ -135,6 +135,11 @@ type AutoscalingSpec struct {
135135
// Heat instance name.
136136
// +kubebuilder:default=heat
137137
HeatInstance string `json:"heatInstance"`
138+
139+
// +kubebuilder:validation:Optional
140+
// +operator-sdk:csv:customresourcedefinitions:type=spec
141+
// TLS - Parameters related to the TLS
142+
TLS tls.API `json:"tls,omitempty"`
138143
}
139144

140145
// AutoscalingStatus defines the observed state of Autoscaling

api/v1beta1/ceilometer_types.go

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

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

2324
"github.com/openstack-k8s-operators/lib-common/modules/common/util"
@@ -90,6 +91,11 @@ type CeilometerSpec struct {
9091

9192
// +kubebuilder:validation:Required
9293
NodeExporterImage string `json:"nodeExporterImage"`
94+
95+
// +kubebuilder:validation:Optional
96+
// +operator-sdk:csv:customresourcedefinitions:type=spec
97+
// TLS - Parameters related to the TLS
98+
TLS tls.SimpleService `json:"tls,omitempty"`
9399
}
94100

95101
// CeilometerStatus defines the observed state of Ceilometer

api/v1beta1/telemetry_types.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -161,20 +161,19 @@ func init() {
161161
func SetupDefaultsTelemetry() {
162162
// Acquire environmental defaults and initialize Telemetry defaults with them
163163
telemetryDefaults := TelemetryDefaults{
164-
CentralContainerImageURL: util.GetEnvVar("RELATED_IMAGE_CEILOMETER_CENTRAL_IMAGE_URL_DEFAULT", CeilometerCentralContainerImage),
165-
ComputeContainerImageURL: util.GetEnvVar("RELATED_IMAGE_CEILOMETER_COMPUTE_IMAGE_URL_DEFAULT", CeilometerComputeContainerImage),
166-
IpmiContainerImageURL: util.GetEnvVar("RELATED_IMAGE_CEILOMETER_IPMI_IMAGE_URL_DEFAULT", CeilometerIpmiContainerImage),
167-
NotificationContainerImageURL: util.GetEnvVar("RELATED_IMAGE_CEILOMETER_NOTIFICATION_IMAGE_URL_DEFAULT", CeilometerNotificationContainerImage),
168-
NodeExporterContainerImageURL: util.GetEnvVar("RELATED_IMAGE_TELEMETRY_NODE_EXPORTER_IMAGE_URL_DEFAULT", NodeExporterContainerImage),
169-
SgCoreContainerImageURL: util.GetEnvVar("RELATED_IMAGE_CEILOMETER_SGCORE_IMAGE_URL_DEFAULT", CeilometerSgCoreContainerImage),
164+
CentralContainerImageURL: util.GetEnvVar("RELATED_IMAGE_CEILOMETER_CENTRAL_IMAGE_URL_DEFAULT", CeilometerCentralContainerImage),
165+
ComputeContainerImageURL: util.GetEnvVar("RELATED_IMAGE_CEILOMETER_COMPUTE_IMAGE_URL_DEFAULT", CeilometerComputeContainerImage),
166+
IpmiContainerImageURL: util.GetEnvVar("RELATED_IMAGE_CEILOMETER_IPMI_IMAGE_URL_DEFAULT", CeilometerIpmiContainerImage),
167+
NotificationContainerImageURL: util.GetEnvVar("RELATED_IMAGE_CEILOMETER_NOTIFICATION_IMAGE_URL_DEFAULT", CeilometerNotificationContainerImage),
168+
NodeExporterContainerImageURL: util.GetEnvVar("RELATED_IMAGE_TELEMETRY_NODE_EXPORTER_IMAGE_URL_DEFAULT", NodeExporterContainerImage),
169+
SgCoreContainerImageURL: util.GetEnvVar("RELATED_IMAGE_CEILOMETER_SGCORE_IMAGE_URL_DEFAULT", CeilometerSgCoreContainerImage),
170170

171171
// Autoscaling
172172
AodhAPIContainerImageURL: util.GetEnvVar("RELATED_IMAGE_AODH_API_IMAGE_URL_DEFAULT", AodhAPIContainerImage),
173173
AodhEvaluatorContainerImageURL: util.GetEnvVar("RELATED_IMAGE_AODH_EVALUATOR_IMAGE_URL_DEFAULT", AodhEvaluatorContainerImage),
174174
AodhNotifierContainerImageURL: util.GetEnvVar("RELATED_IMAGE_AODH_NOTIFIER_IMAGE_URL_DEFAULT", AodhNotifierContainerImage),
175175
AodhListenerContainerImageURL: util.GetEnvVar("RELATED_IMAGE_AODH_LISTENER_IMAGE_URL_DEFAULT", AodhListenerContainerImage),
176176
AodhInitContainerImageURL: util.GetEnvVar("RELATED_IMAGE_AODH_API_IMAGE_URL_DEFAULT", AodhAPIContainerImage),
177-
178177
}
179178

180179
SetupTelemetryDefaults(telemetryDefaults)

api/v1beta1/zz_generated.deepcopy.go

Lines changed: 2 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_autoscalings.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,36 @@ spec:
316316
maximum: 65535
317317
minimum: 1
318318
type: integer
319+
tls:
320+
description: TLS - Parameters related to the TLS
321+
properties:
322+
api:
323+
description: API tls type which encapsulates for API services
324+
properties:
325+
internal:
326+
description: Internal GenericService - holds the secret for
327+
the internal endpoint
328+
properties:
329+
secretName:
330+
description: SecretName - holding the cert, key for the
331+
service
332+
type: string
333+
type: object
334+
public:
335+
description: Public GenericService - holds the secret for
336+
the public endpoint
337+
properties:
338+
secretName:
339+
description: SecretName - holding the cert, key for the
340+
service
341+
type: string
342+
type: object
343+
type: object
344+
caBundleSecretName:
345+
description: CaBundleSecretName - holding the CA certs in a pre-created
346+
bundle file
347+
type: string
348+
type: object
319349
required:
320350
- heatInstance
321351
type: object

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,17 @@ spec:
105105
type: string
106106
sgCoreImage:
107107
type: string
108+
tls:
109+
description: TLS - Parameters related to the TLS
110+
properties:
111+
caBundleSecretName:
112+
description: CaBundleSecretName - holding the CA certs in a pre-created
113+
bundle file
114+
type: string
115+
secretName:
116+
description: SecretName - holding the cert, key for the service
117+
type: string
118+
type: object
108119
required:
109120
- centralImage
110121
- computeImage

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

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,36 @@ spec:
335335
maximum: 65535
336336
minimum: 1
337337
type: integer
338+
tls:
339+
description: TLS - Parameters related to the TLS
340+
properties:
341+
api:
342+
description: API tls type which encapsulates for API services
343+
properties:
344+
internal:
345+
description: Internal GenericService - holds the secret
346+
for the internal endpoint
347+
properties:
348+
secretName:
349+
description: SecretName - holding the cert, key for
350+
the service
351+
type: string
352+
type: object
353+
public:
354+
description: Public GenericService - holds the secret
355+
for the public endpoint
356+
properties:
357+
secretName:
358+
description: SecretName - holding the cert, key for
359+
the service
360+
type: string
361+
type: object
362+
type: object
363+
caBundleSecretName:
364+
description: CaBundleSecretName - holding the CA certs in
365+
a pre-created bundle file
366+
type: string
367+
type: object
338368
required:
339369
- heatInstance
340370
type: object
@@ -416,6 +446,17 @@ spec:
416446
type: string
417447
sgCoreImage:
418448
type: string
449+
tls:
450+
description: TLS - Parameters related to the TLS
451+
properties:
452+
caBundleSecretName:
453+
description: CaBundleSecretName - holding the CA certs in
454+
a pre-created bundle file
455+
type: string
456+
secretName:
457+
description: SecretName - holding the cert, key for the service
458+
type: string
459+
type: object
419460
required:
420461
- centralImage
421462
- computeImage

0 commit comments

Comments
 (0)