如何为本地主机上的istio-ingressgateway分配IP?

问题描述 投票:0回答:1

我正在使用kubespray在笔记本电脑上运行kubernetes集群。群集在7个VM上运行,并且VM的角色分布如下:

NAME    STATUS   ROLES    AGE     VERSION
k8s-1   Ready    master   2d22h   v1.16.2
k8s-2   Ready    master   2d22h   v1.16.2
k8s-3   Ready    master   2d22h   v1.16.2
k8s-4   Ready    master   2d22h   v1.16.2
k8s-5   Ready    <none>   2d22h   v1.16.2
k8s-6   Ready    <none>   2d22h   v1.16.2
k8s-7   Ready    <none>   2d22h   v1.16.2

我已经安装了https://istio.io/以构建微服务环境。

我有2个服务正在运行,并且喜欢从外部访问:

k get services
NAME              TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)    AGE
greeter-service   ClusterIP   10.233.50.109   <none>        3000/TCP   47h
helloweb          ClusterIP   10.233.8.207    <none>        3000/TCP   47h

和正在运行的豆荚:

NAMESPACE      NAME                                      READY   STATUS    RESTARTS   AGE     IP             NODE    NOMINATED NODE   READINESS GATES
default        greeter-service-v1-8d97f9bcd-2hf4x        2/2     Running   0          47h     10.233.69.7    k8s-6   <none>           <none>
default        greeter-service-v1-8d97f9bcd-gnsvp        2/2     Running   0          47h     10.233.65.3    k8s-2   <none>           <none>
default        greeter-service-v1-8d97f9bcd-lkt6p        2/2     Running   0          47h     10.233.68.9    k8s-7   <none>           <none>
default        helloweb-77c9476f6d-7f76v                 2/2     Running   0          47h     10.233.64.3    k8s-1   <none>           <none>
default        helloweb-77c9476f6d-pj494                 2/2     Running   0          47h     10.233.69.8    k8s-6   <none>           <none>
default        helloweb-77c9476f6d-tnqfb                 2/2     Running   0          47h     10.233.70.7    k8s-5   <none>           <none>

问题是,我无法从外部访问服务,因为我没有EXTERNAL IP地址(请记住群集正在笔记本电脑上运行)。

k get svc istio-ingressgateway -n istio-system  
NAME                   TYPE           CLUSTER-IP      EXTERNAL-IP   PORT(S)                                                                                                                      AGE
istio-ingressgateway   LoadBalancer   10.233.61.112   <pending>     15020:31311/TCP,80:30383/TCP,443:31494/TCP,15029:31383/TCP,15030:30784/TCP,15031:30322/TCP,15032:30823/TCP,15443:30401/TCP   47h

如您所见,EXTERNAL-IP列的值为<pending>

问题是,如何为istio-ingressgateway分配EXTERNAL-IP

kubernetes istio
1个回答
0
投票

默认情况下,Kubernetes无法将外部IP分配给LoadBalancer服务。此服务类型需要基础架构支持,该支持可在GKE,AKS,EKS等云产品中使用。

在笔记本电脑中运行此群集时,请部署MetalLB负载均衡器以获取EXTERNAL-IP

© www.soinside.com 2019 - 2024. All rights reserved.