You must know
POD
is a unit of service.
If kubernetes needs to scale out, it replicates POD
unit.
It’s not to scale out container in a POD
.
Manage Containers with Docker
1
2
3
4
5
6
7
8
9
10
11
12
13
| # app1
docker run python-app
# app2
docker run python-app
# app3
docker run python-app
# app4
docker run python-app
docker run helper -link app1
docker run helper -link app2
docker run helper -link app3
docker run helper -link app4
|
Manage Containers with POD
pod-definition.yml
1
2
3
4
5
6
7
8
9
10
11
| apiVersion: v1
kind: Pod
metadata:
name: myapp-pod
labels:
app: myapp
type: front-end
spec:
containers:
- name: nginx-continer
image: nginx
|
Create a POD with YAML file
1
| kubectl create -f pod-definition.yml
|
Create a POD with Command
1
| kubectl run myapp-pod --image nginx
|
Show PODs List
Show POD Detail
1
| kubectl describe pod myapp-pod
|