Skip to content

feat: (Hub) use kubernetes secrets to store credentials (auto-gene…#107

Open
maxju wants to merge 2 commits intomasterfrom
106-secret-management
Open

feat: (Hub) use kubernetes secrets to store credentials (auto-gene…#107
maxju wants to merge 2 commits intomasterfrom
106-secret-management

Conversation

@maxju
Copy link
Contributor

@maxju maxju commented Feb 12, 2026

…rate, user-override in values, optional existingSecret)

Breaking: (Hub) Default passwords have been removed from values.yaml! When upgrading an existing installation, make sure to provide your passwords in your values override file

PR for coderabbit

#106

Summary by CodeRabbit

  • New Features

    • Centralized secret-based credential management with auto-generation and option to use an existing secret.
    • Services now read credentials from a shared secret instead of embedded plaintext values.
    • Conditional support to preserve prior inline values when an existing secret is supplied.
  • Documentation

    • Updated configuration guide to emphasize secret creation, required keys, and how to view generated credentials.

…rate, user-override in values, optional existingSecret)

Breaking: (Hub) Default passwords have been removed from values.yaml! When upgrading an existing installation, make sure to provide your passwords in your values override file
@maxju maxju added the hub Specific issue for Hub deployment label Feb 12, 2026
@coderabbitai
Copy link

coderabbitai bot commented Feb 12, 2026

📝 Walkthrough

Walkthrough

Transitions Flame Hub and Authup charts from embedded plaintext credentials to a secrets-driven model: adds secret generation/template, helper to resolve secret name, deployment env vars switched to secretKeyRef, README updated to document secret usage, and authup adjusted to conditionally read from an existing secret.

Changes

Cohort / File(s) Summary
Documentation & Values
charts/flame-hub/README.md, charts/flame-hub/values.yaml, charts/third-party/authup/values.yaml
README rewritten to emphasize secret-based credentials; values files restructured to introduce an auth block with secretName/existingSecret and to remove many inline credential defaults.
Helper Template
charts/flame-hub/templates/_helpers.tpl
Added flameHub.effectiveSecretName template to resolve whether to use an existing secret or the generated secret name.
Secret Template
charts/flame-hub/templates/credentials-secret.yaml
New Helm template that creates the centralized credentials Secret when not using an existing secret; merges existing secret data if present and generates missing values, emitting connection-string keys.
Deployments (flame-hub)
charts/flame-hub/templates/server-core/deployment.yaml, charts/flame-hub/templates/server-core-worker/deployment.yaml, charts/flame-hub/templates/server-messenger/deployment.yaml, charts/flame-hub/templates/server-storage/deployment.yaml, charts/flame-hub/templates/server-telemetry/deployment.yaml
Replaced plaintext environment variables with valueFrom.secretKeyRef lookups referencing the effective secret name and keys like redis-connection-string, vault-connection-string, rabbitmq-connection-string, minio-connection-string, and mysql-root-password.
Authup Chart
charts/third-party/authup/templates/deployment.yaml
Added conditional branch: if .Values.auth.existingSecret is set, wire VAULT/REDIS/DB_PASSWORD via secretKeyRef to secret keys; otherwise fall back to inline auth values.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 I nibble configs, tidy and fleet,
Secrets tucked safe — no passwords to greet.
Templates hum, helpers declare,
Generated keys dance in the air.
Hop, hop — deployment’s now neat! 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title accurately summarizes the main change: migrating Hub credentials to Kubernetes secrets with auto-generation and user-override support.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 106-secret-management

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 7

