admin管理员组文章数量:1392002
I have a web application running on kubernetes cluster. There are some cookies on the frontend part and I want to add this cookies in the request header. I'm using axios for sending request. I added withCredentials: true
to axios instance. In the backend there is node.js. I added app.use(cors({origin: true, credentials: true}));
middleware. When I run the app locally, frontend part is sending the cookies I can see it on the network tab. So I assume that I need to do some modification in kubernetes ingress. Here is my kubernetes ingress for backend and frontend:
Frontend:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: client-ingress
namespace: {{ .Values.namespace }}
annotations:
cert-manager.io/cluster-issuer: letsencrypt
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
ingressClassName: nginx
tls:
- hosts:
- {{ .Values.ingress.hostname }}
secretName: {{ .Values.frontend.name }}-tls
rules:
- host: {{ .Values.ingress.hostname }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: client-cluster-ip-service
port:
number: 5000
Backend:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: server-ingress
namespace: {{ .Values.namespace }}
annotations:
cert-manager.io/cluster-issuer: letsencrypt
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
ingressClassName: nginx
tls:
- hosts:
- {{ .Values.ingress.hostname }}
secretName: {{ .Values.backend.name }}-tls
rules:
- host: {{ .Values.ingress.hostname }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: server-cluster-ip-service
port:
number: 8000
What can I do? Do you think I need to add something to this ingress? Or do you think problem is something else?
本文标签: nodejsHow to modify Kubernetes ingress for sending cookieStack Overflow
版权声明:本文标题:node.js - How to modify Kubernetes ingress for sending cookie? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744764493a2623955.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论