Skip to content

Comments

Added Initial TLS support for ValkeyCluster#91

Draft
sandeepkunusoth wants to merge 5 commits intovalkey-io:mainfrom
sandeepkunusoth:tls_initial_version
Draft

Added Initial TLS support for ValkeyCluster#91
sandeepkunusoth wants to merge 5 commits intovalkey-io:mainfrom
sandeepkunusoth:tls_initial_version

Conversation

@sandeepkunusoth
Copy link
Member

This PR adds initial TLS support to the Valkey Cluster, fixes #59. TLS enabled for ValkeyCluster using pre-created / existing Kubernetes Secrets. Updated e2e tests to test TLS.

Followup features not included in this PR:

  • Automatic certificate provisioning using cert-manager
  • Certificate rotation on renewal.

Signed-off-by: Sandeep Kunusoth <sandeepkunsoth000@gmail.com>
Signed-off-by: Sandeep Kunusoth <sandeepkunsoth000@gmail.com>
Signed-off-by: Sandeep Kunusoth <sandeepkunsoth000@gmail.com>
Signed-off-by: Sandeep Kunusoth <sandeepkunsoth000@gmail.com>
Signed-off-by: Sandeep Kunusoth <sandeepkunsoth000@gmail.com>
return &tls.Config{
Certificates: []tls.Certificate{cert},
RootCAs: caCertPool,
InsecureSkipVerify: true,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we aim to remove InsecureSkipVerify soon? Or should it be configurable?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i tried removing it. getting connection errors due to cert validation will check on this. the same works from valkey-cli but go client throws error

Enabled bool `json:"enabled,omitempty"`

// Name of the Secret containing TLS keys
ExistingSecret string `json:"existingSecret,omitempty"`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we use the name "existing" here, will the cert-manager create a separate secret which it updates?
Or it named so that a user should know that is needs to exist?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we can change ExistingSecret to secretRef so that it can be used for both exisiting secret or secret generated by Certificate CRD.


envVars = append(envVars, corev1.EnvVar{
Name: "VALKEY_TLS_ARGS",
Value: fmt.Sprintf("--tls --cert %s --key %s --cacert %s", certPath, keyPath, caPath),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, we don't need --insecure here but we have InsecureSkipVerify=true?

@sandeepkunusoth sandeepkunusoth marked this pull request as draft February 24, 2026 01:57
@sandeepkunusoth sandeepkunusoth marked this pull request as draft February 24, 2026 01:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(feat) TLS support for ValkeyCluster

2 participants