[英]Kubernetes service - service IP address is not accessible
I am working with aks service. 我正在使用aks服务。 I have a Tensorflow serving image at azure container registry.
我在Azure容器注册表中有一个Tensorflow服务映像。 Now when I deploy my service, the public service endpoint is not accessible neither is it pingable.
现在,当我部署服务时,公共服务终结点不可访问,也无法ping通。
My image is exposed at port 8501 , so I am using it as a target port in my yaml. 我的映像在端口8501处公开,因此我将其用作yaml中的目标端口。
Here is the yaml file I am using for this deployment. 这是我用于此部署的yaml文件。
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: my-model-gpu
spec:
replicas: 1
template:
metadata:
labels:
app: my-model-gpu
spec:
containers:
- name: my-model-gpu
image: dsdemocr.azurecr.io/work-place-safety-gpu
ports:
- containerPort: 8501
resources:
limits:
nvidia.com/gpu: 1
imagePullSecrets:
- name: registrykey
---
apiVersion: v1
kind: Service
metadata:
name: my-model-gpu
spec:
type: LoadBalancer
ports:
- port: 8501
protocol: "TCP"
targetPort: 8501
selector:
app: my-model-gpu
below are my svc description : kubectl describe svc my-model-gpu
以下是我的svc说明:
kubectl describe svc my-model-gpu
Name: my-model-gpu
Namespace: default
Labels: <none>
Annotations: kubectl.kubernetes.io/last-applied-configuration:
{"apiVersion":"v1","kind":"Service","metadata":{"annotations":{},"name":"my-model-gpu","namespace":"default"},"spec":{"ports":[{"port":850...
Selector: app=my-model-gpu
Type: LoadBalancer
IP: 10.0.244.106
LoadBalancer Ingress: 52.183.17.101
Port: <unset> 8501/TCP
TargetPort: 8501/TCP
NodePort: <unset> 31546/TCP
Endpoints: 10.244.0.22:8501
Session Affinity: None
External Traffic Policy: Cluster
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal EnsuringLoadBalancer 10m service-controller Ensuring load balancer
Normal EnsuredLoadBalancer 9m8s service-controller Ensured load balancer
Looks like I am making some mistake with port mapping. 看起来我在端口映射上犯了一些错误。 Any help is much appreciated.
任何帮助深表感谢。
From the information you provided, there is no problem with the service having the load balancer type. 根据您提供的信息,具有负载均衡器类型的服务没有问题。 As I think, the possible reasons are all about your application and I would list below:
我认为,可能的原因全都与您的申请有关,我将在下面列出:
imagePullSecret
, maybe you do not assign enough permission for the service principal to pull the image. imagePullSecret
,也许您没有为服务主体分配足够的权限来提取图像。 This reason is less likely, but I also list here. Hope this helps you. 希望这对您有所帮助。
Please follow the advice provided by community: 请遵循社区提供的建议:
Researching this topic I would suggest to take a look for those Azure specific information: 研究此主题后,我建议您查看一下那些特定于Azure的信息:
If the static IP address defined in the loadBalancerIP property of the Kubernetes service manifest does not exist, or has not been created in the node resource group and no additional delegations configured, the load balancer service creation fails.
如果Kubernetes服务清单的loadBalancerIP属性中定义的静态IP地址不存在,或者尚未在节点资源组中创建,并且未配置任何其他委托,则负载均衡器服务创建失败。
There is very similar case on github . github上有非常相似的情况 。
If using Advanced networking it creates the vNet in the same resource group as the AKS service by default.
Note: 注意:
Currently only Basic IP SKUis supported.
当前仅支持基本IP SKU。 Work is in progress to support the Standard IP resource SKU.
支持标准IP资源SKU的工作正在进行中。 For more information, see IP address types and allocation methods in Azure .
有关更多信息, 请参见Azure中的IP地址类型和分配方法 。
Additional resources: 其他资源:
Azure-LoadBalnacer related: Azure-LoadBalnacer相关:
Hope this help. 希望能有所帮助。
我尝试访问的容器在8501上没有打开任何端口,一旦我修复它,它就会很好地工作。
I think you need to access application on 52.183.17.101:8501
我认为您需要在
52.183.17.101:8501
上访问应用程序
Because you didn't defined the routing the traffic to 80 port of loadbalancer. 因为您没有定义将流量路由到负载均衡器的80端口的路由。 By default it will create loadbalancer listening on 8501.
默认情况下,它将创建监听8501的负载均衡器。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.