Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add TLS support for status service #215

Merged
merged 9 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion api/v1alpha1/database_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,5 +268,6 @@ func init() {
func (r *Database) AnyCertificatesAdded() bool {
return len(r.Spec.CABundle) > 0 ||
r.Spec.Service.GRPC.TLSConfiguration.Enabled ||
r.Spec.Service.Interconnect.TLSConfiguration.Enabled
r.Spec.Service.Interconnect.TLSConfiguration.Enabled ||
r.Spec.Service.Status.TLSConfiguration.Enabled
}
4 changes: 4 additions & 0 deletions api/v1alpha1/database_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ func (r *DatabaseDefaulter) Default(ctx context.Context, obj runtime.Object) err
database.Spec.Service.Datastreams.TLSConfiguration = &TLSConfiguration{Enabled: false}
}

if database.Spec.Service.Status.TLSConfiguration == nil {
database.Spec.Service.Status.TLSConfiguration = &TLSConfiguration{Enabled: false}
}

if database.Spec.Domain == "" {
database.Spec.Domain = DefaultDatabaseDomain
}
Expand Down
2 changes: 2 additions & 0 deletions api/v1alpha1/service_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ type InterconnectService struct {

type StatusService struct {
Service `json:""`

TLSConfiguration *TLSConfiguration `json:"tls,omitempty"`
}

type DatastreamsService struct {
Expand Down
3 changes: 2 additions & 1 deletion api/v1alpha1/storage_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,5 +242,6 @@ func init() {
func (r *Storage) AnyCertificatesAdded() bool {
return len(r.Spec.CABundle) > 0 ||
r.Spec.Service.GRPC.TLSConfiguration.Enabled ||
r.Spec.Service.Interconnect.TLSConfiguration.Enabled
r.Spec.Service.Interconnect.TLSConfiguration.Enabled ||
r.Spec.Service.Status.TLSConfiguration.Enabled
}
4 changes: 4 additions & 0 deletions api/v1alpha1/storage_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ func (r *StorageDefaulter) Default(ctx context.Context, obj runtime.Object) erro
storage.Spec.Service.Interconnect.TLSConfiguration = &TLSConfiguration{Enabled: false}
}

if storage.Spec.Service.Status.TLSConfiguration == nil {
storage.Spec.Service.Status.TLSConfiguration = &TLSConfiguration{Enabled: false}
}

if storage.Spec.Monitoring == nil {
storage.Spec.Monitoring = &MonitoringOptions{
Enabled: false,
Expand Down
5 changes: 5 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions deploy/ydb-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.5.13
version: 0.5.14

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.5.13"
appVersion: "0.5.14"
64 changes: 64 additions & 0 deletions deploy/ydb-operator/crds/database.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3994,6 +3994,70 @@ spec:
description: IPFamilyPolicy represents the dual-stack-ness
requested or required by a Service
type: string
tls:
properties:
CA:
description: SecretKeySelector selects a key of a Secret.
properties:
key:
description: The key of the secret to select from. Must
be a valid secret key.
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind,
uid?'
type: string
optional:
description: Specify whether the Secret or its key
must be defined
type: boolean
required:
- key
type: object
certificate:
description: SecretKeySelector selects a key of a Secret.
properties:
key:
description: The key of the secret to select from. Must
be a valid secret key.
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind,
uid?'
type: string
optional:
description: Specify whether the Secret or its key
must be defined
type: boolean
required:
- key
type: object
enabled:
type: boolean
key:
description: SecretKeySelector selects a key of a Secret.
properties:
key:
description: The key of the secret to select from. Must
be a valid secret key.
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind,
uid?'
type: string
optional:
description: Specify whether the Secret or its key
must be defined
type: boolean
required:
- key
type: object
required:
- enabled
type: object
type: object
type: object
sharedResources:
Expand Down
64 changes: 64 additions & 0 deletions deploy/ydb-operator/crds/databasenodeset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2699,6 +2699,70 @@ spec:
description: IPFamilyPolicy represents the dual-stack-ness
requested or required by a Service
type: string
tls:
properties:
CA:
description: SecretKeySelector selects a key of a Secret.
properties:
key:
description: The key of the secret to select from. Must
be a valid secret key.
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind,
uid?'
type: string
optional:
description: Specify whether the Secret or its key
must be defined
type: boolean
required:
- key
type: object
certificate:
description: SecretKeySelector selects a key of a Secret.
properties:
key:
description: The key of the secret to select from. Must
be a valid secret key.
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind,
uid?'
type: string
optional:
description: Specify whether the Secret or its key
must be defined
type: boolean
required:
- key
type: object
enabled:
type: boolean
key:
description: SecretKeySelector selects a key of a Secret.
properties:
key:
description: The key of the secret to select from. Must
be a valid secret key.
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind,
uid?'
type: string
optional:
description: Specify whether the Secret or its key
must be defined
type: boolean
required:
- key
type: object
required:
- enabled
type: object
type: object
type: object
sharedResources:
Expand Down
64 changes: 64 additions & 0 deletions deploy/ydb-operator/crds/remotedatabasenodeset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2700,6 +2700,70 @@ spec:
description: IPFamilyPolicy represents the dual-stack-ness
requested or required by a Service
type: string
tls:
properties:
CA:
description: SecretKeySelector selects a key of a Secret.
properties:
key:
description: The key of the secret to select from. Must
be a valid secret key.
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind,
uid?'
type: string
optional:
description: Specify whether the Secret or its key
must be defined
type: boolean
required:
- key
type: object
certificate:
description: SecretKeySelector selects a key of a Secret.
properties:
key:
description: The key of the secret to select from. Must
be a valid secret key.
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind,
uid?'
type: string
optional:
description: Specify whether the Secret or its key
must be defined
type: boolean
required:
- key
type: object
enabled:
type: boolean
key:
description: SecretKeySelector selects a key of a Secret.
properties:
key:
description: The key of the secret to select from. Must
be a valid secret key.
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind,
uid?'
type: string
optional:
description: Specify whether the Secret or its key
must be defined
type: boolean
required:
- key
type: object
required:
- enabled
type: object
type: object
type: object
sharedResources:
Expand Down
64 changes: 64 additions & 0 deletions deploy/ydb-operator/crds/remotestoragenodeset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2710,6 +2710,70 @@ spec:
description: IPFamilyPolicy represents the dual-stack-ness
requested or required by a Service
type: string
tls:
properties:
CA:
description: SecretKeySelector selects a key of a Secret.
properties:
key:
description: The key of the secret to select from. Must
be a valid secret key.
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind,
uid?'
type: string
optional:
description: Specify whether the Secret or its key
must be defined
type: boolean
required:
- key
type: object
certificate:
description: SecretKeySelector selects a key of a Secret.
properties:
key:
description: The key of the secret to select from. Must
be a valid secret key.
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind,
uid?'
type: string
optional:
description: Specify whether the Secret or its key
must be defined
type: boolean
required:
- key
type: object
enabled:
type: boolean
key:
description: SecretKeySelector selects a key of a Secret.
properties:
key:
description: The key of the secret to select from. Must
be a valid secret key.
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind,
uid?'
type: string
optional:
description: Specify whether the Secret or its key
must be defined
type: boolean
required:
- key
type: object
required:
- enabled
type: object
type: object
type: object
storageRef:
Expand Down
Loading
Loading