参考官网https://kubernetes.github.io/ingress-nginx/

部署pod:nginx-ingress-controller/nginx-default-backend
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/mandatory.yaml
配置修改:
1. 取消转发body限制:
kind: ConfigMap
apiVersion: v1
metadata:
name: nginx-configuration
namespace: ingress-nginx
labels:
app.kubernetes.io/name: ingress-nginx
app.kubernetes.io/part-of: ingress-nginx
data:
proxy-body-size: "0" k8s裸机部署bare-metal(nodeport方式):
部署service
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/provider/baremetal/service-nodeport.yaml 配置修改:
apiVersion: v1
kind: Service
metadata:
name: ingress-nginx
namespace: ingress-nginx
labels:
app.kubernetes.io/name: ingress-nginx
app.kubernetes.io/part-of: ingress-nginx
spec:
ports:
- name: http
port: 8083
targetPort: 80
protocol: TCP
- name: https
port: 8084
targetPort: 443
protocol: TCP
selector:
app.kubernetes.io/name: ingress-nginx
app.kubernetes.io/part-of: ingress-nginx
externalIPs:
- "{portal_host}" Note:保证镜像能正常下载 部署Ingress(前提:game2048-pod/service已经部署完毕)
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: game-ingress
namespace: default
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
nginx.ingress.kubernetes.io/ssl-redirect: "false"
spec:
rules:
- http:
paths:
- path: /game
backend:
serviceName: game2048
servicePort: 7090 验证:
curl http://external_ip:port/game
response正常 参考资料:
官方部署文档
https://kubernetes.github.io/ingress-nginx/
部署流程示例
https://blog.csdn.net/aixiaoyang168/article/details/78485581
暴露服务的几种方式:
https://medium.com/google-cloud/kubernetes-nodeport-vs-loadbalancer-vs-ingress-when-should-i-use-what-922f010849e0

最新文章

  1. 使用javax.servlet.http.Part类上传文件
  2. Vware Workstation pro 12|虚拟机
  3. C#综合笔记
  4. 解决play-1.4.0在linux或mac下提示No such file or directory的问题
  5. HDU 5773 最长上升子序列
  6. xunsearch增量索引改进版
  7. Linux启动过程详解(转)
  8. PopupWindwo和AlertDialog的区别
  9. java集合 collection-list-vector
  10. 敏捷开发概述与路线(转自MBAlib)
  11. MySQL 对于大表(千万级),要怎么优化呢?
  12. extjs combobox 设置下拉时显示滚动条 设置显示条数
  13. NGINX关于配置PATHINFO
  14. PHP学习笔记六【方法-递归】
  15. 【C语言探索之旅】 第二部分第十课:练习题和习作
  16. android:editable is deprecated: Use an <EditText> to make it editable
  17. KoaHub.js -- 基于 Koa.js 平台的 Node.js web 快速开发框架之koahub
  18. PHP openssl函数库
  19. mysql用户管理与备份
  20. VsCode插件开发之入门示例

热门文章

  1. Ubuntu中敲写c语言步骤
  2. hdu1059 dp(多重背包二进制优化)
  3. ES6必知必会 (二)—— 字符串和函数的拓展
  4. day23 python学习 类 人狗大战
  5. streamsets 集成 minio s3测试
  6. 调用webserver时出现:请求因 HTTP 状态 401 失败: Unauthorized。
  7. binlog cache size设置是否合理判断
  8. 监控Linux的Steps&Q&A
  9. nyoj 一笔画问题
  10. FastAdmin 开发环境详细设置