Skip to content

Commit b5d49d9

Browse files
committed
Allow to customize annotations on the Logging service
1 parent 6609fa1 commit b5d49d9

File tree

10 files changed

+56
-40
lines changed

10 files changed

+56
-40
lines changed

api/bases/telemetry.openstack.org_loggings.yaml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,16 @@ spec:
3535
spec:
3636
description: LoggingSpec defines the desired state of Logging
3737
properties:
38+
annotations:
39+
additionalProperties:
40+
type: string
41+
default:
42+
metallb.universe.tf/address-pool: internalapi
43+
metallb.universe.tf/allow-shared-ip: internalapi
44+
metallb.universe.tf/loadBalancerIPs: 172.17.0.80
45+
description: Annotations is a way to configure certain LoadBalancers,
46+
like MetalLB
47+
type: object
3848
cloNamespace:
3949
default: openshift-logging
4050
description: CLONamespace points to the namespace where the cluster-logging-operator
@@ -43,10 +53,6 @@ spec:
4353
ipaddr:
4454
description: IPAddr is the address where the service will listen on
4555
type: string
46-
network:
47-
description: The openstack network that will be used to connect computes
48-
nodes
49-
type: string
5056
port:
5157
default: 10514
5258
description: Port is the port where the service will listen on
@@ -73,7 +79,6 @@ spec:
7379
type: integer
7480
required:
7581
- ipaddr
76-
- network
7782
- rsyslogQueueType
7883
type: object
7984
status:

api/bases/telemetry.openstack.org_telemetries.yaml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,16 @@ spec:
428428
logging:
429429
description: Logging - Parameters related to the logging
430430
properties:
431+
annotations:
432+
additionalProperties:
433+
type: string
434+
default:
435+
metallb.universe.tf/address-pool: internalapi
436+
metallb.universe.tf/allow-shared-ip: internalapi
437+
metallb.universe.tf/loadBalancerIPs: 172.17.0.80
438+
description: Annotations is a way to configure certain LoadBalancers,
439+
like MetalLB
440+
type: object
431441
cloNamespace:
432442
default: openshift-logging
433443
description: CLONamespace points to the namespace where the cluster-logging-operator
@@ -442,10 +452,6 @@ spec:
442452
description: IPAddr is the address where the service will listen
443453
on
444454
type: string
445-
network:
446-
description: The openstack network that will be used to connect
447-
computes nodes
448-
type: string
449455
port:
450456
default: 10514
451457
description: Port is the port where the service will listen on
@@ -473,7 +479,6 @@ spec:
473479
type: integer
474480
required:
475481
- ipaddr
476-
- network
477482
- rsyslogQueueType
478483
type: object
479484
metricStorage:

api/v1beta1/logging_types.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@ import (
2525

2626
// LoggingSpec defines the desired state of Logging
2727
type LoggingSpec struct {
28-
29-
// The openstack network that will be used to connect computes nodes
30-
// +kubebuilder:validation:Required
31-
Network string `json:"network"`
32-
3328
// IPAddr is the address where the service will listen on
3429
// +kubebuilder:validation:Required
3530
IPAddr string `json:"ipaddr"`
@@ -49,6 +44,11 @@ type LoggingSpec struct {
4944
// +kubebuilder:default=openshift-logging
5045
CLONamespace string `json:"cloNamespace"`
5146

47+
// Annotations is a way to configure certain LoadBalancers, like MetalLB
48+
// +kubebuilder:validation:Optional
49+
// +kubebuilder:default={metallb.universe.tf/address-pool: internalapi, metallb.universe.tf/allow-shared-ip: internalapi, metallb.universe.tf/loadBalancerIPs: "172.17.0.80"}
50+
Annotations map[string]string `json:"annotations"`
51+
5252
// The number of retries rsyslog will attempt before abandoning
5353
// +kubebuilder:validation:Optional
5454
// +kubebuilder:default=100

api/v1beta1/zz_generated.deepcopy.go

Lines changed: 10 additions & 3 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_loggings.yaml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,16 @@ spec:
3535
spec:
3636
description: LoggingSpec defines the desired state of Logging
3737
properties:
38+
annotations:
39+
additionalProperties:
40+
type: string
41+
default:
42+
metallb.universe.tf/address-pool: internalapi
43+
metallb.universe.tf/allow-shared-ip: internalapi
44+
metallb.universe.tf/loadBalancerIPs: 172.17.0.80
45+
description: Annotations is a way to configure certain LoadBalancers,
46+
like MetalLB
47+
type: object
3848
cloNamespace:
3949
default: openshift-logging
4050
description: CLONamespace points to the namespace where the cluster-logging-operator
@@ -43,10 +53,6 @@ spec:
4353
ipaddr:
4454
description: IPAddr is the address where the service will listen on
4555
type: string
46-
network:
47-
description: The openstack network that will be used to connect computes
48-
nodes
49-
type: string
5056
port:
5157
default: 10514
5258
description: Port is the port where the service will listen on
@@ -73,7 +79,6 @@ spec:
7379
type: integer
7480
required:
7581
- ipaddr
76-
- network
7782
- rsyslogQueueType
7883
type: object
7984
status:

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

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,16 @@ spec:
428428
logging:
429429
description: Logging - Parameters related to the logging
430430
properties:
431+
annotations:
432+
additionalProperties:
433+
type: string
434+
default:
435+
metallb.universe.tf/address-pool: internalapi
436+
metallb.universe.tf/allow-shared-ip: internalapi
437+
metallb.universe.tf/loadBalancerIPs: 172.17.0.80
438+
description: Annotations is a way to configure certain LoadBalancers,
439+
like MetalLB
440+
type: object
431441
cloNamespace:
432442
default: openshift-logging
433443
description: CLONamespace points to the namespace where the cluster-logging-operator
@@ -442,10 +452,6 @@ spec:
442452
description: IPAddr is the address where the service will listen
443453
on
444454
type: string
445-
network:
446-
description: The openstack network that will be used to connect
447-
computes nodes
448-
type: string
449455
port:
450456
default: 10514
451457
description: Port is the port where the service will listen on
@@ -473,7 +479,6 @@ spec:
473479
type: integer
474480
required:
475481
- ipaddr
476-
- network
477482
- rsyslogQueueType
478483
type: object
479484
metricStorage:

config/samples/telemetry_v1beta1_logging.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,5 @@ metadata:
99
app.kubernetes.io/created-by: telemetry-operator
1010
name: logging
1111
spec:
12-
network: internalapi
13-
ipaddr: 172.17.0.80
1412
port: 10514
1513
cloNamespace: openshift-logging

config/samples/telemetry_v1beta1_telemetry.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,4 @@ spec:
2727
secret: osp-secret
2828
logging:
2929
enabled: false
30-
network: internalapi
31-
ipaddr: 172.17.0.80
3230
port: 10514
33-
cloNamespace: openshift-logging

pkg/logging/service.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,7 @@ func Service(
4949
"component": "collector",
5050
"provider": "openshift",
5151
}
52-
service.Annotations = map[string]string{
53-
"endpoint": "internal",
54-
"metallb.universe.tf/address-pool": instance.Spec.Network,
55-
"metallb.universe.tf/allow-shared-ip": instance.Spec.Network,
56-
"metallb.universe.tf/loadBalancerIPs": instance.Spec.IPAddr,
57-
}
52+
service.Annotations = instance.Spec.Annotations
5853
service.Spec.Type = "LoadBalancer"
5954

6055
return nil

tests/kuttl/suites/logging/tests/00-assert.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ apiVersion: v1
22
kind: Service
33
metadata:
44
annotations:
5-
endpoint: internal
65
metallb.universe.tf/address-pool: internalapi
76
metallb.universe.tf/allow-shared-ip: internalapi
87
metallb.universe.tf/loadBalancerIPs: 172.17.0.80

0 commit comments

Comments
 (0)