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

specify FeatureGates in helm chart #1314

Merged
merged 1 commit into from Nov 14, 2023

Conversation

B1F030
Copy link
Member

@B1F030 B1F030 commented Nov 8, 2023

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

Let Helm chart specify which FeatureGates should be used

Which issue(s) this PR fixes:

Fixes #1230

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Allow configuring featureGates on helm charts.

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels Nov 8, 2023
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Nov 8, 2023
Copy link

netlify bot commented Nov 8, 2023

Deploy Preview for kubernetes-sigs-kueue canceled.

Name Link
🔨 Latest commit 216505c
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-kueue/deploys/655325700e77fa00079817e9

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Nov 8, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @B1F030. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Nov 8, 2023
charts/kueue/values.yaml Outdated Show resolved Hide resolved
charts/kueue/values.yaml Outdated Show resolved Hide resolved
charts/kueue/templates/manager/manager.yaml Outdated Show resolved Hide resolved
@B1F030
Copy link
Member Author

B1F030 commented Nov 8, 2023

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 8, 2023
@kerthcet
Copy link
Contributor

kerthcet commented Nov 8, 2023

/kind feature
/remove-kind cleanup

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Nov 8, 2023
Copy link
Contributor

@kerthcet kerthcet left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 9, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 44563f2f2a9e779b4211b0f77278545149996b8e

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 9, 2023
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Nov 9, 2023
@B1F030
Copy link
Member Author

B1F030 commented Nov 9, 2023

@tenzen-y Thanks for review. I fixed that! There are no empty lines any more.

@tenzen-y
Copy link
Member

tenzen-y commented Nov 9, 2023

I found it! I need to add another with:

    {{- with .Values.controllerManager.featureGates }}
      {{- include "kueue.featureGates" . | nindent 8 }}
    {{- end }}

It's a great point. An empty line issue is resolved. However, once I remove comment out, I face the following errors:
Does this chart work well on your local?

values.yaml:

# Declare variables to be passed into your templates.
nameOverride: ""
fullnameOverride: ""
# Enable each function, like kustomize https://github.com/kubernetes-sigs/kueue/blob/main/config/default/kustomization.yaml
enablePrometheus: false
# Enable x509 automated certificate management using cert-manager (cert-manager.io)
enableCertManager: false
# Customize controlerManager
controllerManager:
  featureGates:
  - name: PartialAdmission
    value: true
  kubeRbacProxy:
    image:
...
Error: template: kueue/templates/manager/manager.yaml:27:14: executing "kueue/templates/manager/manager.yaml" at <include "kueue.featureGates" .>: error calling include: template: kueue/templates/_helpers.tpl:69:17: executing "kueue.featureGates" at <.Values.controllerManager.featureGates>: can't evaluate field Values in type []interface {}

@B1F030
Copy link
Member Author

B1F030 commented Nov 10, 2023

I found it! I need to add another with:

    {{- with .Values.controllerManager.featureGates }}
      {{- include "kueue.featureGates" . | nindent 8 }}
    {{- end }}

It's a great point. An empty line issue is resolved. However, once I remove comment out, I face the following errors: Does this chart work well on your local?

values.yaml:

# Declare variables to be passed into your templates.
nameOverride: ""
fullnameOverride: ""
# Enable each function, like kustomize https://github.com/kubernetes-sigs/kueue/blob/main/config/default/kustomization.yaml
enablePrometheus: false
# Enable x509 automated certificate management using cert-manager (cert-manager.io)
enableCertManager: false
# Customize controlerManager
controllerManager:
  featureGates:
  - name: PartialAdmission
    value: true
  kubeRbacProxy:
    image:
...
Error: template: kueue/templates/manager/manager.yaml:27:14: executing "kueue/templates/manager/manager.yaml" at <include "kueue.featureGates" .>: error calling include: template: kueue/templates/_helpers.tpl:69:17: executing "kueue.featureGates" at <.Values.controllerManager.featureGates>: can't evaluate field Values in type []interface {}

