How to access pods without services in Kubernetes

后端 未结 4 1902
攒了一身酷
攒了一身酷 2021-01-02 12:20

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?

4条回答
  •  情话喂你
    2021-01-02 13:00

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

    • 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

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

    • all of the above uses the kubernetes service discovery

    • There are two type of service dicovery though
    • Internal Service discovery
    • External Service Discovery.

提交回复
热议问题