Difference between revisions of "Exploring the Kubernetes object model"

From MyWiki
Jump to: navigation, search
 
Line 3: Line 3:
 
*The same network namespace
 
*The same network namespace
 
*Have access to mount the same external storage (volumes).
 
*Have access to mount the same external storage (volumes).
 +
 +
Below is an example of a Pod object's configuration in YAML format:
 +
<source lang="yaml">
 +
apiVersion: v1
 +
kind: Pod
 +
metadata:
 +
  name: nginx-pod
 +
  labels:
 +
    app: nginx
 +
spec:
 +
  containers:
 +
  - name: nginx
 +
    image: nginx:1.15.11
 +
    ports:
 +
    - containerPort: 80
 +
</source>

Latest revision as of 16:43, 22 September 2019

A Pod is a logical collection of one or more containers, which:

  • Are scheduled together on the same host with the Pod
  • The same network namespace
  • Have access to mount the same external storage (volumes).

Below is an example of a Pod object's configuration in YAML format:

apiVersion: v1
kind: Pod
metadata:
  name: nginx-pod
  labels:
    app: nginx
spec:
  containers:
  - name: nginx
    image: nginx:1.15.11
    ports:
    - containerPort: 80