k8s部署ingress:使用heptio-contour部署ingress controller(通过sealos安装,非nginx-ingress类型)
生活随笔
收集整理的這篇文章主要介紹了
k8s部署ingress:使用heptio-contour部署ingress controller(通过sealos安装,非nginx-ingress类型)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
詳解
代碼
概覽
[root@m-1 ingress]# tree . ├── deploy-svc.sh ├── deploy.yaml ├── example-ingress.yaml ├── ingress.tar └── svc.yaml0 directories, 5 files部署ingress
sealos install --pkg-url ./ingress.tardeploy-svc.sh
[root@m-1 ingress]# cat deploy-svc.sh #!/bin/bashsudo kubectl create deploy web --image=nginx:1.14-alpine -n dmgeo -o yaml > deploy.yaml sudo kubectl expose deploy web --port=80 --target-port=80 --type=NodePort -n dmgeo -o yaml > svc.yamlexample-ingress.yaml
[root@m-1 ingress]# cat example-ingress.yaml apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata:name: example-ingressnamespace: dmgeo spec:rules:- host: example.ingressdemo.comhttp:paths:- path: /backend:serviceName: webservicePort: 80查看ingress端口
[root@m-1 ingress]# sudo kubectl get -n heptio-contour service contour -o wide NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE SELECTOR contour LoadBalancer 10.97.190.104 <pending> 80:18181/TCP,443:4408/TCP 35m app=contour [root@m-1 ingress]#效果
參考鏈接:
https://github.com/bsmr/heptio-contour
總結
以上是生活随笔為你收集整理的k8s部署ingress:使用heptio-contour部署ingress controller(通过sealos安装,非nginx-ingress类型)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【好文收藏】K8S集群部署CoreDNS
- 下一篇: linux根据端口查pid、根据pid查