【问题标题】:Grafana, Prometheus, Kiali authentication with AzureAD and istio internal load balancer使用 AzureAD 和 istio 内部负载均衡器进行 Grafana、Prometheus、Kiali 身份验证
【发布时间】:2020-01-27 22:09:56
【问题描述】:

我正在 Azure Kubernetes 服务 (AKS) 中部署 istio,我有以下问题:

是否可以使用内部负载均衡器部署 istio。看起来它默认部署在 Azure 中并带有公共负载均衡器。我需要进行哪些更改才能使其使用内部负载平衡器?

【问题讨论】:

  • 为什么你在一个帖子中有两个单独的问题?他们甚至没有以任何方式连接

标签: azure prometheus grafana istio


【解决方案1】:

回答第二个问题:

可以根据 AKS documentation 为内部负载均衡器添加 AKS 注释:

要创建内部负载均衡器,请使用服务类型 LoadBalancerazure-load-balancer-internal 注释创建一个名为 internal-lb.yaml 的服务清单,如下例所示:

apiVersion: v1
kind: Service
metadata:
  name: internal-app
  annotations:
    service.beta.kubernetes.io/azure-load-balancer-internal: "true"
spec:
  type: LoadBalancer
  ports:
  - port: 80
  selector:
    app: internal-app

所以你可以通过使用带有以下 --set 的 helm 来设置这个注解:

helm template install/kubernetes/helm/istio --name istio --namespace istio-system --set gateways.istio-ingressgateway.serviceAnnotations.'service\.beta\.kubernetes\.io/azure-load-balancer-internal'="true" > aks-istio.yaml

正如评论中提到的,您应该按照here 的建议坚持每个帖子一个问题。所以我建议用其他问题创建第二个帖子。

希望对你有帮助。


更新:

对于 istioctl 可以执行以下操作:

  1. 为此示例为您的 istio 部署生成清单文件,我使用了演示配置文件。
istioctl manifest generate --set profile=demo > istio.yaml
  1. 修改istio.yaml并搜索type: LoadBalancer的文本。
---


apiVersion: v1
kind: Service
metadata:
  name: istio-ingressgateway
  namespace: istio-system
  annotations:
  labels:
    app: istio-ingressgateway
    release: istio
    istio: ingressgateway
spec:
  type: LoadBalancer
  selector:
    app: istio-ingressgateway
  ports:

像这样为内部负载均衡器添加注释:

---


apiVersion: v1
kind: Service
metadata:
  name: istio-ingressgateway
  namespace: istio-system
  annotations:
    service.beta.kubernetes.io/azure-load-balancer-internal: "true"
  labels:
    app: istio-ingressgateway
    release: istio
    istio: ingressgateway
spec:
  type: LoadBalancer
  selector:
    app: istio-ingressgateway
  ports:
  1. 保存更改后,将修改后的 istio.yaml 部署到您的 K8s 集群,使用:
kubectl apply -f istio.yaml

之后您可以验证istio-ingressgateway service 中是否存在注释。

$ kubectl get svc istio-ingressgateway -n istio-system -o yaml
apiVersion: v1
kind: Service
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"v1","kind":"Service","metadata":{"annotations":{"service.beta.kubernetes.io/azure-load-balancer-internal":"true"},"labels":{"app":"istio-ingressgateway","istio":"ingressgateway","release":"istio"},"name":"istio-ingressgateway","namespace":"istio-system"},"spec":{"ports":[{"name":"status-port","port":15020,"targetPort":15020},{"name":"http2","port":80,"targetPort":80},{"name":"https","port":443},{"name":"kiali","port":15029,"targetPort":15029},{"name":"prometheus","port":15030,"targetPort":15030},{"name":"grafana","port":15031,"targetPort":15031},{"name":"tracing","port":15032,"targetPort":15032},{"name":"tls","port":15443,"targetPort":15443}],"selector":{"app":"istio-ingressgateway"},"type":"LoadBalancer"}}
    service.beta.kubernetes.io/azure-load-balancer-internal: "true"
  creationTimestamp: "2020-01-27T13:51:07Z"

希望对你有帮助。

【讨论】:

  • 感谢您指出社区准则。我将分别询问身份验证问题。我没有使用头盔。你知道我如何使用 istioctl 来完成这个吗?
  • 我已经编辑了我的答案以包含 istioctl 的解决方案。
  • 我无法在 windows 框中运行此命令,因为我不断收到以下错误消息:Could not configure logs: couldn't open sink "/dev/null" 但是,我终于能够通过使用 helm 安装 istio-init 使其工作。然后我运行 helm template install/kubernetes/helm/istio --name istio --namespace istio-system --set gateways.istio-ingressgateway.serviceAnnotations.'service\.beta\.kubernetes\.io/azure-load-balancer-internal'="true" > aks-istio.yaml 替换了内部负载均衡器的注释,然后使用 kubectl 安装清单。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2018-07-06
  • 1970-01-01
  • 2023-04-04
  • 2020-11-05
  • 2021-02-04
  • 2020-08-31
  • 2022-10-24
相关资源
最近更新 更多