当前位置:网站首页>Helm deploy traifik ingress
Helm deploy traifik ingress
2022-06-11 02:55:00 【Easy is not easy】
1、 add to traefik helm Warehouse
$ helm repo add traefik https://helm.traefik.io/traefik
$ helm repo update2、 Download to local
$ helm search repo traefik
NAME CHART VERSION APP VERSION DESCRIPTION
traefik/traefik 10.20.1 2.7.0 A Traefik based Kubernetes ingress controller
$ helm pull traefik/traefik3、 Deploy Traefik
3.1 modify values
#type: LoadBalancer
type: ClusterIP
ports:
traefik:
port: 8080
hostPort: 8080
exposedPort: 8080
expose: true
protocol: TCP
add to
additionalArguments:
- "--serversTransport.insecureSkipVerify=true"
- "--api.insecure=true"
- "--api.dashboard=true"
Or simply
The full configuration is as follows
==================================
service:
type: ClusterIP
ingressRoute:
dashboard:
enabled: false
nodeSelector:
kubernetes.io/hostname: k8snode1
ports:
web:
hostPort: 80
websecure:
hostPort: 443
traefik:
port: 8080
hostPort: 8080
exposedPort: 8080
expose: true
additionalArguments:
- "--serversTransport.insecureSkipVerify=true"
- "--api.insecure=true"
- "--api.dashboard=true"3.2 Deploy
$ helm install traefik traefik/traefik -f values.yaml -n kube-system # Deploy
Other commands
$ helm upgrade traefik traefik/traefik -n kube-system # to update
$ helm uninstall traefik -n kube-system # uninstall traefik
# Check the status
$ helm list -n kube-system
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
traefik kube-system 1 2022-06-07 15:05:58.300911179 +0800 CST deployed traefik-10.20.1 2.7.0
$ helm status traefik -n kube-system
NAME: traefik
LAST DEPLOYED: Tue Jun 7 15:05:58 2022
NAMESPACE: kube-system
STATUS: deployed
REVISION: 1
TEST SUITE: None
4 Create routing rules
4.1 Native Ingress Routing rules
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: traefik-dashboard-ingress
namespace: kube-system
annotations:
kubernetes.io/ingress.class: traefik
traefik.ingress.kubernetes.io/router.entrypoints: web
spec:
rules:
- host: traefik.ingress.cn
http:
paths:
- pathType: Prefix
path: /
backend:
service:
name: traefik
port:
number: 8080
4.2 Use CRD Configure routing rules by
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: traefik-dashboard-route
namespace: kube-system
spec:
entryPoints:
- web
routes:
- match: Host(`traefikroute.ingress.cn`)
kind: Rule
services:
- name: traefik
port: 8080
namespace: kube-system # Want to be with traefik ingress In the same namespace , You can visit ,
Such as :http://traefikroute.ingress.cn/dashboard/#/
Otherwise, you need to add expose Port set in ; Such as http://traefikroute.ingress.cn:8080/
5 visit
http://traefik.ingress.com
http://traefik.ingress.com/dashboard6 verification
expose HTTP service
# establish pod and svc
cat > whoami.yaml << EOF
---
apiVersion: v1
kind: Pod
metadata:
name: whoami
labels:
app: whoami
spec:
containers:
- name: whoami
image: traefik/whoami:latest
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: whoami
spec:
ports:
- port: 80
protocol: TCP
targetPort: 80
selector:
app: whoami
type: ClusterIP
EOF
==========================
Create a routing rule , Make it accessible to the outside
cat > whoami-ingressroute.yaml << EOF
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: whoami-route
spec:
entryPoints:
- web
routes:
- match: Host(`whoami.ingress.cn`)
kind: Rule
services:
- name: whoami
port: 80
EOFBrowser access whoami.ingress.cn


Personal summary :
1、 The others are through traefik Agent resource application pod,service You don't need to traefik In the same namespace , That is, namespace pairs traefik There is no limit to agency


Neither of the above two examples is in traefik ingress In the namespace of
2、 But the deployment instance is pod service Routing rules All need to be in the same namespace
边栏推荐
- Limiting visibility of symbols when linking shared libraries
- The new colleague asked me what "where 1=1" means???
- Navicat Premium 15 工具自动被杀毒防护软件删除解决方法
- 学习太极创客 — ESP8226 (二)
- How to add cookie pop-up window in WordPress website (without plug-in)
- 2022年熔化焊接与热切割操作证考试题库及答案
- HOSATAPD_ CLI debug using WiFi whitelist
- Arduino uno connected to jq8900-16p voice broadcast module
- 【189. 轮转数组】
- 20220610 星期五
猜你喜欢

Rs232/rs485 to 4G DTU uploading temperature and humidity sensor data based on Modbus protocol to remote TCP server

第七章 常用的协议简介(1)

Uni app - one click access to user information

软件测试英语常见词汇

从绿联冲刺IPO,看手机配件市场沉浮录

The two request sessionids of the same user are inconsistent ----- record the problem

Tests logiciels vocabulaire commun anglais

Win10 安装Office 2016出现错误代码30204-44怎么处理?

js 内存泄漏

6 best WordPress Image optimizer plug-ins to improve WordPress website performance
随机推荐
Navicat Premium 15 工具自动被杀毒防护软件删除解决方法
CPT 102_ LEC 20
A collection of common ADB commands for app testing
How to add two factor authentication for WordPress websites
jdbc工具类的问题
怎样确保消息的可靠性投递?
第七章 常用的协议简介(1)
蓝桥杯_小蓝吃糖果_鸽巢原理 / 抽屉原理
Location data fusion Table 3
Prophet
Manon's advanced road - Daily anecdotes
Why did those who left Beijing, Shanghai and Guangzhou with a smile cry in the end?
AOSP ~ 默认开启开发者模式
逃离大城市的年轻人:扛住了房价和压力,没扛住流行病
[resolved] how to fix another update in progress WordPress upgrade error
JS memory leak
One line of code solves the problem that the time to fetch datetime from MySQL database is less than eight hours
Niuke: two numbers that only appear once in the array
Baidu submits sitemap to prompt the solution of "index type is not handled"
Xampp is used under M1 chip, and the installation extension error