Skip to content

feat(operator): add LDAP authentication via auth sidecar - #635

Open
tjovicic wants to merge 1 commit into
mainfrom
feat/ldap-authentication
Open

tjovicic wants to merge 1 commit into
mainfrom
feat/ldap-authentication

Conversation

@tjovicic

Copy link
Copy Markdown
Contributor

Add spec.authentication.ldap. When set, the operator adds the auth sidecar container to every Dragonfly pod and starts Dragonfly with --auth_validate pointing at it.

@tjovicic
tjovicic requested review from Abhra303 and a balanced review from Copilot November 27, 2026 09:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Invalid embedded-field initializers prevent the operator and tests from compiling, while inconsistent port overrides break delegated authentication and the sample exposes LDAP credentials over an unencrypted connection.

4 open issues
1 file not reviewed
  • api/v1alpha1/zz_generated.deepcopy.go: Generated file
What changed in this PR

Adds LDAP authentication to operator-managed Dragonfly deployments through spec.authentication.ldap, wiring each pod to an authentication sidecar.

Changes:

  • Adds LDAP API fields and updates generated schemas and deep-copy support.
  • Generates the sidecar, configuration, health probes, and Dragonfly authentication flags.
  • Adds resource-generation tests, setup documentation, and an example.
File Description
README.md Documents LDAP configuration and ACL requirements.
manifests/​dragonfly-operator.yaml Includes LDAP schema in the bundled installation manifest.
manifests/​crd.yaml Adds LDAP fields to the standalone CRD.
internal/​resources/​version.go Defines the default sidecar image version.
internal/​resources/​resources.go Generates the sidecar and authentication wiring.
internal/​resources/​resources_test.go Tests sidecar generation, defaults, and overrides.
internal/​resources/​const.go Defines sidecar and authentication constants.
config/​samples/​v1alpha1_dragonfly_ldap.yaml Demonstrates LDAP configuration and Secrets.
config/​crd/​bases/​dragonflydb.io_dragonflies.yaml Adds the generated LDAP schema.
charts/​dragonfly-operator/​templates/​crds.yaml Exposes LDAP configuration through Helm’s CRD.
api/​v1alpha1/​zz_generated.deepcopy.go Adds deep-copy support for LDAP settings.
api/​v1alpha1/​dragonfly_types.go Defines the LDAP authentication API.

Review effort: Balanced

Comment on lines +736 to +739
HTTPGet: &corev1.HTTPGetAction{
Path: "/healthz",
Port: intstr.FromInt32(AuthSidecarPort),
},
Name: "LDAP_SEARCH_BIND_PASSWORD",
ValueFrom: &corev1.EnvVarSource{
SecretKeyRef: &corev1.SecretKeySelector{
Name: "ldap-bind",
key: acl
authentication:
ldap:
server: ldap://openldap.default.svc:389
Image: image,
// On a duplicate name the kubelet uses the last entry, so the user's
// variables override the ones above.
Env: append(env, ldap.Env...),
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.

2 participants