-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Second controller with controller-class configured listens to incorrect IngressClass #7538
Comments
@MarkMckessock: This issue is currently awaiting triage. If Ingress contributors determines this is a relevant issue, they will accept it by applying the The 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. |
hi, Can you kindly check if the known issues like #7510 and #7502 are related . Also, one other request is, can you kindly edit the data related related to the ingress objects in your report above and actually replace the current text with the output of ;
|
/assign |
Hi, Just as an update, I was able to reproduce the problem and see the error messages in the logs exactly as you described. Then after reading this, https://kubernetes.io/docs/concepts/services-networking/ingress/#deprecated-annotation ,
% k explain ingress.spec.ingressClassName FIELD: ingressClassName DESCRIPTION:
Can you try the ingressClassName field instead of the annotation and update. |
I've been having similar issues with v1.0.0 - played with a lot of different configuration that all lead to the same behaviour as described, an ingress reserved for a specific ingressClass which was working under v0.48.1 is now being served by another controller. Currently I've got a configuration where the documentation for running multiple controllers got our configuration working (with a downtime). This is in conflict with the docs at the user guide multiple ingress section. Working example configController arguments: - name: controller
image: k8s.gcr.io/ingress-nginx/controller:v1.0.0
imagePullPolicy: IfNotPresent
lifecycle:
preStop:
exec:
command:
- /wait-shutdown
args:
- /nginx-ingress-controller
- --publish-service=$(POD_NAMESPACE)/ingress-nginx-controller
- --election-id=ingress-controller-leader
- --ingress-class=k8s.io/default-internal
- --controller-class=k8s.io/default-internal
- --configmap=$(POD_NAMESPACE)/ingress-nginx-controller
- --update-status-on-shutdown=false Matching IngressClass: apiVersion: networking.k8s.io/v1
kind: IngressClass
metadata:
name: default-internal
spec:
controller: k8s.io/default-internal Ingress using the IngressClass: apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: xxx
namespace: xxx
labels:
app: xxx
annotations:
nginx.ingress.kubernetes.io/proxy-body-size: 16m
spec:
ingressClassName: default-internal Conclusions
edit: We just migrated another system over following this process:
It seems like the ingressClass definitions are cached after startup? We did not experience any downtime during this that lead us to this theory - seems a bit counter intuitive but seems to work. |
Thanks @longwuyuan for your quick response. It would seem that you are correct regarding the issue being the deprecated annotations. After adding the @Deichindianer I did not deploy the controller with both the |
@MarkMckessock thanks for confirming. You could close the issue if that settles it. |
/kind documentation |
NGINX Ingress controller version: v1.0.0
Kubernetes version (use
kubectl version
): v1.20.7+k3s1Environment: Bare-metal
uname -a
): 5.10.52-v8+ (aarch64)How was the ingress-nginx-controller installed:
Controller deployed via helm charts using Flux
Helm Values'
Current State of the controller:
`nginx` Pod Description
`nginx-public` Pod Description
nginx
IngressClassnginx-public
IngressClasskubectl -n ingress-nginx logs ingress-nginx-controller-84577d6675-9xtkn | grep home-assistant
('nginx' controller)kubectl -n ingress-nginx-public logs ingress-nginx-public-controller-7bccd8d57-wrnmt | grep home-assistant
('nginx-public' controller)nginx-public
ingress class.ingress class annotation is not equal to the expected by Ingress Controller
would seem to indicate that it is indeed not listening to the correct ingressclass.What happened:
I have created two instances of ingress-nginx:
ingress-nginx
andingress-nginx-public
. Each lives in their own namespace and has an associated IngressClass (nginx
andnginx-public
respectively). For theingress-nginx
deployment, I have modified the controller-class value so that it is unique and matches the associated ingress class.Ingresses assigned to the default
nginx
class (or none at all) are served properly by thenginx
ingress class, but ingresses assigned to thenginx-public
class are not served at all and are not assigned an address. From the controller logs, these ingresses are being ignore because the controller is not using the correct ingress class name. It appears that the controller is still listening to the standardnginx
ingress class because I can see the loadbalancer IPs for my ingresses bounce back and forth between the addresses assigned to each controller.What you expected to happen:
The second controller should be properly listening to the
nginx-public
ingress class and not attempt to server ingresses using thenginx
class.How to reproduce it:
nginx
ingress using helm chart and values specified abovenginx-public
ingress using helm chart and values specified above/kind bug
The text was updated successfully, but these errors were encountered: