In the below yaml file in the training we create a POD. Is that within the POD we are running a container of nginx ?apiVersion:v1
kind: Pod
metadata:
name: nginx
labels:
app: nginx
tier: frontend
spec:
containers:
- name: nginx
image: nginx
In the below yaml file in the training we create a POD. Is that within the POD we are running a container of nginx ?apiVersion:v1
kind: Pod
metadata:
name: nginx
labels:
app: nginx
tier: frontend
spec:
containers:
It looks like it is indeed a pod running the nginx image.
BTW: you should take YAML and put it into a code block using the </>
key, since otherwise the appears of your YAML will be completely garbled, as you have above. So it looks like this:
apiVersion: v1
kind: Pod
metadata:
labels:
run: nginx
name: nginx
spec:
containers:
- image: nginx
name: nginx
When you say POD running with nginx image. In a POD you will have containers . And you can spin multiple POD’s. Are you saying that the POD itself is like a machine with nginx or a container with nginx. And within that container/POD we can run multiple containers? Sorry to ask as i am just starting my journey with kubernetes
or
Is it that the POD is a logical entity or logical grouping and within that we have created a container with nginx ?
A pod is a sort of grouping of containers (one or more) that handle things like networking, shared volumes, policies for handling failed containers, and certain security settings. So you can think of a pod as something that “contains” one or more containers. It makes it easier to manage containers, and easier to group containers that need to work very closely together.
so in the below i am just creating a POD and running a container within that POD correct?
apiVersion: v1
kind: Pod
metadata:
labels:
run: nginx
name: nginx
spec:
containers:
That’s a good way of thinking about it, yes. You’re running a pod; the pod is running an nginx container.