azure - 使用 AzureAD 和 istio 内部负载均衡器进行 Grafana、Prometheus、Kiali 身份验证
问题描述
我在 azure kubernetes 服务 (AKS) 中部署 istio,我有以下问题:
是否可以使用内部负载均衡器部署 istio。看起来它默认部署在 Azure 中并带有公共负载均衡器。我需要进行哪些更改才能使其使用内部负载均衡器?
解决方案
回答第二个问题:
可以根据 AKS文档为内部负载均衡器添加 AKS 注释:
要创建内部负载均衡器,请创建一个以
internal-lb.yaml
服务类型LoadBalancer和azure-load-balancer-internal
注解命名的服务清单,如以下示例所示: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
如评论中所述,您应该按照此处的建议坚持每个帖子一个问题。所以我建议用其他问题创建第二个帖子。
希望能帮助到你。
更新:
对于 istioctl 您可以执行以下操作:
- 为您的 istio 部署生成清单文件,我使用了演示配置文件。
istioctl manifest generate --set profile=demo > istio.yaml
- 修改
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:
- 保存更改后,使用以下命令将修改后的部署
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"
希望能帮助到你。
推荐阅读
- javascript - WebRTC 不显示视频 peerConnection 远程视频
- vue.js - 无法使用多个
在 Vuetify 中 - python - 使用(启用 java 的?)下拉选择的 Python 选择
- mysql - 使用jsp multipartrequest将文件名保存到mysql数据库和文件到文件夹
- c - 天到年、月、天的转换在 c 中没有显示正确的结果
- flutter - 解析匿名登录(访客用户)
- java - 需要解释 - Android Studio 中的空白片段 Java 代码
- angular - HAProxy 不适用于在 4200 上运行的 Angular 应用程序的端口 80
- scala - 如何处理 Apache Spark 中嵌套 json 中的歧义列
- c++ - 将初始值设定项列表与返回引用的用户定义转换运算符一起使用时复制返回值