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

service/ingress-nginx-controller annotation #11272

Closed
clickersmudge opened this issue Apr 18, 2024 · 7 comments
Closed

service/ingress-nginx-controller annotation #11272

clickersmudge opened this issue Apr 18, 2024 · 7 comments
Labels
kind/support Categorizes issue or PR as a support question. needs-priority needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.

Comments

@clickersmudge
Copy link

clickersmudge commented Apr 18, 2024

Hi,
I have a Kubernetes cluster in a Hetzner cloud.
Every time I install "ingress-nginx" I have to add the corresponding annotation.

kubectl annotate service --namespace ingress-nginx ingress-nginx-controller load-balancer.hetzner.cloud/location=<LOCATION> # nbg1

Without annotation, LoadBalancer has a pending status all the time.
enter image description here

I set up the whole deployment in Argo CD.

values.yaml

I have added annotation wherever I can
service:
    # -- Enable controller services or not. This does not influence the creation of either the admission webhook or the metrics service.
    enabled: true
    external:
      # -- Enable the external controller service or not. Useful for internal-only deployments.
      enabled: true
    # -- Annotations to be added to the external controller service. See `controller.service.internal.annotations` for annotations to be added to the internal controller service.
    annotations:
      load-balancer.hetzner.cloud/location: nbg1
    # -- Labels to be added to both controller services.
    labels:
      load-balancer.hetzner.cloud/location: nbg1

I added annotation I think everywhere I could, however, it doesn't work.

enter image description here

enter image description here

@clickersmudge clickersmudge added the kind/bug Categorizes issue or PR as related to a bug. label Apr 18, 2024
@k8s-ci-robot k8s-ci-robot added needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority labels Apr 18, 2024
@longwuyuan
Copy link
Contributor

longwuyuan commented Apr 18, 2024

/remove-kind bug
/triage accepted

post your values.yaml file exactly as it is being used. What you posted is invalid. The field is controller.service.annotation

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. kind/bug Categorizes issue or PR as related to a bug. labels Apr 18, 2024
@longwuyuan
Copy link
Contributor

longwuyuan commented Apr 18, 2024

My values.yaml

% cat values.yaml 
controller:
  service:
    annotations:
      load-balancer.hetzner.cloud/location: nbg1
[~/Documents/ingressnginxissues/11272] 

My controller-service.yaml after helm templating using my values.yaml shows the annotation

% helm install ingress-nginx-2 ingress-nginx/ingress-nginx  \
--namespace ingress-nginx-2 \
--set controller.ingressClassResource.name=nginx-two \
--set controller.ingressClass=nginx-two \
--set controller.ingressClassResource.controllerValue="example.com/ingress-nginx-2" \
--set controller.ingressClassResource.enabled=true \
--set controller.ingressClassByName=true \
--values values.yaml \
--dry-run=client  | grep "controller-service.yaml" -A 6
# Source: ingress-nginx/templates/controller-service.yaml
apiVersion: v1
kind: Service
metadata:
  annotations:
    load-balancer.hetzner.cloud/location: "nbg1"
  labels:
[~/Documents/ingressnginxissues/11272] 

@longwuyuan
Copy link
Contributor

/remove-triage accepted
/kind support

@k8s-ci-robot k8s-ci-robot added kind/support Categorizes issue or PR as a support question. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. and removed needs-kind Indicates a PR lacks a `kind/foo` label and requires one. triage/accepted Indicates an issue or PR is ready to be actively worked on. labels Apr 18, 2024
@clickersmudge
Copy link
Author

clickersmudge commented Apr 18, 2024

Hi @longwuyuan thank you for your quick response.

Chart.yaml

apiVersion: v2
name: ingress-nginx
description: Ingress controller for Kubernetes using NGINX as a reverse proxy and load balancer

type: application

version: 4.10.0

appVersion: "1.10.0"

dependencies:
- name: ingress-nginx
  version: 4.10.0
  repository: https://kubernetes.github.io/ingress-nginx

values.yaml

controller:
  nodeSelector:
    architecture: arm
  autoscaling:
    enabled: true
  service:
    annotations:
      load-balancer.hetzner.cloud/location: nbg1

obraz

Working
obraz

I don't know what I was doing wrong earlier.

Maybe other labels
values.yaml

controller:
  nodeSelector:
    architecture: arm
  autoscaling:
    enabled: true
  service:
    annotations:
      load-balancer.hetzner.cloud/location: nbg1
      load-balancer.hetzner.cloud/type: lb11
      load-balancer.hetzner.cloud/use-private-ip: "true"
      load-balancer.hetzner.cloud/disable-private-ingress: "true"

obraz

Yes,
it looks like other labels are causing this.

@longwuyuan Do you have any idea what is causing the problem with several labels?

@longwuyuan
Copy link
Contributor

no idea. but almost certainly seems like parsing. do the helm templating and you will know.

Please close the issue if not a problem of the controller.

@longwuyuan
Copy link
Contributor

/close

reopen if there is a problem found in the controller

@k8s-ci-robot
Copy link
Contributor

@longwuyuan: Closing this issue.

In response to this:

/close

reopen if there is a problem found in the controller

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/support Categorizes issue or PR as a support question. needs-priority needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.
Projects
Development

No branches or pull requests

3 participants