如何在Kubernetes中访问没有服务的Pod [英] How to access pods without services in Kubernetes

查看:61
本文介绍了如何在Kubernetes中访问没有服务的Pod的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道当没有为特定Pod定义服务时如何访问Pod.如果通过环境变量,集群将如何检索这些变量?

I was wondering how pods are accessed when no service is defined for that specific pod. If it's through the environment variables, how does the cluster retrieve these?

此外,在定义服务时,它将存储在主节点上的什么位置?

Also, when services are defined, where on the master node is it stored?

亲切的问候, 查尔斯

推荐答案

  • 如果您为应用定义了服务,则可以使用该服务在集群外部访问它

    • If you define a service for your app , you can access it outside the cluster using that service

      服务有多种类型,包括nodePort,您可以在其中访问任何群集节点上的端口,并且无论吊舱的实际位置如何,都可以访问该服务

      Services are of several types , including nodePort , where you can access that port on any cluster node and you will have access to the service regardless of the actual location of the pod

      您也可以访问集群内部的端点或实际Pod端口,但不能访问外部

      you can access the endpoints or actual pod ports inside the cluster as well , but not outside

      以上所有方法均使用kubernetes服务发现

      all of the above uses the kubernetes service discovery

      这篇关于如何在Kubernetes中访问没有服务的Pod的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