Skip to content
Open
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
14 changes: 7 additions & 7 deletions .github/workflows/scan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@ jobs:
gosec:
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v6
- name: Security Scan
uses: securego/gosec@master
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
# we let the report trigger content trigger a failure using the GitHub Security features.
args: '-fmt sarif -out results.sarif ./...'
go-version: "1.25"
- name: Install gosec
run: go install github.com/securego/gosec/v2/cmd/gosec@v2.22.4
- name: Security Scan
run: gosec -fmt sarif -out results.sarif ./... || true
- name: Upload SARIF file
if: always()
uses: github/codeql-action/upload-sarif@v4
with:
# Path to SARIF file relative to the root of the repository
sarif_file: results.sarif
golangci:
name: lint
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.valkey
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN apk add --no-cache --virtual .build-deps \
coreutils=9.8-r1 \
linux-headers=6.16.12-r0 \
musl-dev=1.2.5-r21 \
openssl-dev=3.5.4-r0 \
openssl-dev=3.5.5-r0 \
gcc=15.2.0-r2 \
curl=8.17.0-r1 \
make=4.4.1-r3 \
Expand All @@ -20,7 +20,7 @@ RUN apk add --no-cache --virtual .build-deps \
FROM alpine:3.23.2 AS valkey

RUN apk add --no-cache \
openssl=3.5.4-r0 \
openssl=3.5.5-r0 \
ca-certificates=20251003-r0 \
coreutils=9.8-r1 \
&& addgroup -S valkey -g 1009 \
Expand Down
18 changes: 18 additions & 0 deletions api/v1/valkey_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,15 @@ type ValkeySpec struct {
// +optional
NodeSelector map[string]string `json:"nodeSelector,omitempty"`

// Modules to load at startup via loadmodule directive.
// +optional
Modules []ModuleConfig `json:"modules,omitempty"`

// ExtraConfig is appended verbatim to the end of valkey.conf.
// Use for arbitrary directives like maxmemory, save, appendonly, etc.
// +optional
ExtraConfig string `json:"extraConfig,omitempty"`

// Which endpoint is shown as the preferred endpoint valid values are 'ip', 'hostname', or 'unknown-endpoint'.
// +kubebuilder:default:="ip"
// +kubebuilder:validation:Enum=ip;hostname;unknown-endpoint
Expand All @@ -141,6 +150,15 @@ type ValkeySpec struct {
PlatformManagedSecurityContext bool `json:"platformManagedSecurityContext,omitempty"`
}

// ModuleConfig defines a Valkey module to load at startup.
type ModuleConfig struct {
// Path to the module shared library.
Path string `json:"path"`
// Args are optional arguments passed to the module at load time.
// +optional
Args []string `json:"args,omitempty"`
}

// ExternalAccess defines the external access configuration
type ExternalAccess struct {
// Enable external access
Expand Down
27 changes: 27 additions & 0 deletions api/v1/zz_generated.deepcopy.go

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

34 changes: 28 additions & 6 deletions config/crd/bases/hyperspike.io_valkeys.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,32 @@ spec:
- enabled
- type
type: object
extraConfig:
description: |-
ExtraConfig is appended verbatim to the end of valkey.conf.
Use for arbitrary directives like maxmemory, save, appendonly, etc.
type: string
image:
description: Image to use
type: string
modules:
description: Modules to load at startup via loadmodule directive.
items:
description: ModuleConfig defines a Valkey module to load at startup.
properties:
args:
description: Args are optional arguments passed to the module
at load time.
items:
type: string
type: array
path:
description: Path to the module shared library.
type: string
required:
- path
type: object
type: array
nodeSelector:
additionalProperties:
type: string
Expand Down Expand Up @@ -485,7 +508,7 @@ spec:
resources:
description: |-
resources represents the minimum resources the volume should have.
If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements
Users are allowed to specify resource requirements
that are lower than previous value but must still be higher than capacity recorded in the
status field of the claim.
More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources
Expand Down Expand Up @@ -642,8 +665,7 @@ spec:
for the purpose it was designed. For example - a controller
that\nonly is responsible for resizing capacity of the volume,
should ignore PVC updates that change other valid\nresources
associated with PVC.\n\nThis is an alpha field and requires
enabling RecoverVolumeExpansionFailure feature."
associated with PVC."
type: object
x-kubernetes-map-type: granular
allocatedResources:
Expand Down Expand Up @@ -674,8 +696,7 @@ spec:
for the purpose it was designed. For example - a controller
that\nonly is responsible for resizing capacity of the volume,
should ignore PVC updates that change other valid\nresources
associated with PVC.\n\nThis is an alpha field and requires
enabling RecoverVolumeExpansionFailure feature."
associated with PVC."
type: object
capacity:
additionalProperties:
Expand Down Expand Up @@ -795,9 +816,10 @@ spec:
operator:
description: |-
Operator represents a key's relationship to the value.
Valid operators are Exists and Equal. Defaults to Equal.
Valid operators are Exists, Equal, Lt, and Gt. Defaults to Equal.
Exists is equivalent to wildcard for value, so that a pod can
tolerate all taints of a particular category.
Lt and Gt perform numeric comparisons (requires feature gate TaintTolerationComparisonOperators).
type: string
tolerationSeconds:
description: |-
Expand Down
14 changes: 8 additions & 6 deletions internal/controller/scripts/valkey.conf
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,9 @@
#

################################## MODULES #####################################

# Load modules at startup. If the server is not able to load modules
# it will abort. It is possible to use multiple loadmodule directives.
#
# loadmodule /path/to/my_module.so
# loadmodule /path/to/other_module.so
{{ range .Spec.Modules }}
loadmodule {{ .Path }}{{ range .Args }} {{ . }}{{ end }}
{{ end }}

################################## NETWORK #####################################

Expand Down Expand Up @@ -2264,3 +2261,8 @@ jemalloc-bg-thread yes
# to suppress
#
# ignore-warnings ARM64-COW-BUG

################################## EXTRA CONFIG ################################
{{ if .Spec.ExtraConfig }}
{{ .Spec.ExtraConfig }}
{{ end }}