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

[helm] add if for ingressClassName #8613

Closed
wants to merge 1 commit into from

Conversation

jmnote
Copy link
Contributor

@jmnote jmnote commented Jan 11, 2024

using default ingressClass by default.

AS-IS

$ helm template . --set app.ingress.ingressClassName=hello | grep ingressClassName:
  ingressClassName: hello
$ helm template . --set app.ingress.ingressClassName="" | grep ingressClassName:
  ingressClassName: 
$ helm template . | grep ingressClassName:
  ingressClassName: internal-nginx
$

TO-BE

$ helm template . --set app.ingress.ingressClassName=hello | grep ingressClassName:
  ingressClassName: hello
$ helm template . --set app.ingress.ingressClassName="" | grep ingressClassName:
$ helm template . | grep ingressClassName:
$

If ingressClassName is not specified, the ingressClassName block is omitted. This allows us to use the cluster's default IngressClass.

similar case(helm chart):
https://github.com/prometheus-community/helm-charts/blob/alertmanager-1.7.0/charts/alertmanager/templates/ingress.yaml#L16-L18

k8s docs:
https://kubernetes.io/docs/concepts/services-networking/ingress/#default-ingress-class

Signed-off-by: Jmnote <opcore@gmail.com>
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jan 11, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: jmnote
Once this PR has been reviewed and has the lgtm label, please assign desaintmartin for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

@@ -85,7 +85,7 @@ app:
# https://localhost:8443
- localhost
# - kubernetes.dashboard.domain.com
ingressClassName: internal-nginx
ingressClassName: ""
Copy link
Member

Choose a reason for hiding this comment

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

If ingressClassName is ommited, , a default Ingress class should be defined.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

@jmnote jmnote Jan 24, 2024

Choose a reason for hiding this comment

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

I confirmed that it can be applied normally even if the value of ingressClassName: is omitted in the YAML file as follows.

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: example
spec:
  ingressClassName: #### Only key, no value
  rules:
    - host: example.com
      http:
        paths:
          - pathType: ImplementationSpecific
            backend:
              service:
                name: release-name-kubernetes-dashboard-web
                port:
                  name: web

However, there don't seem to be many cases of empty value in the Kubernetes manifest or Helm Chart value yaml.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 2, 2024
@k8s-ci-robot
Copy link
Contributor

PR needs rebase.

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.

@floreks
Copy link
Member

floreks commented Mar 4, 2024

It will be covered by #8735 in here.

/close

@k8s-ci-robot
Copy link
Contributor

@floreks: Closed this PR.

In response to this:

It will be covered by #8735 in here.

/close

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.

@jmnote jmnote deleted the default-ingressClass branch March 4, 2024 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[helm] cannot use default ingressClass
4 participants