Skip to content

feat: Autogenerate random API Key with helm install if not passed#740

Open
Revolyssup wants to merge 6 commits into
apache:masterfrom
Revolyssup:revolyssup/autogeneratekey
Open

feat: Autogenerate random API Key with helm install if not passed#740
Revolyssup wants to merge 6 commits into
apache:masterfrom
Revolyssup:revolyssup/autogeneratekey

Conversation

@Revolyssup

Copy link
Copy Markdown
Contributor

This PR is part of the proposal which removes hardcoding of sensitive API keys by autogenerating them at either application level(APISIX) or deployment level(like helm chart.)

{{- if .Values.apisix.admin.credentials.secretName }}
key: ${{"{{"}}APISIX_ADMIN_KEY{{"}}"}}
{{- else if eq .Values.apisix.admin.credentials.admin "" }}
key: {{ randAlphaNum 32 }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

How do users know the key? You need to add a prompt output.

Perhaps managing admin-key through a secret would be more appropriate.
What do you think?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Since this is in the confimap. Users can look at the configmap using kubectl to look at the key. Is there an issue there?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we can write how to get the key in the docs.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is it regenerated when upgrading the version?

@Baoyuantop Baoyuantop added the enhancement New feature or request label Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants