-
Notifications
You must be signed in to change notification settings - Fork 777
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
Ingress for multiple paths not working on Raspberry Pi 4, Microk8s 1.19 #1584
Comments
Hi @sonttran thanks for using MicroK8s. Try removing the nginx rewrite annotation. |
Hi @balchua , I use the addon. I enabled it by running |
Does your error look similar to this? |
No, @balchua, I tried that too but it would not work for me. |
@sonttran apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: test-ingress
annotations:
nginx.ingress.kubernetes.io/use-regex: "true"
spec:
rules:
- host: test.com
http:
paths:
- path: /foo/.*
backend:
serviceName: test
servicePort: 80 By using the v1beta1 of ingress version? |
I had the same issue. My server was on UTC, my client on CEST. I changed the timezone on the server and it worked. |
Thanks for the suggestion @balchua. Tried that and it does not work. |
@sonttran do you mind pasting the |
hi did you try the example mentioned here https://github.com/nginxinc/kubernetes-ingress/tree/master/examples/rewrites apiVersion: networking.k8s.io/v1beta1
|
@balchua @reddeppas: thanks for the suggestions. This config now works for me. I need to comment out both apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: all-ingress
annotations:
# kubernetes.io/ingress.class: nginx # strangely, rm this make multiple paths working
# nginx.ingress.kubernetes.io/rewrite-target: / # strangely, rm this make multiple paths working
nginx.ingress.kubernetes.io/enable-cors: "true"
labels:
app: ingress
spec:
defaultBackend:
service:
name: nginx
port:
number: 80
rules:
- http:
paths:
- path: /moon
pathType: Prefix
backend:
service:
name: moon
port:
number: 3000
- path: /earth
pathType: Prefix
backend:
service:
name: earth
port:
number: 3000
- path: /
pathType: Prefix
backend:
service:
name: nginx
port:
number: 80 |
Hi @sonttran im going to close this issue now that you have resolved it. Thanks! |
Ubuntu 20.04.1
Raspberry Pi 4B 4Gb
Microk8s 1.19
Hi, I have a simple nginx ingress setup on Mircok8s 1.19 running on Raspberry Pi 4B. But the multiple paths won't work. However, if I delete all paths and keep the root one, it will work. My backend pods can receive requests on both configs. But for multiple paths config ingress, the full path won't be passed down to backend. I.e.
With this config:
Expected:
/moon/and/anything/esle
will hitmoon
backend. But in reality, looking at the pod log, I see/
as the request path.Expected:
/earth/and/anything/esle
will hitearth
backend. But in reality, looking at the pod log, I see/
as the request path.However, if I remove all paths and only keep the root one
/
. Ingress will pass down request with path correctly. I.e.With this config:
/moon/api/login
will hitmoon
backend correctly. And logs inmoon
pod show request path as/moon/api/login
.Full non-working Ingress config with multiple paths:
Full working Ingress config with single path.
Reference: docs on official Kubernetes Ingress config.
Inspect tarball attached.
Any help is very much appreciated. Thank you!
inspection-report-20200919_233343.tar.gz
The text was updated successfully, but these errors were encountered: