Skip to content

Commit e38757b

Browse files
authored
Merge pull request #11 from vyzigold/add-LokiStackSize
Add lokiStackSize field to CK CRD
2 parents 6e04e04 + 8f3eb14 commit e38757b

File tree

6 files changed

+55
-1
lines changed

6 files changed

+55
-1
lines changed

api/bases/telemetry.openstack.org_cloudkitties.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,17 @@ spec:
507507
Right now required by the maridb-operator to get the credentials from the instance to create the DB
508508
Might not be required in future
509509
type: string
510+
lokiStackSize:
511+
default: 1x.demo
512+
description: Size of the LokiStack. Supported are "1x.demo" (default),
513+
"1x.pico", "1x.extra-small", "1x.small", "1x.medium"
514+
enum:
515+
- 1x.demo
516+
- 1x.pico
517+
- 1x.extra-small
518+
- 1x.small
519+
- 1x.medium
520+
type: string
510521
memcachedInstance:
511522
default: memcached
512523
description: Memcached instance name.

api/bases/telemetry.openstack.org_telemetries.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1072,6 +1072,17 @@ spec:
10721072
description: Enabled - Whether OpenStack CloudKitty service should
10731073
be deployed and managed
10741074
type: boolean
1075+
lokiStackSize:
1076+
default: 1x.demo
1077+
description: Size of the LokiStack. Supported are "1x.demo" (default),
1078+
"1x.pico", "1x.extra-small", "1x.small", "1x.medium"
1079+
enum:
1080+
- 1x.demo
1081+
- 1x.pico
1082+
- 1x.extra-small
1083+
- 1x.small
1084+
- 1x.medium
1085+
type: string
10751086
memcachedInstance:
10761087
default: memcached
10771088
description: Memcached instance name.

api/v1beta1/cloudkitty_types.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,12 @@ type CloudKittySpecBase struct {
199199
// Storage class used for Loki
200200
// +kubebuilder:validation:Optional
201201
StorageClass string `json:"storageClass,omitempty"`
202+
203+
// Size of the LokiStack. Supported are "1x.demo" (default), "1x.pico", "1x.extra-small", "1x.small", "1x.medium"
204+
// +kubebuilder:validation:Optional
205+
// +kubebuilder:validation:Enum="1x.demo";"1x.pico";"1x.extra-small";"1x.small";"1x.medium"
206+
// +kubebuilder:default="1x.demo"
207+
LokiStackSize string `json:"lokiStackSize"`
202208
}
203209

204210
// CloudKittySpecCore the same as CloudKittySpec without ContainerImage references

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,17 @@ spec:
507507
Right now required by the maridb-operator to get the credentials from the instance to create the DB
508508
Might not be required in future
509509
type: string
510+
lokiStackSize:
511+
default: 1x.demo
512+
description: Size of the LokiStack. Supported are "1x.demo" (default),
513+
"1x.pico", "1x.extra-small", "1x.small", "1x.medium"
514+
enum:
515+
- 1x.demo
516+
- 1x.pico
517+
- 1x.extra-small
518+
- 1x.small
519+
- 1x.medium
520+
type: string
510521
memcachedInstance:
511522
default: memcached
512523
description: Memcached instance name.

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1072,6 +1072,17 @@ spec:
10721072
description: Enabled - Whether OpenStack CloudKitty service should
10731073
be deployed and managed
10741074
type: boolean
1075+
lokiStackSize:
1076+
default: 1x.demo
1077+
description: Size of the LokiStack. Supported are "1x.demo" (default),
1078+
"1x.pico", "1x.extra-small", "1x.small", "1x.medium"
1079+
enum:
1080+
- 1x.demo
1081+
- 1x.pico
1082+
- 1x.extra-small
1083+
- 1x.small
1084+
- 1x.medium
1085+
type: string
10751086
memcachedInstance:
10761087
default: memcached
10771088
description: Memcached instance name.

pkg/cloudkitty/lokistack.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,10 @@ func LokiStack(
119119
if err != nil {
120120
return nil, err
121121
}
122+
size := "1x.demo"
123+
if instance.Spec.LokiStackSize != "" {
124+
size = instance.Spec.LokiStackSize
125+
}
122126
lokiStack := &lokistackv1.LokiStack{
123127
ObjectMeta: metav1.ObjectMeta{
124128
Name: fmt.Sprintf("%s-lokistack", instance.Name),
@@ -128,7 +132,7 @@ func LokiStack(
128132
Spec: lokistackv1.LokiStackSpec{
129133
// TODO: What size do we even want? I assume something
130134
// smallish since only rating interact with this
131-
Size: lokistackv1.LokiStackSizeType("1x.demo"),
135+
Size: lokistackv1.LokiStackSizeType(size),
132136
Storage: getLokiStackObjectStorageSpec(instance.Spec.S3StorageConfig),
133137
StorageClassName: instance.Spec.StorageClass,
134138
Tenants: &lokistackv1.TenantsSpec{

0 commit comments

Comments
 (0)