Skip to content

[Addon] velaux: environment variables support#784

Draft
pray wants to merge 4 commits intokubevela:masterfrom
pray:velaux-env
Draft

[Addon] velaux: environment variables support#784
pray wants to merge 4 commits intokubevela:masterfrom
pray:velaux-env

Conversation

@pray
Copy link
Copy Markdown

@pray pray commented Dec 30, 2025

Description of your changes

Adding environment variables support to velaux addon, using partial coverage of Kubernetes pod spec's EnvVar.

The only way to set database connection in velaux addon is via parameter.dbURL, in plain text.

Because parameter.dbURL will be passed as part of cmd in Kubernetes pod spec, it can use variable substitutions $(VAR). Those variables can refer to separately managed resources (secrets and/or config map). By allowing environment variables to be set, we can avoid putting sensitive information in parameter.dbURL.

Bumped version to 1.9.5. There happen to be a 1.9.5 in velaux releases.

How has this code been tested?

On kubevela core version 1.10.6

Tested by enabling the addon without env parameter (existing capability), and upgrading with env:

vela addon upgrade ./addons/velaux \
  --override-definitions \
  dbType=postgres \
  dbURL=postgresql://user:$(DB_PASSWORD)@my.db.host:5432/mydb \
  env[0].name=DB_PASSWORD \
  env[0].valueFrom.secretKeyRef.name=my-externally-managed-secret \
  env[0].valueFrom.secretKeyRef.key=dbpassword

Checklist

I have:

  • Title of the PR starts with type (e.g. [Addon] , [example] or [Doc]).
  • Updated/Added any relevant documentation and examples.
  • New addon should be put in experimental.
  • Update addon should modify the version in metadata.yaml to generate a new version.

Verified Addon promotion rules

If this pr wants to promote an experimental addon to verified, you must check whether meet these conditions too:

  • This addon must be tested by addon's e2e-test to guarantee this addon can be enabled successfully.
  • This addon must have some basic but necessary information.
    • An accessible icon url and source url defined in addon's metadata.yaml.
    • A detail introduction include a basic example about how to use and what's the benefit of this addon in README.md.
    • Also provide an introduction in KubeVela documentation.
    • It's more likely to be accepted if useful examples provided in example dir.

Summary by cubic

Add env[] support to the velaux addon so you can inject ConfigMap/Secret-based environment variables into the server pod. This enables $(VAR) substitution in dbURL to avoid hardcoded credentials.

  • New Features

    • Added parameter.env[] with name, value, and valueFrom.{configMapKeyRef, secretKeyRef}.
    • server.cue passes env to the container when provided.
  • Migration

    • No breaking changes.
    • Optionally set env vars and reference them in dbURL with $(VAR) to keep credentials out of plain text.

Written for commit 4f9c01d. Summary will update on new commits.

@pray pray changed the title Velaux env [Addon] velaux: environment variables support Dec 30, 2025
pray added 3 commits December 31, 2025 16:09
Signed-off-by: Prayana Galih <prayana.galih@gmail.com>
Signed-off-by: Prayana Galih <prayana.galih@gmail.com>
Signed-off-by: Prayana Galih <prayana.galih@gmail.com>
@pray pray marked this pull request as ready for review January 2, 2026 10:44
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 2 files

Signed-off-by: Prayana Galih <prayana.galih@gmail.com>
@pray pray marked this pull request as draft January 6, 2026 17:18
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