Skip to content

Commit 25e00cd

Browse files
authored
Define labels and annotations for NodeSet inline (#189)
1 parent b01d9bc commit 25e00cd

16 files changed

+400
-39
lines changed

api/v1alpha1/const.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ const (
4141
AnnotationSkipInitialization = "ydb.tech/skip-initialization"
4242
AnnotationDisableLivenessProbe = "ydb.tech/disable-liveness-probe"
4343
AnnotationDataCenter = "ydb.tech/data-center"
44+
AnnotationGRPCPublicHost = "ydb.tech/grpc-public-host"
4445
AnnotationNodeHost = "ydb.tech/node-host"
4546
AnnotationNodeDomain = "ydb.tech/node-domain"
4647

api/v1alpha1/databasenodeset_types.go

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,15 @@ type DatabaseNodeSetSpecInline struct {
2929
// +required
3030
Name string `json:"name,omitempty"`
3131

32-
// (Optional) Object should be reference to remote object
32+
// Labels for DatabaseNodeSet object
33+
// +optional
34+
Labels map[string]string `json:"labels,omitempty"`
35+
36+
// Annotations for DatabaseNodeSet object
37+
// +optional
38+
Annotations map[string]string `json:"annotations,omitempty"`
39+
40+
// (Optional) Object should be reference to RemoteDatabaseNodeSet object
3341
// +optional
3442
Remote *RemoteSpec `json:"remote,omitempty"`
3543

@@ -69,9 +77,10 @@ func init() {
6977
func RecastDatabaseNodeSet(databaseNodeSet *DatabaseNodeSet) *Database {
7078
return &Database{
7179
ObjectMeta: metav1.ObjectMeta{
72-
Name: databaseNodeSet.Spec.DatabaseRef.Name,
73-
Namespace: databaseNodeSet.Spec.DatabaseRef.Namespace,
74-
Labels: databaseNodeSet.Labels,
80+
Name: databaseNodeSet.Spec.DatabaseRef.Name,
81+
Namespace: databaseNodeSet.Spec.DatabaseRef.Namespace,
82+
Labels: databaseNodeSet.Labels,
83+
Annotations: databaseNodeSet.Annotations,
7584
},
7685
Spec: DatabaseSpec{
7786
DatabaseClusterSpec: databaseNodeSet.Spec.DatabaseClusterSpec,

api/v1alpha1/storagenodeset_types.go

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,19 @@ type StorageNodeSetStatus struct {
2525

2626
// StorageNodeSetSpecInline describes an group nodes object inside parent object
2727
type StorageNodeSetSpecInline struct {
28-
// Name of child *NodeSet object
28+
// Name of StorageNodeSet object
2929
// +required
3030
Name string `json:"name"`
3131

32-
// (Optional) Object should be reference to remote object
32+
// Labels for StorageNodeSet object
33+
// +optional
34+
Labels map[string]string `json:"labels,omitempty"`
35+
36+
// Annotations for StorageNodeSet object
37+
// +optional
38+
Annotations map[string]string `json:"annotations,omitempty"`
39+
40+
// (Optional) Object should be reference to RemoteStorageNodeSet object
3341
// +optional
3442
Remote *RemoteSpec `json:"remote,omitempty"`
3543

@@ -69,9 +77,10 @@ func init() {
6977
func RecastStorageNodeSet(storageNodeSet *StorageNodeSet) *Storage {
7078
return &Storage{
7179
ObjectMeta: metav1.ObjectMeta{
72-
Name: storageNodeSet.Spec.StorageRef.Name,
73-
Namespace: storageNodeSet.Spec.StorageRef.Namespace,
74-
Labels: storageNodeSet.Labels,
80+
Name: storageNodeSet.Spec.StorageRef.Name,
81+
Namespace: storageNodeSet.Spec.StorageRef.Namespace,
82+
Labels: storageNodeSet.Labels,
83+
Annotations: storageNodeSet.Annotations,
7584
},
7685
Spec: StorageSpec{
7786
StorageClusterSpec: storageNodeSet.Spec.StorageClusterSpec,

api/v1alpha1/zz_generated.deepcopy.go

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

deploy/ydb-operator/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 0.5.1
18+
version: 0.5.2
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to
2222
# follow Semantic Versioning. They should reflect the version the application is using.
2323
# It is recommended to use it with quotes.
24-
appVersion: "0.5.1"
24+
appVersion: "0.5.2"

deploy/ydb-operator/crds/database.yaml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3154,6 +3154,16 @@ spec:
31543154
type: array
31553155
type: object
31563156
type: object
3157+
annotations:
3158+
additionalProperties:
3159+
type: string
3160+
description: Annotations for DatabaseNodeSet object
3161+
type: object
3162+
labels:
3163+
additionalProperties:
3164+
type: string
3165+
description: Labels for DatabaseNodeSet object
3166+
type: object
31573167
name:
31583168
description: Name of DatabaseNodeSet object
31593169
type: string
@@ -3173,7 +3183,7 @@ spec:
31733183
description: (Optional) If specified, the pod's priorityClassName.
31743184
type: string
31753185
remote:
3176-
description: (Optional) Object should be reference to remote
3186+
description: (Optional) Object should be reference to RemoteDatabaseNodeSet
31773187
object
31783188
properties:
31793189
cluster:

deploy/ydb-operator/crds/storage.yaml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4289,6 +4289,11 @@ spec:
42894289
type: array
42904290
type: object
42914291
type: object
4292+
annotations:
4293+
additionalProperties:
4294+
type: string
4295+
description: Annotations for StorageNodeSet object
4296+
type: object
42924297
dataStore:
42934298
description: (Optional) Where cluster data should be kept
42944299
items:
@@ -4507,8 +4512,13 @@ spec:
45074512
description: '(Optional) Whether host network should be enabled.
45084513
Default: false'
45094514
type: boolean
4515+
labels:
4516+
additionalProperties:
4517+
type: string
4518+
description: Labels for StorageNodeSet object
4519+
type: object
45104520
name:
4511-
description: Name of child *NodeSet object
4521+
description: Name of StorageNodeSet object
45124522
type: string
45134523
nodeSelector:
45144524
additionalProperties:
@@ -4526,7 +4536,7 @@ spec:
45264536
description: (Optional) If specified, the pod's priorityClassName.
45274537
type: string
45284538
remote:
4529-
description: (Optional) Object should be reference to remote
4539+
description: (Optional) Object should be reference to RemoteStorageNodeSet
45304540
object
45314541
properties:
45324542
cluster:

0 commit comments

Comments
 (0)