Query regarding K8S Infrastructure

10/1/2019

I have created a k8s cluster and network, using 1 master and 2 nodes, the deployment happens correctly having one pod on each node

From my observation i would like to know, when we deploy the nginx pods (using deployment say replicas = 2) it deploy as a container of node1 or node2. but the nginx service actually runs on the server itself not inside the container as i see the service running on node1 and node2 currently?

[root@node1 ~]# ps -ef|grep nginx
root     13512 13494  0 10:57 ?        00:00:00 nginx: master process nginx -g daemon off;
101      13531 13512  0 10:57 ?        00:00:00 nginx: worker process
root     17310 16644  0 11:14 pts/0    00:00:00 grep --color=auto nginx
[root@node1 ~]#

Is it a right setup, I have on my machine? that nginx service which is deployed to node1 and node2 from master machine is running on the node servers, though it is created as a part of pod deployment, or should it be running inside the container only?

-- Jagdish0886
docker
kubernetes
kubernetes-pod

1 Answer

10/1/2019

You are probably looking at the nginx process running in the container. Look at the parent process of that nginx, it should be the container-shim, or something like that. When you run a process in a container, it runs as one of the processes of the machine, as a child of the container process, with limited access to the parent machine resources.

-- Burak Serdar
Source: StackOverflow