🤖 Fix all issues with AI agents
In `@charts/flame-hub/README.md`:
- Around line 46-61: The fenced code block containing the credential key list
(lines with symbols like mysql-root-password, mysql-replication-password,
mysql-password, rabbitmq-password, redis-password, vault-dev-root-token,
minio-root-password, harbor-admin-password, grafana-admin-password,
redis-connection-string, rabbitmq-connection-string, vault-connection-string,
minio-connection-string, harbor-connection-string) needs a language specifier to
satisfy MD040; update the opening fence in README.md for that block to include a
language such as "text" (or "yaml") so it becomes ```text (or ```yaml) and leave
the content unchanged.
- Around line 14-17: Update the README to explicitly document the
secret-preservation behavior on helm upgrades: state that the chart uses the
Kubernetes `lookup` function to detect an existing secret named `flame-hub-auth`
and will retain previously generated passwords on `helm upgrade`, only
generating new values for credentials that are missing; mention that supplying
your own k8s secret or setting individual credentials still overrides this
behavior and clarify this applies to upgrades as well as initial installs.
- Around line 22-24: The README uses Helm template markers ({{ $secretName }}
and {{ .Release.Namespace }}) which won't be rendered; update the kubectl
example to use explicit placeholders (e.g. SECRET_NAME and NAMESPACE) and add a
one-line note telling users how to substitute real values or render the template
with Helm (e.g. use helm template/helm get manifests or pass the release
namespace) so consumers replace SECRET_NAME and NAMESPACE with actual values
instead of copying literal {{ $secretName }}/.Release.Namespace.

In `@charts/flame-hub/templates/credentials-secret.yaml`:
- Around line 26-53: The template reads keys from $existingSecret.data and pipes
them to b64dec (e.g., index $existingSecret.data "grafana-admin-password" |
b64dec), which will error if the key is missing; update every key lookup in the
block that sets $mysqlRootPassword, $mysqlReplicationPassword, $mysqlPassword,
$rabbitmqPassword, $redisPassword, $vaultToken, $minioRootPassword,
$harborAdminPassword, and $grafanaAdminPassword to first check hasKey
$existingSecret.data "<key>" (or a nil-safe conditional) before calling index
and b64dec so missing keys are skipped and do not panic during template
rendering. Ensure the same nil-safe pattern is applied consistently for all keys
in this conditional block.

In `@charts/flame-hub/values.yaml`:
- Around line 91-92: The values.yaml currently hardcodes a weak Vault dev root
token (devRootToken: "start123"); remove this default by setting devRootToken to
an empty string (require users to supply it), update the chart README to state
that devRootToken must be overridden for any non-local deployment, and add a
deployment-time warning (in the chart NOTES.txt or a pre-install hook) that
checks if devRootToken is still "start123" and emits a clear error or warning
instructing the user to replace it before proceeding.
- Line 72: Fix the typo in the comment string by adding a space after
"IMPORTANT:" so the line reads "IMPORTANT: If you set this, you must also update
the subchart configurations below to point to your secret!" — update the comment
text where that exact string appears in values.yaml.

In `@charts/third-party/authup/values.yaml`:
- Around line 7-14: The values file still defines hardcoded defaults for
vaultToken, redisPassword, and mysqlRootPassword; remove those defaults by
setting vaultToken, redisPassword, and mysqlRootPassword to empty strings so the
credentials-secret.yaml auto-generation runs when existingSecret is not
provided, or if you intentionally want standalone defaults, add a clear comment
next to vaultToken/redisPassword/mysqlRootPassword explaining they are explicit
standalone defaults (and why) so reviewers/users aren’t misled.
🧹 Nitpick comments (4)
charts/flame-hub/templates/credentials-secret.yaml (2)

1-11: Consider adding helm.sh/resource-policy: keep annotation to prevent accidental secret deletion.

If someone runs helm uninstall and later reinstalls, the auto-generated passwords will be lost, breaking any persistent data stores (MySQL, Redis, etc.) that still use the old credentials. Adding this annotation preserves the secret across uninstall/reinstall cycles.

Proposed annotation
 metadata:
   name: {{ $secretName }}
   labels:
     app: {{ .Release.Name }}-flame-hub
+  annotations:
+    "helm.sh/resource-policy": keep
 type: Opaque

57-65: Random passwords regenerate on every helm template (dry-run) invocation.

This is a known limitation of the lookup + randAlphaNum pattern — lookup returns empty during helm template, so every dry-run produces different passwords. This is fine for actual helm install/upgrade (where lookup works), but worth documenting for users who rely on helm template output for GitOps workflows.

charts/flame-hub/values.yaml (1)

64-73: Hardcoded subchart existingSecret values will silently diverge from auth.secretName.

Changing auth.secretName without also updating every subchart's existingSecret (rabbitmq, redis, minio, mysql, grafana, harbor, authup) will cause pods to reference a non-existent secret. The comment warns about this, but it's fragile.

