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