banner
欢迎观看

Ingress代理外部服务Teleport

Scroll down

本文作者:丁辉

Ingress代理外部服务Teleport

准备

修改 Teleport 服务为 HTTP 协议

1
2
3
4
5
6
7
8
9
10
proxy_service:
enabled: "yes"
web_listen_addr: 0.0.0.0:9443
public_addr: teleport.example.com:443 # 对外访问地址
# 删除如下内容
# https_keypairs:
# - key_file:
# cert_file:
# https_keypairs_reload_interval: 0s
# acme: {}

开启对外访问

  1. 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
    24
    cat <<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
  2. 配置对外 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
    30
    cat <<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
  3. 访问即可

要是这篇文章为您解了惑、带来了帮助,不妨用小小的打赏来支持下我的创作吧,您的鼓励就是我持续分享的最大动力哦,感谢您啦!

其他文章
cover
Docker部署Tor实现匿名通信
  • 70/01/01
  • 00:00
  • Kubernetes-Docker
cover
Docker部署Watchtower管理容器更新
  • 70/01/01
  • 00:00
  • Kubernetes-Docker
目录导航 置顶
  1. 1. Ingress代理外部服务Teleport
    1. 1.1. 准备
    2. 1.2. 开启对外访问
请输入关键词进行搜索