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

Expose Medusas ssl_verify option #1166

Merged
merged 3 commits into from
Jan 15, 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
8 changes: 5 additions & 3 deletions CHANGELOG/CHANGELOG-1.12.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ Changelog for the K8ssandra Operator, new PRs should update the `unreleased` sec
When cutting a new release, update the `unreleased` heading to the tag being generated and date, like `## vX.Y.Z - YYYY-MM-DD` and create a new placeholder section for `unreleased` entries.

## unreleased
* [ENHANCEMENT] [#1160](https://github.com/k8ssandra/k8ssandra-operator/issues/1160) Allow disabling Reaper front-end auth.
- [ENHANCEMENT] [#1115](https://github.com/k8ssandra/k8ssandra-operator/issues/1115) Add a validation check for the projected pod names length

* [CHANGE] [#1050](https://github.com/k8ssandra/k8ssandra-operator/issues/1050) Remove unnecessary requeues in the Medusa controllers
* [ENHANCEMENT] [#1161](https://github.com/k8ssandra/k8ssandra-operator/issues/1161) Update cass-operator Helm chart to 0.46.1. Adds containerPort for cass-operator metrics and changes cass-config-builder base from UBI7 to UBI8
* [CHANGE] [#1165](https://github.com/k8ssandra/k8ssandra-operator/issues/1165) Upgrade to Medusa v0.17.1
* [FEATURE] [#1165](https://github.com/k8ssandra/k8ssandra-operator/issues/1165) Expose Medusa ssl_verify option to allow disabling cert verification for some on prem S3 compatible systems
* [ENHANCEMENT] [#1115](https://github.com/k8ssandra/k8ssandra-operator/issues/1115) Add a validation check for the projected pod names length
* [ENHANCEMENT] [#1161](https://github.com/k8ssandra/k8ssandra-operator/issues/1161) Update cass-operator Helm chart to 0.46.1. Adds containerPort for cass-operator metrics and changes cass-config-builder base from UBI7 to UBI8
4 changes: 4 additions & 0 deletions apis/medusa/v1alpha1/medusa_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ type Storage struct {
// +optional
Secure bool `json:"secure,omitempty"`

// When using SSL, whether to also verify the certificate.
// +optional
SslVerify bool `json:"sslVerify,omitempty"`

// Age after which orphan sstables can be deleted from the storage backend.
// Protects from race conditions between purge and ongoing backups.
// Defaults to 10 days.
Expand Down
3 changes: 3 additions & 0 deletions config/crd/bases/k8ssandra.io_k8ssandraclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27399,6 +27399,9 @@ spec:
secure:
description: Whether to use SSL for the storage backend.
type: boolean
sslVerify:
description: When using SSL, whether to also verify the certificate.
type: boolean
storageProvider:
description: The storage backend to use for the backups.
enum:
Expand Down
7 changes: 6 additions & 1 deletion pkg/medusa/reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
const (
DefaultMedusaImageRepository = "k8ssandra"
DefaultMedusaImageName = "medusa"
DefaultMedusaVersion = "0.17.0"
DefaultMedusaVersion = "0.17.1"
DefaultMedusaPort = 50051
DefaultProbeInitialDelay = 10
DefaultProbeTimeout = 1
Expand Down Expand Up @@ -88,6 +88,11 @@ func CreateMedusaIni(kc *k8ss.K8ssandraCluster) string {
{{- else }}
secure = True
{{- end }}
{{- if not .Spec.Medusa.StorageProperties.SslVerify }}
ssl_verify = False
{{- else }}
ssl_verify = True
{{- end }}
{{- if .Spec.Medusa.StorageProperties.BackupGracePeriodInDays }}
backup_grace_period_in_days = {{ .Spec.Medusa.StorageProperties.BackupGracePeriodInDays }}
{{- end }}
Expand Down
3 changes: 3 additions & 0 deletions pkg/medusa/reconcile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ func testMedusaIniSecured(t *testing.T) {
Region: "us-east-1",
Port: 9001,
Secure: true,
SslVerify: true,
BackupGracePeriodInDays: 7,
},
CassandraUserSecretRef: corev1.LocalObjectReference{
Expand All @@ -212,6 +213,7 @@ func testMedusaIniSecured(t *testing.T) {
assert.Contains(t, medusaIni, "region = us-east-1")
assert.Contains(t, medusaIni, "port = 9001")
assert.Contains(t, medusaIni, "secure = True")
assert.Contains(t, medusaIni, "ssl_verify = True")
assert.Contains(t, medusaIni, "backup_grace_period_in_days = 7")
}

Expand Down Expand Up @@ -276,6 +278,7 @@ func testMedusaIniUnsecured(t *testing.T) {
assert.Contains(t, medusaIni, "region = us-east-1")
assert.Contains(t, medusaIni, "port = 9001")
assert.Contains(t, medusaIni, "secure = True")
assert.Contains(t, medusaIni, "ssl_verify = False")
assert.Contains(t, medusaIni, "backup_grace_period_in_days = 7")
}

Expand Down
Loading