Skip to content

Commit 6081ab1

Browse files
committed
Make it compatible with previous oscp
1 parent f91b1b8 commit 6081ab1

10 files changed

+180
-19
lines changed

api/bases/telemetry.openstack.org_cloudkitties.yaml

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ spec:
4242
apiTimeout:
4343
default: 60
4444
description: APITimeout for HAProxy, Apache, and rpc_response_timeout
45-
minimum: 10
4645
type: integer
4746
cloudKittyAPI:
4847
description: CloudKittyAPI - Spec definition for the API service of
@@ -494,6 +493,7 @@ spec:
494493
DB, defaults to cloudkitty
495494
type: string
496495
databaseInstance:
496+
default: openstack
497497
description: |-
498498
MariaDB instance name
499499
Right now required by the maridb-operator to get the credentials from the instance to create the DB
@@ -538,6 +538,37 @@ spec:
538538
description: PreserveJobs - do not delete jobs after they finished
539539
e.g. to check logs
540540
type: boolean
541+
prometheusHost:
542+
description: Host of user deployed prometheus
543+
type: string
544+
prometheusPort:
545+
description: Port of user deployed prometheus
546+
format: int32
547+
maximum: 65535
548+
minimum: 1
549+
type: integer
550+
prometheusTLSCaCertSecret:
551+
description: If defined, specifies which CA certificate to use for
552+
user deployed prometheus
553+
nullable: true
554+
properties:
555+
key:
556+
description: The key of the secret to select from. Must be a
557+
valid secret key.
558+
type: string
559+
name:
560+
description: |-
561+
Name of the referent.
562+
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
563+
TODO: Add other useful fields. apiVersion, kind, uid?
564+
type: string
565+
optional:
566+
description: Specify whether the Secret or its key must be defined
567+
type: boolean
568+
required:
569+
- key
570+
type: object
571+
x-kubernetes-map-type: atomic
541572
rabbitMqClusterName:
542573
default: rabbitmq
543574
description: |-
@@ -657,6 +688,17 @@ spec:
657688
and its conditions are likely stale.
658689
format: int64
659690
type: integer
691+
prometheusHostname:
692+
description: PrometheusHost - Hostname for prometheus used for autoscaling
693+
type: string
694+
prometheusPort:
695+
description: PrometheusPort - Port for prometheus used for autoscaling
696+
format: int32
697+
type: integer
698+
prometheusTLS:
699+
description: PrometheusTLS - Determines if TLS should be used for
700+
accessing prometheus
701+
type: boolean
660702
serviceIDs:
661703
additionalProperties:
662704
type: string

api/bases/telemetry.openstack.org_telemetries.yaml

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,6 @@ spec:
600600
apiTimeout:
601601
default: 60
602602
description: APITimeout for HAProxy, Apache, and rpc_response_timeout
603-
minimum: 10
604603
type: integer
605604
cloudKittyAPI:
606605
description: CloudKittyAPI - Spec definition for the API service
@@ -1053,13 +1052,14 @@ spec:
10531052
cloudkitty DB, defaults to cloudkitty
10541053
type: string
10551054
databaseInstance:
1055+
default: openstack
10561056
description: |-
10571057
MariaDB instance name
10581058
Right now required by the maridb-operator to get the credentials from the instance to create the DB
10591059
Might not be required in future
10601060
type: string
10611061
enabled:
1062-
default: true
1062+
default: false
10631063
description: Enabled - Whether OpenStack CloudKitty service should
10641064
be deployed and managed
10651065
type: boolean
@@ -1102,6 +1102,38 @@ spec:
11021102
description: PreserveJobs - do not delete jobs after they finished
11031103
e.g. to check logs
11041104
type: boolean
1105+
prometheusHost:
1106+
description: Host of user deployed prometheus
1107+
type: string
1108+
prometheusPort:
1109+
description: Port of user deployed prometheus
1110+
format: int32
1111+
maximum: 65535
1112+
minimum: 1
1113+
type: integer
1114+
prometheusTLSCaCertSecret:
1115+
description: If defined, specifies which CA certificate to use
1116+
for user deployed prometheus
1117+
nullable: true
1118+
properties:
1119+
key:
1120+
description: The key of the secret to select from. Must be
1121+
a valid secret key.
1122+
type: string
1123+
name:
1124+
description: |-
1125+
Name of the referent.
1126+
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
1127+
TODO: Add other useful fields. apiVersion, kind, uid?
1128+
type: string
1129+
optional:
1130+
description: Specify whether the Secret or its key must be
1131+
defined
1132+
type: boolean
1133+
required:
1134+
- key
1135+
type: object
1136+
x-kubernetes-map-type: atomic
11051137
rabbitMqClusterName:
11061138
default: rabbitmq
11071139
description: |-

api/v1beta1/cloudkitty_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ type CloudKittySpecBase struct {
4747
CloudKittyTemplate `json:",inline"`
4848

4949
// +kubebuilder:validation:Required
50+
// +kubebuilder:default=openstack
5051
// MariaDB instance name
5152
// Right now required by the maridb-operator to get the credentials from the instance to create the DB
5253
// Might not be required in future
@@ -82,7 +83,6 @@ type CloudKittySpecBase struct {
8283

8384
// +kubebuilder:validation:Optional
8485
// +kubebuilder:default=60
85-
// +kubebuilder:validation:Minimum=10
8686
// APITimeout for HAProxy, Apache, and rpc_response_timeout
8787
APITimeout int `json:"apiTimeout"`
8888

api/v1beta1/telemetry_types.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,14 +187,13 @@ type LoggingSection struct {
187187
// CloudKittySpec defines the desired state of the cloudkitty service
188188
type CloudKittySection struct {
189189
// +kubebuilder:validation:Optional
190-
// +kubebuilder:default=true
190+
// +kubebuilder:default=false
191191
// +operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:booleanSwitch"}
192192
// Enabled - Whether OpenStack CloudKitty service should be deployed and managed
193193
Enabled *bool `json:"enabled"`
194194

195195
// +kubebuilder:validation:Optional
196196
//+operator-sdk:csv:customresourcedefinitions:type=spec
197-
// +kubebuilder:default={apiTimeout: 60}
198197
// Template - Overrides to use when creating the OpenStack CloudKitty service
199198
CloudKittySpec `json:",inline"`
200199
}

api/v1beta1/zz_generated.deepcopy.go

Lines changed: 5 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_cloudkitties.yaml

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ spec:
4242
apiTimeout:
4343
default: 60
4444
description: APITimeout for HAProxy, Apache, and rpc_response_timeout
45-
minimum: 10
4645
type: integer
4746
cloudKittyAPI:
4847
description: CloudKittyAPI - Spec definition for the API service of
@@ -494,6 +493,7 @@ spec:
494493
DB, defaults to cloudkitty
495494
type: string
496495
databaseInstance:
496+
default: openstack
497497
description: |-
498498
MariaDB instance name
499499
Right now required by the maridb-operator to get the credentials from the instance to create the DB
@@ -538,6 +538,37 @@ spec:
538538
description: PreserveJobs - do not delete jobs after they finished
539539
e.g. to check logs
540540
type: boolean
541+
prometheusHost:
542+
description: Host of user deployed prometheus
543+
type: string
544+
prometheusPort:
545+
description: Port of user deployed prometheus
546+
format: int32
547+
maximum: 65535
548+
minimum: 1
549+
type: integer
550+
prometheusTLSCaCertSecret:
551+
description: If defined, specifies which CA certificate to use for
552+
user deployed prometheus
553+
nullable: true
554+
properties:
555+
key:
556+
description: The key of the secret to select from. Must be a
557+
valid secret key.
558+
type: string
559+
name:
560+
description: |-
561+
Name of the referent.
562+
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
563+
TODO: Add other useful fields. apiVersion, kind, uid?
564+
type: string
565+
optional:
566+
description: Specify whether the Secret or its key must be defined
567+
type: boolean
568+
required:
569+
- key
570+
type: object
571+
x-kubernetes-map-type: atomic
541572
rabbitMqClusterName:
542573
default: rabbitmq
543574
description: |-
@@ -657,6 +688,17 @@ spec:
657688
and its conditions are likely stale.
658689
format: int64
659690
type: integer
691+
prometheusHostname:
692+
description: PrometheusHost - Hostname for prometheus used for autoscaling
693+
type: string
694+
prometheusPort:
695+
description: PrometheusPort - Port for prometheus used for autoscaling
696+
format: int32
697+
type: integer
698+
prometheusTLS:
699+
description: PrometheusTLS - Determines if TLS should be used for
700+
accessing prometheus
701+
type: boolean
660702
serviceIDs:
661703
additionalProperties:
662704
type: string

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

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,6 @@ spec:
600600
apiTimeout:
601601
default: 60
602602
description: APITimeout for HAProxy, Apache, and rpc_response_timeout
603-
minimum: 10
604603
type: integer
605604
cloudKittyAPI:
606605
description: CloudKittyAPI - Spec definition for the API service
@@ -1053,13 +1052,14 @@ spec:
10531052
cloudkitty DB, defaults to cloudkitty
10541053
type: string
10551054
databaseInstance:
1055+
default: openstack
10561056
description: |-
10571057
MariaDB instance name
10581058
Right now required by the maridb-operator to get the credentials from the instance to create the DB
10591059
Might not be required in future
10601060
type: string
10611061
enabled:
1062-
default: true
1062+
default: false
10631063
description: Enabled - Whether OpenStack CloudKitty service should
10641064
be deployed and managed
10651065
type: boolean
@@ -1102,6 +1102,38 @@ spec:
11021102
description: PreserveJobs - do not delete jobs after they finished
11031103
e.g. to check logs
11041104
type: boolean
1105+
prometheusHost:
1106+
description: Host of user deployed prometheus
1107+
type: string
1108+
prometheusPort:
1109+
description: Port of user deployed prometheus
1110+
format: int32
1111+
maximum: 65535
1112+
minimum: 1
1113+
type: integer
1114+
prometheusTLSCaCertSecret:
1115+
description: If defined, specifies which CA certificate to use
1116+
for user deployed prometheus
1117+
nullable: true
1118+
properties:
1119+
key:
1120+
description: The key of the secret to select from. Must be
1121+
a valid secret key.
1122+
type: string
1123+
name:
1124+
description: |-
1125+
Name of the referent.
1126+
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
1127+
TODO: Add other useful fields. apiVersion, kind, uid?
1128+
type: string
1129+
optional:
1130+
description: Specify whether the Secret or its key must be
1131+
defined
1132+
type: boolean
1133+
required:
1134+
- key
1135+
type: object
1136+
x-kubernetes-map-type: atomic
11051137
rabbitMqClusterName:
11061138
default: rabbitmq
11071139
description: |-

controllers/cloudkitty_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -993,7 +993,7 @@ func (r *CloudKittyReconciler) transportURLCreateOrUpdate(
993993
) (*rabbitmqv1.TransportURL, controllerutil.OperationResult, error) {
994994
transportURL := &rabbitmqv1.TransportURL{
995995
ObjectMeta: metav1.ObjectMeta{
996-
Name: fmt.Sprintf("%s-cloudkitty-transport", instance.Name),
996+
Name: fmt.Sprintf("%s-transport", instance.Name),
997997
Namespace: instance.Namespace,
998998
Labels: serviceLabels,
999999
},

templates/cloudkitty/config/cloudkitty-api-config.json

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,24 +36,18 @@
3636
"source": "/var/lib/config-data/tls/certs/*",
3737
"dest": "/etc/pki/tls/certs/",
3838
"owner": "cloudkitty",
39-
"perm": "0440",
39+
"perm": "0640",
4040
"optional": true,
4141
"merge": true
4242
},
4343
{
4444
"source": "/var/lib/config-data/tls/private/*",
4545
"dest": "/etc/pki/tls/private/",
4646
"owner": "cloudkitty",
47-
"perm": "0400",
47+
"perm": "0600",
4848
"optional": true,
4949
"merge": true
5050
},
51-
{
52-
"source": "/var/lib/openstack/config/my.cnf",
53-
"dest": "/etc/my.cnf",
54-
"owner": "cloudkitty",
55-
"perm": "0644"
56-
},
5751
{
5852
"source": "/var/lib/config-data/mtls/certs/*",
5953
"dest": "/etc/pki/tls/certs/",
@@ -70,5 +64,17 @@
7064
"optional": true,
7165
"merge": true
7266
}
67+
],
68+
"permissions": [
69+
{
70+
"path": "/var/log/cinder",
71+
"owner": "cloudkitty:apache",
72+
"recurse": true
73+
},
74+
{
75+
"path": "/etc/httpd/run",
76+
"owner": "cloudkitty:apache",
77+
"recurse": true
78+
}
7379
]
7480
}

templates/cloudkitty/config/cloudkitty.conf

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,10 @@ backend = cloudkitty.backend.file.FileBackend
6161

6262
[storage]
6363
version = 2
64-
backend = influxdb
64+
backend = loki
65+
66+
[storage_loki]
67+
url = http://loki:3100/loki/api/v1
6568

6669
[database]
6770
connection = {{ .DatabaseConnection }}

0 commit comments

Comments
 (0)