Skip to content

feat(k8s): turn off the valkey-devops default user #6600

Open

Description

@dan-petty

Update 2026-11-26 (infra move): the ACL line is product code, and the manifest is in dan-petty/homelab.

Change user default on in DEVOPS_CACHE_VALKEY_ACL_TEMPLATE (src/devops_cli/k8s/cluster_secrets.py), then push Secret llm/valkey-devops-auth and restart the pod. k8s/llm/valkey-devops.yaml is in homelab; its exporter already uses user metrics. No role user of the template may run ACL LIST: plan that check.


Problem

#4704 gives valkey-devops one ACL user for each role. Argo CD applies the aclfile at the merge, but a Service image that sends valkey.username runs only after a release. With user default off, each cache client fails AUTH until that release, for example mcp-server and the CronJob. So #4704 keeps the default user on (owner answer on #4624, 2026-11-21).

While the default user is on, a pod with the shared password can read every key of valkey-devops.

Scope

  • After a release with valkey.username support runs in the cluster, set user default off in the aclfile of valkey-devops (DEVOPS_CACHE_VALKEY_ACL_TEMPLATE in src/devops_cli/k8s/cluster_secrets.py).
  • Before the change, an agent checks that each client of valkey-devops connects with a role user.

Acceptance criteria

  • Before the merge: valkey-cli CLIENT LIST shows no client with user=default, except the check itself. Before it runs a command in the valkey-devops pod, the agent checks the memory headroom of the pod.
  • After the merge: ACL LIST, with the passwords masked, holds user default off.
  • After the merge: a connection with no user name and the old shared password is refused.
  • After the merge: no client of valkey-devops logs an AUTH failure (WRONGPASS or NOAUTH) in 24 hours.

Dependencies

Alternatives check of 2026-11-27: in-use.
The repository already uses this tool.
Tool: valkey-io/valkey (https://github.com/valkey-io/valkey), BSD-3-Clause, last activity 2026-11-27, maintained.
Reason: Searches found no tool that turns off a default user in a manifest-embedded aclfile; valkey-cli covers only the live ACL LIST, CLIENT LIST and refused-AUTH checks, while the template edit, memory check and 24-hour log watch stay manual.

Covers:

  • ACL LIST shows each user and whether default is off
  • CLIENT LIST shows the user of each connected client
  • ACL SETUSER can turn the default user off at runtime
  • AUTH with no user name fails against a disabled user

Lacks:

  • Applies no change to DEVOPS_CACHE_VALKEY_ACL_TEMPLATE or the homelab manifest
  • Reads no pod memory headroom before a command runs
  • Watches no 24 hours of WRONGPASS or NOAUTH log lines
  • Declarative ACL users need an operator deployment that this plain Deployment lacks

Proposed design

Problem statement

The aclfile of valkey-devops keeps default on with every key pattern and command. A pod with the shared password reads and writes every key. This change turns default off in DEVOPS_CACHE_VALKEY_ACL_TEMPLATE. It adds tests that no role user can run ACL LIST.

Acceptance criteria

Requirement: Default user off

DEVOPS_CACHE_VALKEY_ACL_TEMPLATE SHALL render a line that starts with user default off and SHALL render no line that starts with user default on.

Scenario: The template renders the default user off

  • WHEN A test formats DEVOPS_CACHE_VALKEY_ACL_TEMPLATE with a fixed value for each field
  • THEN One line starts with user default off, no line starts with user default on, and the default line holds no ~ key pattern and no + command

Requirement: No role user runs ACL LIST

The template MUST grant the ACL command to no user other than default.

Scenario: The role lines hold no ACL command

  • WHEN A test formats DEVOPS_CACHE_VALKEY_ACL_TEMPLATE with a fixed value for each field
  • THEN No line for sweep, brain, agent or metrics holds +acl or +acl|list, and each line that holds +@all also holds -@dangerous

Requirement: The row keeps the derived aclfile

The row llm/valkey-devops-auth of CLUSTER_SECRETS MUST derive key users.acl from DEVOPS_CACHE_VALKEY_ACL_TEMPLATE and MUST keep deployment/valkey-devops in restarts.

Scenario: The row derives users.acl and restarts the Deployment

  • WHEN A test reads CLUSTER_SECRETS for the row llm/valkey-devops-auth
  • THEN The users.acl entry holds a DerivedSource with that template, and restarts holds deployment/valkey-devops

Requirement: Pending a person after the merge

Before the Secret push, each client of valkey-devops MUST show a user other than default.

Scenario: CLIENT LIST shows no default client

  • WHEN A person checks the memory headroom of the pod and runs kubectl -n llm exec deploy/valkey-devops -c valkey -- valkey-cli --user metrics --pass "$VALKEY_METRICS_PASSWORD" CLIENT LIST
  • THEN Each line holds a user= value other than default

Requirement: Pending a person after the merge

After the push, the aclfile that the pod mounts MUST hold user default off.

Scenario: The pushed aclfile holds user default off

  • WHEN After the push, a person runs kubectl -n llm get secret valkey-devops-auth -o jsonpath='{.data.users\.acl}' | base64 -d
  • THEN The output holds one line that starts with user default off and no line that starts with user default on

Requirement: Pending a person after the merge

After the push, a connection with no user name and the old shared password MUST fail.

Scenario: The shared password alone gets WRONGPASS

  • WHEN After the push, a person runs kubectl -n llm exec deploy/valkey-devops -c valkey -- valkey-cli -a "$VALKEY_PASSWORD" PING
  • THEN The server replies -WRONGPASS invalid username-password pair or user is disabled.

Requirement: Pending a person after the merge

After the push, no client of valkey-devops MUST log an AUTH failure for 24 hours.

Scenario: 24 hours of Loki lines hold no AUTH failure

  • WHEN 24 hours after the push, a person runs uv run devops k8s logs --query '{namespace=~"devops|llm"} |~ "WRONGPASS|NOAUTH"' --since=24h
  • THEN The query prints no log line

Existing Tool Considered

The alternatives check of 2026-11-27 in the issue body records the verdict in-use for valkey-io/valkey (https://github.com/valkey-io/valkey), BSD-3-Clause, maintained. The repository already uses the tool. The block lists what the tool covers and lacks. This change edits DEVOPS_CACHE_VALKEY_ACL_TEMPLATE and adds source tests. A person runs the live checks. The change builds no tool, so the cost to build is zero tokens and no code needs keeping.

Key questions

  • Which file holds the ACL users of valkey-devops?: src/devops_cli/k8s/cluster_secrets.py. DEVOPS_CACHE_VALKEY_ACL_TEMPLATE at line 61 holds the five user lines. _DEVOPS_CACHE_VALKEY_ACL renders them into key users.acl of Secret llm/valkey-devops-auth. [sources: src/devops_cli/k8s/cluster_secrets.py:61, src/devops_cli/k8s/cluster_secrets.py]
  • Does this change edit a Kubernetes manifest?: No. devops-cli holds no environment tree. The manifest k8s/llm/valkey-devops.yaml is in dan-petty/homelab. This change edits the product template only, so no kubectl kustomize render applies. [sources: CONTEXT.md, src/devops_cli/k8s/cluster_secrets.py]
  • What does the default line hold after the change?: user default off >{password}. The line holds no key pattern and no command. The password field stays, so the input password of _DEVOPS_CACHE_VALKEY_ACL stays used and key password of the Secret keeps its meaning. (best practice) [sources: src/devops_cli/k8s/cluster_secrets.py:62, src/devops_cli/k8s/cluster_secrets.py]
    • Chosen: user default off >{password}. The password field stays used, and the disabled user keeps no key pattern and no command.
    • Rejected: user default off with no password. The input password of the derived source becomes unused while key password must stay in the Secret.
    • Rejected: Keep user default on >{password} ~* &* +@all. The item exists to turn the default user off.
  • How does the template keep every role user from running ACL LIST?: A source test formats the template. It asserts that no line for sweep, brain, agent or metrics holds +acl or +acl|list, and that each line with +@all also holds -@dangerous. The live check reads key users.acl of the Secret, because no role user holds the ACL command. (best practice) [sources: src/devops_cli/k8s/cluster_secrets.py:62-66]
    • Chosen: Source test of the template and a read of the Secret key. The test checks the product template offline, and the Secret read needs no ACL command.
    • Rejected: Give a role user +acl|list. It grants an admin command to a role user.
    • Rejected: Run ACL LIST as default. The change turns default off, so it cannot authenticate after the push.
  • Which command audits the clients before the Secret push?: kubectl -n llm exec deploy/valkey-devops -c valkey -- valkey-cli --user metrics --pass "$VALKEY_METRICS_PASSWORD" CLIENT LIST. Each line holds a user= value other than default. The audit runs before the push, because the current metrics line holds +client|list and the check needs that command. (best practice) [sources: src/devops_cli/k8s/cluster_secrets.py:66]
    • Chosen: CLIENT LIST as metrics before the push. The current metrics line holds +client|list, and each line names the user of a client.
    • Rejected: CLIENT LIST as sweep. sweep holds -@dangerous, so an admin command can fail.
    • Rejected: ACL LIST. No role user holds the ACL command, so it fails with NOPERM.
  • How does the changed aclfile reach the running server?: A person runs uv run devops k8s push-secrets --only llm/valkey-devops-auth after the release. The row names deployment/valkey-devops in restarts, so the push restarts the pod. The server loads the mounted aclfile at its start. (best practice) [sources: src/devops_cli/k8s/cluster_secrets.py]
    • Chosen: Push the Secret and restart the Deployment. The pod mounts key users.acl as its aclfile, so a restart loads the new rules.
    • Rejected: Run ACL SETUSER in the pod. The next start of the pod loads the old file again.
  • Does feat(k8s): give valkey-devops one ACL user for each role #4704 remain a dependency?: No. The template at src/devops_cli/k8s/cluster_secrets.py:61 already holds the sweep, brain, agent and metrics users of feat(k8s): give valkey-devops one ACL user for each role #4704. The release with valkey.username support remains a suspected block. [sources: src/devops_cli/k8s/cluster_secrets.py:61]
  • Can the implement job run the live cluster checks?: No. The runner pod holds no Kubernetes token. A person runs the live checks from a host with cluster access. [sources: CONTEXT.md]
  • Which command reads 24 hours of AUTH failures?: uv run devops k8s logs --query '{namespace=~"devops|llm"} |~ "WRONGPASS|NOAUTH"' --since=24h, the LogQL client of the repository. It reads the log lines of namespace devops, where the Service runs, and of namespace llm, where the exporter runs. (best practice) [sources: docs/CLI_REFERENCE.md]
    • Chosen: devops k8s logs. The repository maintains and documents this LogQL client, and it sends the query to Loki.
    • Rejected: kubectl logs --since=24h. A pod keeps no log across a restart, and the pod of a Job is gone before 24 hours end.

Fit

Fits in one pull request.

Suspected block

The release that carries the valkey.username client support must run in the cluster before a person pushes Secret llm/valkey-devops-auth.

Dependencies

None.

Activity

  1. added
    type/feature
    scope/k8s
    source/agent
    status/new
    effort/low
    value/high
    on Nov 21, 2026
  2. dan-petty commented on Nov 21, 2026

    @dan-petty
    OwnerAuthor
  3. added
    priority/p2-medium
    on Nov 21, 2026
  4. devops-cli-service commented on Nov 21, 2026

    @devops-cli-service
    Contributor

    The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.

    Searches (3)

    Searches run:

    • Valkey ACL audit tool check users default off, results: 5
    • redis ACL management tool verify clients use named users, results: 5
    • valkey ACL file default user off configuration, results: 5

    Sources:

  5. devops-cli-service commented on Nov 22, 2026

    @devops-cli-service
    Contributor

    Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies and Watched files in the section Proposed design of the body.

  6. devops-cli-service commented on Nov 24, 2026

    @devops-cli-service
    Contributor

    Owner question: See Suspected block and Watched files in the section Proposed design of the body.

    Options

    1. Decide the question: The job refines the item with your answer.
    2. Leave it to the job: The job records the best-practice answer and goes on.

    Recommendation: Decide the question: only a person can answer it.

    Evidence

  7. dan-petty commented on Nov 26, 2026

    @dan-petty
    OwnerAuthor

    Findings of 2026-11-26 that change the plan of this item (review of the project brain, #4624).

    1. No role user exists in the cluster. feat(k8s): give valkey-devops one ACL user for each role #4704 is closed, but valkey-devops still starts with requirepass only, and the object llm/valkey-devops-auth holds the key password only. The manifest part is dan-petty/homelab#261 (draft pull request dan-petty/homelab#262). A person runs uv run devops k8s push-secrets --only llm/valkey-devops-auth before that merge.
    2. One role user does not fit one process. A temporary pod with the template of DEVOPS_CACHE_VALKEY_ACL_TEMPLATE and throwaway passwords gave: sweep writes valkey:roadmap:*, and gets NOPERM on valkey:rag:embedding:*. sweep holds no pattern for valkey:brain:*. The Service pod writes the listing snapshot (valkey:roadmap:*), the embeddings (valkey:rag:*) and the tool facts (valkey:brain:*). With valkey.username: sweep, two of its three caches fail. Before the default user goes off, each client needs either one user for each store or a user whose patterns hold each store of its process.
    3. The issue cache key is outside each role. roadmap:v1:brain-issue:* (feat(service): Cache GitHub issue and PR state in the brain from webhooks #6013) matches no pattern. sweep got NOPERM on a key of that form in the test. fix(roadmap): the brain issue cache follows the shared-tier rules #7292 moves the key and must merge before a client sends a role user.
    4. The runner Jobs send no credentials at all (fix(k8s): give the runner Jobs the credentials of the cache Valkey #7293), so the check "no client with user=default" of this item passes for them for the wrong reason.
    5. The user metrics lacks three commands that the exporter sends. client|setname gave one error line for each scrape; dan-petty/homelab#262 turns that command off in the exporter. latency|latest and latency|histogram give one line each at the start of the exporter. The latency percentiles of INFO are still exported.
  8. dan-petty commented on Nov 26, 2026

    @dan-petty
    OwnerAuthor

    More evidence for finding 5 of the comment above, from the build of #7294 (2026-11-26).

    ACL LOG and INFO commandstats of a probe with redis_exporter v1.99.0 and Valkey 9.2.1 show the commands that the exporter sends at a scrape: info, config|get, latency|latest, latency|histogram, slowlog|len, slowlog|get, commandlog|len, command|info and client|setname.

    The user metrics of DEVOPS_CACHE_VALKEY_ACL_TEMPLATE holds 7 commands. It lacks 6 of the 9 (client|setname, latency|latest, latency|histogram, slowlog|len, commandlog|len, command|info), and it holds 4 that the exporter did not send (dbsize, client|list, memory|usage, ping). The exporter of valkey-devops works (redis_up is 1), because dan-petty/homelab#262 turned client|setname off and the other refusals only remove their metrics.

    The template of valkey-roadmap (#7302) grants the 9 commands. When this item changes the aclfile of valkey-devops, give its user metrics the same 9 commands and remove the 4 unused ones.

  9. dan-petty commented on Nov 27, 2026

    @dan-petty
    OwnerAuthor

    Design check, 2026-11-26

    Body: no change. The update of 2026-11-26 is correct: this repository holds the template. The users sweep, brain and agent have -@dangerous, and metrics has a fixed command list (src/devops_cli/k8s/cluster_secrets.py:62-66).

    Refine block

    • It changes k8s/llm/valkey-devops.yaml. This repository does not hold that file.
    • It uses VALKEY_ADMIN_USER. The template has no admin user. Its users are default, sweep, brain, agent and metrics.
    • It says that the pod defines no ACL user. dan-petty/homelab#262 is merged.

    Findings that the design does not hold (owner comments of 2026-11-26)

    • sweep has no pattern for valkey:rag:* or valkey:brain:* (src/devops_cli/k8s/cluster_secrets.py:63).
    • metrics lacks 6 of the 9 commands that the exporter sends.

    Dependencies: #4704 is closed. Not verified: that a release with valkey.username runs in the cluster, and that each client sends a role user.

  10. devops-cli-service commented on Nov 27, 2026

    @devops-cli-service
    Contributor

    The result in the alternatives block of the issue body changed. Before this check: none, no tool. A person decides what the new result means for the item.

    Searches (7)

    Tools considered:

    Searches run:

    • redis ACL audit CLI tool list users permissions, results: 5
    • valkey ACL audit tool default user disabled check clients, results: 5
    • valkey-cli ACL LIST audit script github, results: 5
    • "valkey" aclfile "user default off", results: 5
    • Valkey documentation ACL, results: 5
    • redis audit tool acl permissions, results: 5
    • valkey github repository ACL file, results: 5

    Sources:

  11. devops-cli-service commented on Nov 27, 2026

    @devops-cli-service
    Contributor

    Owner question: See Suspected block and Watched files in the section Proposed design of the body.

    Options

    1. Decide the question: The job refines the item with your answer.
    2. Leave it to the job: The job records the best-practice answer and goes on.

    Recommendation: Decide the question: only a person can answer it.

    Evidence

  12. devops-cli-service commented on Nov 28, 2026

    @devops-cli-service
    Contributor

    Owner question: See Suspected block and Watched files in the section Proposed design of the body.

    Options

    1. Decide the question: The job refines the item with your answer.
    2. Leave it to the job: The job records the best-practice answer and goes on.

    Recommendation: Decide the question: only a person can answer it.

    Evidence

  13. devops-cli-service commented on Nov 28, 2026

    @devops-cli-service
    Contributor

    Owner question: See Suspected block in the section Proposed design of the body.

    Options

    1. Decide the question: The job refines the item with your answer.
    2. Leave it to the job: The job records the best-practice answer and goes on.

    Recommendation: Decide the question: only a person can answer it.

    Evidence

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lowpriority/p2-mediumscope/k8ssource/agentstatus/newtype/featurevalue/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions