Skip to content

Add modules and extraConfig fields to Valkey CRD#396

Open
chistopat wants to merge 5 commits intohyperspike:mainfrom
kailas-cloud:feature/modules-extraconfig
Open

Add modules and extraConfig fields to Valkey CRD#396
chistopat wants to merge 5 commits intohyperspike:mainfrom
kailas-cloud:feature/modules-extraconfig

Conversation

@chistopat
Copy link
Copy Markdown

Summary

  • Add ModuleConfig type and modules/extraConfig fields to ValkeySpec
  • Template valkey.conf renders loadmodule directives from .Spec.Modules
  • Append arbitrary config via .Spec.ExtraConfig at the end of valkey.conf
  • Update Alpine package pins (openssl 3.5.4 -> 3.5.5)
  • Fix gosec CI: replace Docker action with go install to fix invalid SARIF output

Motivation

Currently there's no way to load Valkey modules (like valkey-search) or set arbitrary config directives through the CRD. Users have to build custom images with baked-in configuration and hack entrypoint scripts.

These two fields solve it declaratively:

spec:
  modules:
    - path: /usr/lib/valkey/libsearch.so
      args: ["--use-coordinator"]
  extraConfig: |
    maxmemory 2048mb
    maxmemory-policy noeviction

Changes

  • api/v1/valkey_types.go — new ModuleConfig type + 2 fields in ValkeySpec
  • internal/controller/scripts/valkey.conf — template directives for modules and extraConfig
  • api/v1/zz_generated.deepcopy.go — auto-generated
  • config/crd/bases/hyperspike.io_valkeys.yaml — auto-generated

No controller changes needed — upsertConfigMap already passes the full Valkey object to the template.

Test plan

  • go build ./...
  • go test ./...
  • make generate + make manifests
  • CRD yaml contains new fields
  • CI: build, test, lint pass

Support loading Valkey modules via loadmodule directive and appending
arbitrary configuration to valkey.conf through the custom resource spec.
Dockerfile.valkey: remove exact version pins that break when Alpine
updates packages (openssl 3.5.4 -> 3.5.5).

scan.yaml: pin gosec to v2.22.4 instead of master to avoid
invalid SARIF output from unreleased versions.
Dockerfile.valkey: add hadolint ignore for DL3018 since exact Alpine
package pins break on every minor update.

scan.yaml: replace gosec Docker action with go install to avoid
broken SARIF output from the container image.
openssl 3.5.4-r0 -> 3.5.5-r0, openssl-dev 3.5.4-r0 -> 3.5.5-r0
@chistopat
Copy link
Copy Markdown
Author

@dmolik review it please

@chistopat chistopat force-pushed the feature/modules-extraconfig branch from 0361db7 to 2fc8e24 Compare February 21, 2026 16:28
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.

1 participant