Sorry I missed that... :(
I have changed .value to .enabled, now it should be all right.

@B1F030
Copy link
Member Author

B1F030 commented Nov 10, 2023

/unhold

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 10, 2023
@B1F030
Copy link
Member Author

B1F030 commented Nov 13, 2023

/meow

@k8s-ci-robot
Copy link
Contributor

@B1F030: cat image

In response to this:

/meow

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@kerthcet
Copy link
Contributor

ping @tenzen-y

@tenzen-y
Copy link
Member

@B1F030 I'm still facing the same error. Did you push the latest commit into this branch?

$  helm template ./charts/kueue --values ./charts/kueue/values.yaml
Error: template: kueue/templates/manager/manager.yaml:27:14: executing "kueue/templates/manager/manager.yaml" at <include "kueue.featureGates" .>: error calling include: template: kueue/templates/_helpers.tpl:69:17: executing "kueue.featureGates" at <.Values.controllerManager.featureGates>: can't evaluate field Values in type []interface {}

Use --debug flag to render out invalid YAML
$
$ git log --oneline 
44c2af6 (HEAD, B1F030/helm-chart) specify feature gates in helm chart
b47bf03 (origin/main, origin/HEAD, main) Updated the tool to generate client-go libraries (#1151)
b95392a correct some comments (#1305)
2a21bb4 List features of Kueue in README and website/overview (#1286)

@B1F030
Copy link
Member Author

B1F030 commented Nov 14, 2023

@B1F030 I'm still facing the same error. Did you push the latest commit into this branch?

$  helm template ./charts/kueue --values ./charts/kueue/values.yaml
Error: template: kueue/templates/manager/manager.yaml:27:14: executing "kueue/templates/manager/manager.yaml" at <include "kueue.featureGates" .>: error calling include: template: kueue/templates/_helpers.tpl:69:17: executing "kueue.featureGates" at <.Values.controllerManager.featureGates>: can't evaluate field Values in type []interface {}

Use --debug flag to render out invalid YAML
$
$ git log --oneline 
44c2af6 (HEAD, B1F030/helm-chart) specify feature gates in helm chart
b47bf03 (origin/main, origin/HEAD, main) Updated the tool to generate client-go libraries (#1151)
b95392a correct some comments (#1305)
2a21bb4 List features of Kueue in README and website/overview (#1286)

now it should be like:

 featureGates:
   - name: PartialAdmission
     enabled: true

It seems more reasonable to use enabled instead of value.

@tenzen-y
Copy link
Member

@B1F030 I'm still facing the same error. Did you push the latest commit into this branch?

$  helm template ./charts/kueue --values ./charts/kueue/values.yaml
Error: template: kueue/templates/manager/manager.yaml:27:14: executing "kueue/templates/manager/manager.yaml" at <include "kueue.featureGates" .>: error calling include: template: kueue/templates/_helpers.tpl:69:17: executing "kueue.featureGates" at <.Values.controllerManager.featureGates>: can't evaluate field Values in type []interface {}

Use --debug flag to render out invalid YAML
$
$ git log --oneline 
44c2af6 (HEAD, B1F030/helm-chart) specify feature gates in helm chart
b47bf03 (origin/main, origin/HEAD, main) Updated the tool to generate client-go libraries (#1151)
b95392a correct some comments (#1305)
2a21bb4 List features of Kueue in README and website/overview (#1286)

now it should be like:

 featureGates:
   - name: PartialAdmission
     enabled: true

It seems more reasonable to use enabled instead of value.

I was using enabled field since I was using your latest commit, as I showed in the above. Can you build this helm on your local?

# Default values for kueue.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
nameOverride: ""
fullnameOverride: ""
# Enable each function, like kustomize https://github.com/kubernetes-sigs/kueue/blob/main/config/default/kustomization.yaml
enablePrometheus: false
# Enable x509 automated certificate management using cert-manager (cert-manager.io)
enableCertManager: false
# Customize controlerManager
controllerManager:
  featureGates:
  - name: PartialAdmission
    enabled: true
  kubeRbacProxy:
...

Co-authored-by: kerthcet <kerthcet@gmail.com>
Co-authored-by: B1F030 <646337422@qq.com>
Signed-off-by: B1F030 <646337422@qq.com>
@B1F030
Copy link
Member Author

B1F030 commented Nov 14, 2023

@B1F030 I'm still facing the same error. Did you push the latest commit into this branch?

$  helm template ./charts/kueue --values ./charts/kueue/values.yaml
Error: template: kueue/templates/manager/manager.yaml:27:14: executing "kueue/templates/manager/manager.yaml" at <include "kueue.featureGates" .>: error calling include: template: kueue/templates/_helpers.tpl:69:17: executing "kueue.featureGates" at <.Values.controllerManager.featureGates>: can't evaluate field Values in type []interface {}

Use --debug flag to render out invalid YAML
$
$ git log --oneline 
44c2af6 (HEAD, B1F030/helm-chart) specify feature gates in helm chart
b47bf03 (origin/main, origin/HEAD, main) Updated the tool to generate client-go libraries (#1151)
b95392a correct some comments (#1305)
2a21bb4 List features of Kueue in README and website/overview (#1286)

now it should be like:

 featureGates:
   - name: PartialAdmission
     enabled: true

It seems more reasonable to use enabled instead of value.

I was using enabled field since I was using your latest commit, as I showed in the above. Can you build this helm on your local?

# Default values for kueue.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
nameOverride: ""
fullnameOverride: ""
# Enable each function, like kustomize https://github.com/kubernetes-sigs/kueue/blob/main/config/default/kustomization.yaml
enablePrometheus: false
# Enable x509 automated certificate management using cert-manager (cert-manager.io)
enableCertManager: false
# Customize controlerManager
controllerManager:
  featureGates:
  - name: PartialAdmission
    enabled: true
  kubeRbacProxy:
...

Really thanks for your patience, sorry I didn't perfectly fix that empty line bug before.
After looking through helm chart's official document, I found that it is becacuse of nindent, the nindent function is the same as the indent function, but prepends a new line to the beginning of the string.
Last time when I try to fix that problem, I use another {{with}}, but end up with another bug.
Sorry again for my careless, next time I shall be more careful, and test well in my local environment.

controllerManager:
 #featureGates:
 #  - name: PartialAdmission
 #    enabled: true
 #  - name: FlavorFungibility
 #    enabled: true
      containers:
      - args:
        - --config=/controller_manager_config.yaml
        - --zap-log-level=2
        {{- include "kueue.featureGates" . | indent 8 }}

Now I replaced nindent with indent, it works, and this PR should be ready to merge. Appreciate again! @tenzen-y

@tenzen-y
Copy link
Member

@B1F030 I'm still facing the same error. Did you push the latest commit into this branch?

$  helm template ./charts/kueue --values ./charts/kueue/values.yaml
Error: template: kueue/templates/manager/manager.yaml:27:14: executing "kueue/templates/manager/manager.yaml" at <include "kueue.featureGates" .>: error calling include: template: kueue/templates/_helpers.tpl:69:17: executing "kueue.featureGates" at <.Values.controllerManager.featureGates>: can't evaluate field Values in type []interface {}

Use --debug flag to render out invalid YAML
$
$ git log --oneline 
44c2af6 (HEAD, B1F030/helm-chart) specify feature gates in helm chart
b47bf03 (origin/main, origin/HEAD, main) Updated the tool to generate client-go libraries (#1151)
b95392a correct some comments (#1305)
2a21bb4 List features of Kueue in README and website/overview (#1286)

now it should be like:

 featureGates:
   - name: PartialAdmission
     enabled: true

It seems more reasonable to use enabled instead of value.

I was using enabled field since I was using your latest commit, as I showed in the above. Can you build this helm on your local?

# Default values for kueue.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
nameOverride: ""
fullnameOverride: ""
# Enable each function, like kustomize https://github.com/kubernetes-sigs/kueue/blob/main/config/default/kustomization.yaml
enablePrometheus: false
# Enable x509 automated certificate management using cert-manager (cert-manager.io)
enableCertManager: false
# Customize controlerManager
controllerManager:
  featureGates:
  - name: PartialAdmission
    enabled: true
  kubeRbacProxy:
...

Really thanks for your patience, sorry I didn't perfectly fix that empty line bug before. After looking through helm chart's official document, I found that it is becacuse of nindent, the nindent function is the same as the indent function, but prepends a new line to the beginning of the string. Last time when I try to fix that problem, I use another {{with}}, but end up with another bug. Sorry again for my careless, next time I shall be more careful, and test well in my local environment.

controllerManager:
 #featureGates:
 #  - name: PartialAdmission
 #    enabled: true
 #  - name: FlavorFungibility
 #    enabled: true
      containers:
      - args:
        - --config=/controller_manager_config.yaml
        - --zap-log-level=2
        {{- include "kueue.featureGates" . | indent 8 }}

Now I replaced nindent with indent, it works, and this PR should be ready to merge. Appreciate again! @tenzen-y

That makes sense. The latest commit should work well.
Thank you for the great work :)

/lgtm
/approve

/release-note-edit

Allow configuring featureGates on helm charts.

@k8s-ci-robot
Copy link
Contributor

@tenzen-y: /release-note-edit must be used with a release note block.

In response to this:

@B1F030 I'm still facing the same error. Did you push the latest commit into this branch?

$  helm template ./charts/kueue --values ./charts/kueue/values.yaml
Error: template: kueue/templates/manager/manager.yaml:27:14: executing "kueue/templates/manager/manager.yaml" at <include "kueue.featureGates" .>: error calling include: template: kueue/templates/_helpers.tpl:69:17: executing "kueue.featureGates" at <.Values.controllerManager.featureGates>: can't evaluate field Values in type []interface {}

Use --debug flag to render out invalid YAML
$
$ git log --oneline 
44c2af6 (HEAD, B1F030/helm-chart) specify feature gates in helm chart
b47bf03 (origin/main, origin/HEAD, main) Updated the tool to generate client-go libraries (#1151)
b95392a correct some comments (#1305)
2a21bb4 List features of Kueue in README and website/overview (#1286)

now it should be like:

 featureGates:
   - name: PartialAdmission
     enabled: true

It seems more reasonable to use enabled instead of value.

I was using enabled field since I was using your latest commit, as I showed in the above. Can you build this helm on your local?

# Default values for kueue.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
nameOverride: ""
fullnameOverride: ""
# Enable each function, like kustomize https://github.com/kubernetes-sigs/kueue/blob/main/config/default/kustomization.yaml
enablePrometheus: false
# Enable x509 automated certificate management using cert-manager (cert-manager.io)
enableCertManager: false
# Customize controlerManager
controllerManager:
  featureGates:
  - name: PartialAdmission
    enabled: true
  kubeRbacProxy:
...

Really thanks for your patience, sorry I didn't perfectly fix that empty line bug before. After looking through helm chart's official document, I found that it is becacuse of nindent, the nindent function is the same as the indent function, but prepends a new line to the beginning of the string. Last time when I try to fix that problem, I use another {{with}}, but end up with another bug. Sorry again for my careless, next time I shall be more careful, and test well in my local environment.

controllerManager:
 #featureGates:
 #  - name: PartialAdmission
 #    enabled: true
 #  - name: FlavorFungibility
 #    enabled: true
      containers:
      - args:
        - --config=/controller_manager_config.yaml
        - --zap-log-level=2
        {{- include "kueue.featureGates" . | indent 8 }}

Now I replaced nindent with indent, it works, and this PR should be ready to merge. Appreciate again! @tenzen-y

That makes sense. The latest commit should work well.
Thank you for the great work :)

/lgtm
/approve

/release-note-edit

Allow configuring featureGates on helm charts.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 14, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 2dd541dfb8205c649183db8c212cee42a2d4aa98

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: B1F030, kerthcet, tenzen-y

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 14, 2023
@tenzen-y
Copy link
Member

/release-note-edit Allow configuring featureGates on helm charts.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Nov 14, 2023
@k8s-ci-robot k8s-ci-robot merged commit cf25c71 into kubernetes-sigs:main Nov 14, 2023
14 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v0.6 milestone Nov 14, 2023
@B1F030 B1F030 deleted the helm-chart branch November 15, 2023 02:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Let Helm chart specify which FeatureGates should be used
5 participants