Consider whether you could use an anchor/alias or a shared global value that subcharts read, so there's a single source of truth. For example:

global:
  flameHub:
    auth:
      secretName: "flame-hub-auth"

Subcharts that support global value passthrough could then reference global.flameHub.auth.secretName instead of each needing a hardcoded string. This may not be possible for all upstream charts, but it would reduce the blast radius of a rename.

charts/flame-hub/README.md (1)

44-68: Secret key documentation is incomplete — missing connection-string formats.

The README lists the required secret keys but doesn't document the expected format/value for the connection-string keys (redis-connection-string, rabbitmq-connection-string, vault-connection-string, minio-connection-string, harbor-connection-string). Users creating a manual existingSecret won't know the expected URI format. The kubectl create secret example only shows password keys.

Consider adding a brief note with the expected connection string formats, e.g.:

redis-connection-string: "redis://default:<password>@<release>-redis-master:6379"

Comment on lines +14 to +17
## Credentials
> 🔐 **By default** this chart will create a new secret with random passwords.

create `values_local.yaml` then run `helm install hub . -f values_local.yaml`
This chart manages credentials using a Kubernetes Secret. By default, it will check for an existing secret named `flame-hub-auth`. If it does not exist, it will create a new secret with random passwords. You can override this behavior by providing your own k8s secret or by explicitly setting individual credentials in the values.
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

cat charts/flame-hub/templates/credentials-secret.yaml

Repository: PrivateAIM/helm

Length of output: 4557


Document the secret preservation behavior during upgrades.

The template correctly uses the lookup function to preserve existing secret values on upgrade. However, the README documentation does not explicitly mention this behavior. While it states the chart will "check for an existing secret," it should clarify that on helm upgrade, previously generated passwords are retained and only missing credentials are newly generated. This will reduce operational confusion around upgrade safety.

🤖 Prompt for AI Agents
In `@charts/flame-hub/README.md` around lines 14 - 17, Update the README to
explicitly document the secret-preservation behavior on helm upgrades: state
that the chart uses the Kubernetes `lookup` function to detect an existing
secret named `flame-hub-auth` and will retain previously generated passwords on
`helm upgrade`, only generating new values for credentials that are missing;
mention that supplying your own k8s secret or setting individual credentials
still overrides this behavior and clarify this applies to upgrades as well as
initial installs.

Comment on lines 22 to 24
```bash
kubectl get secret {{ $secretName }} -n {{ .Release.Namespace }} -o jsonpath='{.data.harbor-admin-password}' | base64 -d && echo
```
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Bug: Helm template variables in README won't be rendered.

The kubectl example uses {{ $secretName }} and {{ .Release.Namespace }}, but README.md is not processed by the Helm template engine. Users copying this command will get literal {{ ... }} strings.

Proposed fix
-kubectl get secret {{ $secretName }} -n {{ .Release.Namespace }} -o jsonpath='{.data.harbor-admin-password}' | base64 -d && echo
+kubectl get secret flame-hub-auth -n <namespace> -o jsonpath='{.data.harbor-admin-password}' | base64 -d && echo
🤖 Prompt for AI Agents
In `@charts/flame-hub/README.md` around lines 22 - 24, The README uses Helm
template markers ({{ $secretName }} and {{ .Release.Namespace }}) which won't be
rendered; update the kubectl example to use explicit placeholders (e.g.
SECRET_NAME and NAMESPACE) and add a one-line note telling users how to
substitute real values or render the template with Helm (e.g. use helm
template/helm get manifests or pass the release namespace) so consumers replace
SECRET_NAME and NAMESPACE with actual values instead of copying literal {{
$secretName }}/.Release.Namespace.

Comment on lines +46 to +61
```
mysql-root-password:
mysql-replication-password:
mysql-password:
rabbitmq-password:
redis-password:
vault-dev-root-token:
minio-root-password:
harbor-admin-password:
grafana-admin-password:
redis-connection-string:
rabbitmq-connection-string:
vault-connection-string:
minio-connection-string:
harbor-connection-string:
```
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Add a language specifier to the fenced code block.

The static analysis tool flagged this block (MD040). Since this is a list of key names (not executable code), text or yaml would be appropriate:

-```
+```text
 mysql-root-password:
🧰 Tools
🪛 markdownlint-cli2 (0.20.0)

[warning] 46-46: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
In `@charts/flame-hub/README.md` around lines 46 - 61, The fenced code block
containing the credential key list (lines with symbols like mysql-root-password,
mysql-replication-password, mysql-password, rabbitmq-password, redis-password,
vault-dev-root-token, minio-root-password, harbor-admin-password,
grafana-admin-password, redis-connection-string, rabbitmq-connection-string,
vault-connection-string, minio-connection-string, harbor-connection-string)
needs a language specifier to satisfy MD040; update the opening fence in
README.md for that block to include a language such as "text" (or "yaml") so it
becomes ```text (or ```yaml) and leave the content unchanged.

secretName: "flame-hub-auth"

# Advanced: Use your own secret instead of auto-generated one, takes precedence over secretName
# IMPORTANT:If you set this, you must also update the subchart configurations below to point to your secret!
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Typo: missing space after "IMPORTANT:".

-    # IMPORTANT:If you set this, you must also update the subchart configurations below to point to your secret!
+    # IMPORTANT: If you set this, you must also update the subchart configurations below to point to your secret!
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# IMPORTANT:If you set this, you must also update the subchart configurations below to point to your secret!
# IMPORTANT: If you set this, you must also update the subchart configurations below to point to your secret!
🤖 Prompt for AI Agents
In `@charts/flame-hub/values.yaml` at line 72, Fix the typo in the comment string
by adding a space after "IMPORTANT:" so the line reads "IMPORTANT: If you set
this, you must also update the subchart configurations below to point to your
secret!" — update the comment text where that exact string appears in
values.yaml.

Comment on lines +91 to +92
# needs to be set. No option for passing a secret here.
devRootToken: "start123"
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Vault dev root token is hardcoded with a weak default.

devRootToken: "start123" is a weak credential committed in plain text. Even though the comment acknowledges the Vault chart doesn't support secret references here, this token grants full Vault access.

Consider:

  1. Documenting clearly (in the README) that this must be overridden for any non-local deployment.
  2. Adding a check in a NOTES.txt or pre-install hook that warns if the token is still "start123".
  3. Alternatively, leave the value empty and require the user to set it, similar to the other credentials.
🤖 Prompt for AI Agents
In `@charts/flame-hub/values.yaml` around lines 91 - 92, The values.yaml currently
hardcodes a weak Vault dev root token (devRootToken: "start123"); remove this
default by setting devRootToken to an empty string (require users to supply it),
update the chart README to state that devRootToken must be overridden for any
non-local deployment, and add a deployment-time warning (in the chart NOTES.txt
or a pre-install hook) that checks if devRootToken is still "start123" and emits
a clear error or warning instructing the user to replace it before proceeding.

Comment on lines +7 to +14
auth:
# Use an existing secret with keys: vault-connection-string, redis-connection-string, mysql-root-password
existingSecret: ""

# or provide credentials in values (used when existingSecret is not set)
vaultToken: "start123"
redisPassword: "start123"
mysqlRootPassword: "start123"
Copy link

@coderabbitai coderabbitai bot Feb 12, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Hardcoded default credentials remain in authup values.

The PR description states "default passwords have been removed from values.yaml," but vaultToken, redisPassword, and mysqlRootPassword still default to "start123". If the intent is to force users to supply credentials (as done in the main flame-hub/values.yaml), these should also be empty strings so that the auto-generation logic in credentials-secret.yaml kicks in. If these are intentionally kept for standalone authup usage, consider adding a comment clarifying that.

🤖 Prompt for AI Agents
In `@charts/third-party/authup/values.yaml` around lines 7 - 14, The values file
still defines hardcoded defaults for vaultToken, redisPassword, and
mysqlRootPassword; remove those defaults by setting vaultToken, redisPassword,
and mysqlRootPassword to empty strings so the credentials-secret.yaml
auto-generation runs when existingSecret is not provided, or if you
intentionally want standalone defaults, add a clear comment next to
vaultToken/redisPassword/mysqlRootPassword explaining they are explicit
standalone defaults (and why) so reviewers/users aren’t misled.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't really care about authup

Copy link

Choose a reason for hiding this comment

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

