Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[kube-state-metrics] add additional environment variables support. #5101

Merged
merged 1 commit into from
Dec 30, 2024

Conversation

liangyuanpeng
Copy link
Contributor

@liangyuanpeng liangyuanpeng commented Dec 27, 2024

What this PR does / why we need it

KSM support additional environment, in my case, i want to enable some client-go features with environment.

tested:

set env with normal

helm upgrade ksm .  --set "env[0].name=KUBE_FEATURE_ClientsAllowCBOR"  --set "env[1].name=KUBE_FEATURE_ClientsPreferCBOR" --set "env[0].value='true'" --set "env[1].value='true'" -i

and got the environment:

    Environment:
      KUBE_FEATURE_ClientsAllowCBOR:   'true'
      KUBE_FEATURE_ClientsPreferCBOR:  'true'

set env with autosharding.

helm upgrade ksm . --set "autosharding.enabled='true'" --set "env[0].name=KUBE_FEATURE_ClientsAllowCBOR"  --set "env[1].name=KUBE_FEATURE_ClientsPreferCBOR" --set "env[0].value='true'" --set "env[1].value='true'" -i

and got the environment:

    Environment:
      POD_NAME:                        ksm-kube-state-metrics-0 (v1:metadata.name)
      POD_NAMESPACE:                   default (v1:metadata.namespace)
      KUBE_FEATURE_ClientsAllowCBOR:   'true'
      KUBE_FEATURE_ClientsPreferCBOR:  'true'

Which issue this PR fixes

(optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged)

  • fixes #

Special notes for your reviewer

Checklist

  • DCO signed
  • Chart Version bumped
  • Title of the PR starts with chart name (e.g. [prometheus-couchdb-exporter])

Copy link
Member

@dotdc dotdc left a comment

Choose a reason for hiding this comment

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

Can you remove empty lines in the template?
Otherwise LGTM.

charts/kube-state-metrics/templates/deployment.yaml Outdated Show resolved Hide resolved
charts/kube-state-metrics/templates/deployment.yaml Outdated Show resolved Hide resolved
charts/kube-state-metrics/templates/deployment.yaml Outdated Show resolved Hide resolved
@liangyuanpeng
Copy link
Contributor Author

Can you remove empty lines in the template?
Otherwise LGTM.

updated.

@dotdc dotdc merged commit 1f46261 into prometheus-community:main Dec 30, 2024
4 checks passed
@liangyuanpeng liangyuanpeng deleted the support_env_ksm branch December 31, 2024 01:54
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.

2 participants