本文作者:丁辉
Ingress代理外部服务Teleport
准备
修改 Teleport 服务为 HTTP 协议
1 | proxy_service: |
开启对外访问
Endpoints 对接外部 Teleport
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: Endpoints
metadata:
name: teleport-proxy
namespace: teleport
subsets:
- addresses:
- ip: 127.0.0.1 # 修改为 Teleport 服务器访问地址
ports:
- port: 9443
protocol: TCP
apiVersion: v1
kind: Service
metadata:
name: teleport-proxy
namespace: teleport
spec:
ports:
- port: 9443
targetPort: 9443
type: ClusterIP
EOF配置对外 Ingress
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30cat <<EOF | kubectl apply -f -
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: teleport
namespace: teleport
annotations:
# 不限制文件上传大小
nginx.ingress.kubernetes.io/proxy-body-size: "0"
# 告诉Ingress后端是HTTP
nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
labels:
app: teleport
spec:
rules:
- host: teleport.example.com
http:
paths:
- pathType: Prefix
backend:
service:
name: teleport-proxy
port:
number: 9443
path: /
tls:
- hosts:
- teleport.example.com
secretName: teleport-tls
EOF访问即可
要是这篇文章为您解了惑、带来了帮助,不妨用小小的打赏来支持下我的创作吧,您的鼓励就是我持续分享的最大动力哦,感谢您啦!
- 本文链接: https://blog.offends.cn/Kubernetes/网关/Ingress/其他/Ingress代理外部服务Teleport.html
- 版权声明: 本博客所有文章除特别声明外,均默认采用 CC BY-NC-SA 4.0 许可协议。