@maxju, understood! I'll leave this as-is for now. If you'd like, I can open a follow-up issue to track updating the authup credentials for consistency with the main flame-hub chart. Just let me know.

Copy link

Choose a reason for hiding this comment

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

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@charts/flame-hub/README.md`:
- Around line 42-61: Update the README section to split the secret keys into two
clearly labeled groups: "Required password keys" (list mysql-root-password,
mysql-replication-password, mysql-password, rabbitmq-password, redis-password,
vault-dev-root-token, minio-root-password, harbor-admin-password,
grafana-admin-password) and "Derived connection string keys" (list
redis-connection-string, rabbitmq-connection-string, vault-connection-string,
minio-connection-string, harbor-connection-string) and state the behavior for
the chart options: when using secretName the chart templates will auto-generate
the connection strings from the provided password keys, but when using
existingSecret the user must include the connection string keys manually in that
secret; reference the configuration names existingSecret and secretName so
readers know which path requires manual connection strings.

In `@charts/flame-hub/templates/credentials-secret.yaml`:
- Around line 79-80: The Redis and RabbitMQ connection strings (keys
redis-connection-string and rabbitmq-connection-string) omit explicit ports;
update the printf templates to append :6379 for Redis and :5672 for RabbitMQ so
clients don't rely on defaults—modify the Redis line that builds
"redis://default:%s@%s-redis-master" to
"redis://default:%s@%s-redis-master:6379" (keeping $redisPassword and
.Release.Name) and modify the RabbitMQ line that builds
"amqp://%s:%s@%s-rabbitmq" to "amqp://%s:%s@%s-rabbitmq:5672" (keeping
.Values.rabbitmq.auth.username and $rabbitmqPassword and .Release.Name).
🧹 Nitpick comments (3)
charts/flame-hub/templates/credentials-secret.yaml (2)

5-11: Consider adding a helm.sh/resource-policy: keep annotation to prevent accidental secret deletion.

If a user runs helm uninstall, this secret (containing all generated passwords) will be deleted along with the release. Since the passwords are used by stateful services (MySQL, Redis, RabbitMQ, etc.) whose data persists in PVCs, the credentials would be lost while the data remains — making recovery difficult.

Suggested fix
 metadata:
   name: {{ $secretName }}
   labels:
     app: {{ .Release.Name }}-flame-hub
+  annotations:
+    "helm.sh/resource-policy": keep
 type: Opaque

1-3: Use the flameHub.effectiveSecretName helper for consistency with deployment templates.

Line 2 directly references .Values.auth.secretName, but all deployment templates use the flameHub.effectiveSecretName helper to resolve the secret name. Although this template is guarded by if not .Values.auth.existingSecret (making the direct reference functionally equivalent to the helper in practice), using the helper would ensure consistency across the chart and reduce duplication of the secret name resolution logic:

Suggested change
-{{- $secretName := .Values.auth.secretName }}
+{{- $secretName := include "flameHub.effectiveSecretName" . }}
charts/flame-hub/README.md (1)

70-97: Minimal configuration code block is missing a language specifier.

Line 74 uses a bare ``` fence. Add yaml for consistent formatting and to satisfy linting:

-```
+```yaml
 global:

Comment on lines +42 to +61
### Creating the secret

The chart requires a secret with the following keys:

```
mysql-root-password:
mysql-replication-password:
mysql-password:
rabbitmq-password:
redis-password:
vault-dev-root-token:
minio-root-password:
harbor-admin-password:
grafana-admin-password:
redis-connection-string:
rabbitmq-connection-string:
vault-connection-string:
minio-connection-string:
harbor-connection-string:
```
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Clarify which keys are required for existingSecret vs auto-generated.

The section says "The chart requires a secret with the following keys" and lists both individual passwords and connection strings. However, connection strings (Lines 56-61) are auto-generated from passwords in the template. For users providing an existingSecret, it's unclear whether they must manually construct all connection strings or if only the password keys are needed.

Consider splitting into two groups: required password keys (that users must provide) and derived connection strings (auto-generated when using secretName, must be manually provided when using existingSecret).

🧰 Tools
🪛 markdownlint-cli2 (0.20.0)

[warning] 46-46: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
In `@charts/flame-hub/README.md` around lines 42 - 61, Update the README section
to split the secret keys into two clearly labeled groups: "Required password
keys" (list mysql-root-password, mysql-replication-password, mysql-password,
rabbitmq-password, redis-password, vault-dev-root-token, minio-root-password,
harbor-admin-password, grafana-admin-password) and "Derived connection string
keys" (list redis-connection-string, rabbitmq-connection-string,
vault-connection-string, minio-connection-string, harbor-connection-string) and
state the behavior for the chart options: when using secretName the chart
templates will auto-generate the connection strings from the provided password
keys, but when using existingSecret the user must include the connection string
keys manually in that secret; reference the configuration names existingSecret
and secretName so readers know which path requires manual connection strings.

Comment on lines +79 to +80
redis-connection-string: {{ printf "redis://default:%s@%s-redis-master" $redisPassword .Release.Name | quote }}
rabbitmq-connection-string: {{ printf "amqp://%s:%s@%s-rabbitmq" .Values.rabbitmq.auth.username $rabbitmqPassword .Release.Name | quote }}
Copy link

@coderabbitai coderabbitai bot Feb 12, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check how these connection strings are consumed to verify port requirements
echo "=== Redis connection string usage ==="
rg -n 'redis-connection-string' charts/flame-hub/

echo ""
echo "=== RabbitMQ connection string usage ==="
rg -n 'rabbitmq-connection-string' charts/flame-hub/

echo ""
echo "=== Check Redis/RabbitMQ service port definitions in values ==="
rg -n -A3 'port:' charts/flame-hub/values.yaml | head -50

echo ""
echo "=== Check Helm chart structure ==="
find charts/flame-hub -type f -name "*.yaml" -o -name "*.yml" | head -20

Repository: PrivateAIM/helm

Length of output: 2997


🏁 Script executed:

#!/bin/bash
echo "=== Check Chart.yaml for dependencies ==="
cat charts/flame-hub/Chart.yaml

echo ""
echo "=== Check values.yaml for Redis and RabbitMQ config ==="
rg -n 'redis:|rabbitmq:' charts/flame-hub/values.yaml -A 10

echo ""
echo "=== Search for Redis service definition ==="
find charts/flame-hub -name "*.yaml" -exec grep -l "redis" {} \; 2>/dev/null | xargs rg -l 'kind: Service' 2>/dev/null

echo ""
echo "=== Check for any service definitions in redis/rabbitmq directories ==="
find charts/flame-hub -type d \( -name redis -o -name rabbitmq \) 2>/dev/null

Repository: PrivateAIM/helm

Length of output: 3021


🏁 Script executed:

#!/bin/bash
echo "=== Full Redis section in values.yaml ==="
rg -n 'redis:' charts/flame-hub/values.yaml -A 30 | head -50

echo ""
echo "=== Full RabbitMQ section in values.yaml ==="
rg -n 'rabbitmq:' charts/flame-hub/values.yaml -A 30 | head -50

echo ""
echo "=== Check README for port information ==="
cat charts/flame-hub/README.md | grep -i 'port\|redis\|rabbitmq' -A 2 -B 2 | head -40

Repository: PrivateAIM/helm

Length of output: 2804


🏁 Script executed:

#!/bin/bash
echo "=== Check how redis-connection-string is used in deployments ==="
rg -n 'redis-connection-string' charts/flame-hub/templates/server-core/deployment.yaml -B 5 -A 5

echo ""
echo "=== Check for REDIS_PORT or similar env vars ==="
rg -n 'REDIS.*PORT|RABBITMQ.*PORT' charts/flame-hub/templates/ -r '$0'

echo ""
echo "=== Check full credentials secret ==="
sed -n '75,85p' charts/flame-hub/templates/credentials-secret.yaml

Repository: PrivateAIM/helm

Length of output: 1613


🏁 Script executed:

#!/bin/bash
echo "=== Check service definitions for Redis and RabbitMQ ==="
find charts/flame-hub/templates -name "*service*" -exec grep -l "redis\|rabbitmq" {} \;

echo ""
echo "=== Check all service definitions in the chart ==="
find charts/flame-hub/templates -name "*service*" -type f

echo ""
echo "=== Look for any port configurations in deployment manifests ==="
rg -n 'port:' charts/flame-hub/templates/server-core/deployment.yaml

echo ""
echo "=== Check if Bitnami sub-charts might override service ports ==="
rg -n 'service:' charts/flame-hub/values.yaml -A 5 | head -30

Repository: PrivateAIM/helm

Length of output: 1190


🌐 Web query:

Bitnami Redis Helm chart 22.0.6 default service port

💡 Result:

In bitnami/redis Helm chart v22.0.6, the default Redis Service port is 6379/TCP (values key: master.service.ports.redis: 6379, and likewise for replicas). [1][2]


🌐 Web query:

Bitnami RabbitMQ Helm chart 16.0.14 default service port AMQP

💡 Result:

In the Bitnami RabbitMQ Helm chart v16.0.14, the default AMQP Kubernetes Service port is 5672 (configured via service.ports.amqp). [1]

AMQP TLS (if enabled) defaults to 5671 via service.ports.amqpTls. [1]

Sources

  1. Bitnami RabbitMQ chart parameters (“Exposure parameters”: service.ports.amqp: 5672, service.ports.amqpTls: 5671). [1]

Add explicit port numbers to Redis and RabbitMQ connection strings for consistency and portability.

Lines 79–80 omit port numbers: redis://default:...@<release>-redis-master and amqp://...@<release>-rabbitmq. While these default to 6379 and 5672 respectively per the Bitnami charts, not all client libraries infer ports reliably. For consistency (MinIO and Vault in the same file include explicit ports) and to ensure portable client compatibility, add explicit ports:

Suggested fix
-  redis-connection-string: {{ printf "redis://default:%s@%s-redis-master" $redisPassword .Release.Name | quote }}
-  rabbitmq-connection-string: {{ printf "amqp://%s:%s@%s-rabbitmq" .Values.rabbitmq.auth.username $rabbitmqPassword .Release.Name | quote }}
+  redis-connection-string: {{ printf "redis://default:%s@%s-redis-master:6379" $redisPassword .Release.Name | quote }}
+  rabbitmq-connection-string: {{ printf "amqp://%s:%s@%s-rabbitmq:5672" .Values.rabbitmq.auth.username $rabbitmqPassword .Release.Name | quote }}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
redis-connection-string: {{ printf "redis://default:%s@%s-redis-master" $redisPassword .Release.Name | quote }}
rabbitmq-connection-string: {{ printf "amqp://%s:%s@%s-rabbitmq" .Values.rabbitmq.auth.username $rabbitmqPassword .Release.Name | quote }}
redis-connection-string: {{ printf "redis://default:%s@%s-redis-master:6379" $redisPassword .Release.Name | quote }}
rabbitmq-connection-string: {{ printf "amqp://%s:%s@%s-rabbitmq:5672" .Values.rabbitmq.auth.username $rabbitmqPassword .Release.Name | quote }}
🧰 Tools
🪛 Checkov (3.2.334)

[medium] 79-80: Basic Auth Credentials

(CKV_SECRET_4)

🤖 Prompt for AI Agents
In `@charts/flame-hub/templates/credentials-secret.yaml` around lines 79 - 80, The
Redis and RabbitMQ connection strings (keys redis-connection-string and
rabbitmq-connection-string) omit explicit ports; update the printf templates to
append :6379 for Redis and :5672 for RabbitMQ so clients don't rely on
defaults—modify the Redis line that builds "redis://default:%s@%s-redis-master"
to "redis://default:%s@%s-redis-master:6379" (keeping $redisPassword and
.Release.Name) and modify the RabbitMQ line that builds
"amqp://%s:%s@%s-rabbitmq" to "amqp://%s:%s@%s-rabbitmq:5672" (keeping
.Values.rabbitmq.auth.username and $rabbitmqPassword and .Release.Name).

Copy link
Contributor

Choose a reason for hiding this comment

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

@maxju das könnten wir uns auch überlegen, explizite port nummern zu verwenden, auch wenn das bisher nicht der fall war.

Copy link

Choose a reason for hiding this comment

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

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!

@tada5hi tada5hi changed the title Feature: (Hub) use kubernetes secrets to store credentials (auto-gene… feat: (Hub) use kubernetes secrets to store credentials (auto-gene… Feb 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hub Specific issue for Hub deployment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants