k8s部署ingress:使用heptio-contour部署ingress controller(通过sealos安装,非nginx-ingress类型)

540 篇文章 111 订阅

详解

请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述

请添加图片描述
请添加图片描述

代码

概览

[root@m-1 ingress]# tree
.
├── deploy-svc.sh
├── deploy.yaml
├── example-ingress.yaml
├── ingress.tar
└── svc.yaml

0 directories, 5 files

部署ingress

sealos install --pkg-url ./ingress.tar

deploy-svc.sh

[root@m-1 ingress]# cat deploy-svc.sh 
#!/bin/bash

sudo 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.yaml

example-ingress.yaml

[root@m-1 ingress]# cat example-ingress.yaml 
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: example-ingress
  namespace: dmgeo
spec:
  rules:
  - host: example.ingressdemo.com
    http:
      paths:
      - path: /
        backend:
          serviceName: web
          servicePort: 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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

学亮编程手记

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值