When a POD created, does it take more than 1 IP , if more containers are ther e

Dear ALl,
I have a doubt, if a POD is created, how many IP address it can take, does it takes only always 1 or depending on the no of containers mentioned in the conf file, it take that much
The below question copied from mock exam 1, please give comments

How many IP addresses are consumed by the pod when it’s created?

apiVersion: v1
kind: Pod
metadata:
name: myapp-pod
labels:
app: myapp
spec:
containers:

  • name: nginx-container
    image: nginx
  • name: agent
    image: agent

If you see the conf files, there are 2 containers mentioned, is it them 2 IP address they will consume

Hello joseph.john,
No! only one IP.

1 Like

@joseph.john , All containers inside a pod share an IP address and can share via the filesystem.

1 Like