kubernetes-Ingress nginx
2022/6/28 5:21:31
本文主要是介绍kubernetes-Ingress nginx,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
内部pod是Https
apiVersion: networking.k8s.io/v1 kind: Ingress metadata: namespace: xxx name: xxx-web annotations: # 文件上传限制 nginx.ingress.kubernetes.io/proxy-body-size: "200M" nginx.ingress.kubernetes.io/backend-protocol: HTTPS spec: ingressClassName: nginx rules: - host: www.xxx.net http: paths: - path: / pathType: Prefix backend: service: name: xxx-web port: number: 443
Ingress配置Https
https://kubernetes.io/zh-cn/docs/concepts/services-networking/ingress/
- 创建secret
kubectl create secret tls xxx-secret --cert=xxx.crt --key=xxx.key
- 配置
apiVersion: networking.k8s.io/v1 kind: Ingress metadata: namespace: xxx name: xxx-web annotations: # 文件上传限制 nginx.ingress.kubernetes.io/proxy-body-size: "200M" nginx.ingress.kubernetes.io/backend-protocol: HTTPS spec: ingressClassName: nginx tls: - hosts: - www.xxx.net secretName: xxx-secret rules: - host: www.xxx.net http: paths: - path: / pathType: Prefix backend: service: name: xxx-web port: number: 443
Websocket配置
apiVersion: networking.k8s.io/v1 kind: Ingress metadata: namespace: xxx name: xxx-web annotations: # 代理发送超时 nginx.ingress.kubernetes.io/proxy-send-timeout: "3600" # 代理读取超时 nginx.ingress.kubernetes.io/proxy-read-timeout: "3600" # 代理连接超时 nginx.ingress.kubernetes.io/proxy-connect-timeout: "3600" # 基于客户端出口ip哈希 nginx.ingress.kubernetes.io/upstream-hash-by: "$http_x_forwarded_for" spec: ingressClassName: nginx rules: - host: www.xxx.net http: paths: - path: / pathType: Prefix backend: service: name: xxx-web port: number: 443
这篇关于kubernetes-Ingress nginx的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-11-15在Kubernetes (k8s) 中搭建三台 Nginx 服务器怎么实现?-icode9专业技术文章分享
- 2024-11-05基于Kubernetes的自定义AWS云平台搭建指南
- 2024-11-05基于Kubernetes Gateway API的现代流量管理方案
- 2024-11-05在Kubernetes上部署你的第一个应用:Nginx服务器
- 2024-11-05利用拓扑感知路由控制Kubernetes中的流量
- 2024-11-05Kubernetes中的层次命名空间:更灵活的资源管理方案
- 2024-11-055分钟上手 Kubernetes:精简实用的 Kubectl 命令速查宝典!
- 2024-10-30K8s 容器的定向调度与亲和性
- 2024-10-28云原生周刊:K8s未来三大发展方向 丨2024.10.28
- 2024-10-25亚马逊弹性Kubernetes服务(EKS)实战:轻松搭建Kubernetes平台