【问题标题】:Kubernetes Dashboard behind AWS ELB or internal LBAWS ELB 或内部 LB 后面的 Kubernetes 仪表板
【发布时间】:2018-12-17 03:59:00
【问题描述】:

我已经通过以下方式部署了 K8s 仪表板 kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml.

我可以通过运行kubectl proxy 连接到仪表板。

我的问题是如何通过内部 LB 或 ELB 公开此仪表板?

我已经更改了 kubernetes-dashboard 服务

kind: Service
apiVersion: v1
metadata:
  labels:
    k8s-app: kubernetes-dashboard
  name: kubernetes-dashboard
  namespace: kube-system
  annotations:
    # service.beta.kubernetes.io/aws-load-balancer-internal: 0.0.0.0/0
    service.beta.kubernetes.io/aws-load-balancer-backend-protocol: http
spec:
  type: LoadBalancer
  # loadBalancerSourceRanges:
  # - x.x.x.x/32
  ports:
  - port: 80
    targetPort: 8443
    protocol: TCP
  selector:
    k8s-app: kubernetes-dashboard

然后我点击了 ELB DNS 记录,但没有任何返回(例如 - xxxxxxxxxxx.us-east-1.elb.amazonaws.com)。

有人知道如何解决这个问题吗?

注意 - 这是一个 POC 集群,目前我没有任何安全问题。

谢谢

【问题讨论】:

    标签: kubernetes kubectl kubernetes-dashboard


    【解决方案1】:
    kind: Service
    apiVersion: v1
    metadata:
      labels:
        k8s-app: kubernetes-dashboard
      name: kubernetes-dashboard
      namespace: kube-system
      annotations:
        service.beta.kubernetes.io/aws-load-balancer-internal: 0.0.0.0/0
    spec:
      type: LoadBalancer
      ports:
        - port: 443
          protocol: TCP
          targetPort: 8443
      selector:
        k8s-app: kubernetes-dashboard
    

    https://<internal-lb-dns-record> 应该可以工作。

    【讨论】:

      猜你喜欢
      • 2018-01-21
      • 1970-01-01
      • 2017-11-17
      • 2019-04-20
      • 1970-01-01
      • 1970-01-01
      • 2019-03-13
      • 1970-01-01
      • 2019-07-08
      相关资源
      最近更新 更多