How to access pods without services in Kubernetes

后端 未结 4 1903
攒了一身酷
攒了一身酷 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:02

    You cannot "access" a pods container port(s) without a service. Services are objects that define the desired state of an ultimate set of iptable rule(s).

    Also, services, like all other objects, are stored in etcd and maintained through your master(s).

    You could however manually create an iptable rule forwarding traffic to the local container port that docker has exposed.

    Hope this helps! If you still have any questions drop them here.

提交回复
热议问题