kustomize icon indicating copy to clipboard operation
kustomize copied to clipboard

[Question] With extraArgs deprecated on kustomize version 4.1.2 how to pass --api-versions ?

Open Berveglieri opened this issue 4 years ago • 9 comments

Hi,

I have the following manifest definition

` apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization

helmCharts:

  • name: grafana version: 6.8.2 repo: https://grafana.github.io/helm-charts valuesFile: grafana-values.yaml releaseName: grafana `

The Ingress configuration is defined to use the apiVersion: networking.k8s.io/v1, but this is not being respected, it keeps applying the apiVersion: extensions/v1beta1, how could I force now in Kustomize version 4.1.2 to use the parameter that was working fine on version 3.4 extraArgs:

  • "--api-versions=networking.k8s.io/v1/IngressClass"

I have tried to check the code implementation here -> https://github.com/kubernetes-sigs/kustomize/blob/master/api/types/helmchartargs.go but I don't see any way to pass extra arguments to helm.

The explanation here -> https://github.com/kubernetes-sigs/kustomize/pull/3784 is not clear in how to handle it.

Could someone please help me to understand how to handle this in this new version?

Thank you.

Berveglieri avatar Oct 23 '21 23:10 Berveglieri

I am currently running in the same problem. is there a solution for setting the api-versions or the kube-version to get the correct .Capabilities.APIVersions.Has setuped for helm?

in my case I try to render traefik with ingressClass but this is not possible since helm does not show the Capabilities for networking.k8s.io/v1beta1 or networking.k8s.io/v1 ingressClass

example:

helmCharts:
- name: traefik
  includeCRDs: true
  valuesInline:
    ingressClass:
      enabled: true
    deployment:
      replicas: 3
  releaseName: traefik
  version: 10.6.1
  repo: https://helm.traefik.io/traefik

Links2004 avatar Nov 18 '21 07:11 Links2004

@Berveglieri or @Links2004 Did you figure out a workaround for this? I'm also having this problem.

metasim avatar Dec 01 '21 18:12 metasim

Hi @metasim, I was able to make it work passing the following labelSelector

labelSelector: "app.kubernetes.io/managed-by=Helm"

So in my kustomization.yaml I did the following to replace to the new ingress format before upgrading kubernetes to 1.21

 ` - patch: |-
  - op: replace
    path: "/apiVersion"
    value: networking.k8s.io/v1
target:
  group: networking.k8s.io
  version: v1beta1
  kind: Ingress
  labelSelector: "app.kubernetes.io/managed-by=Helm"
  name: oauth2-proxy
  namespace: stable`
  
  and patched my ingress file with the new format for the version networking.k8s.io/v1

apiVersion: extensions/v1beta1 kind: Ingress metadata: name: grafana spec: rules: - host: my-hostname.com http: paths: - backend: service: name: grafana port: number: 80 path: / pathType: ImplementationSpecific

if you have any questions feel free to ping me directly.

Berveglieri avatar Dec 03 '21 08:12 Berveglieri

Thats...not a solution to the problem at all though? Being able to use a patch to fix the thing is not a substitute for being able to pass the correct argument.

pbecotte avatar Dec 06 '21 17:12 pbecotte

I never said it was a solution for the problem, I said that was the way I've found to make it work and shared. But as mentioned, there is a comment of the developer saying why it was disabled and the security reasons implied.

Berveglieri avatar Dec 08 '21 10:12 Berveglieri

Ah I didn't fully understand the original comment. Fair enough, though if you wanted to leave this ticket open so that maybe it can be fixed somehow that would make sense to me ;)

pbecotte avatar Dec 08 '21 14:12 pbecotte

/reopen /area helm /tirage accepted

natasha41575 avatar Feb 20 '22 06:02 natasha41575

@natasha41575: Reopened this issue.

In response to this:

/reopen /area helm /tirage accepted

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 avatar Feb 20 '22 06:02 k8s-ci-robot

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Aug 02 '22 17:08 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot avatar Sep 01 '22 18:09 k8s-triage-robot

Any update on this?

roymartinezblanco avatar Sep 06 '22 12:09 roymartinezblanco

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

k8s-triage-robot avatar Oct 06 '22 12:10 k8s-triage-robot

@k8s-triage-robot: Closing this issue, marking it as "Not Planned".

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

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 avatar Oct 06 '22 12:10 k8s-ci-robot

its very basic feature, lots of template make use of Capabilities.APIVersions.Has

due to even very basic aws csi driver don't work with kubernetes version 1.25 either it should pick version from cluster or let us define the kuberetes version or simply the extra flag of extraArgs like before

image

patching is ok for short time, but not good practice

dev-mraj avatar Mar 04 '23 05:03 dev-mraj

Can we reopen this issue? As the poster above said, many Charts use .Capabilities.

Preisschild avatar Mar 09 '23 12:03 Preisschild