0% found this document useful (0 votes)
9 views160 pages

4 Kubernetes

The document outlines Kubernetes deployment and service configurations, including definitions for Deployment and Pod objects. It specifies the use of replicas, container images, and ports for the application. Additionally, it describes a LoadBalancer service for routing traffic to the application pods.

Uploaded by

dorsaf mok
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views160 pages

4 Kubernetes

The document outlines Kubernetes deployment and service configurations, including definitions for Deployment and Pod objects. It specifies the use of replicas, container images, and ports for the application. Additionally, it describes a LoadBalancer service for routing traffic to the application pods.

Uploaded by

dorsaf mok
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 160

K K

K K
apiserver{}

K K
K K

K K
apiserver{}

K K
{}
API Server{}
{}
{}
{}
$ kubectl {}
$ kubectl {}
K
K

K
K
K
K
apiserver{}
apiVersion: apps/v1
kind: Deployment
metadata:
name: test
spec:
replicas: 6
selector:
matchLabels:
app: ps-test
template:
spec:
containers:
- name: c1
image: web1:1.3
ports: 8080
- containerPort
...
name: web
replicas: 3
... apiserver{}
name: web
replicas: 3
... apiserver{}
name: web
replicas: 3
... apiserver{}
[S h a r e d e x e c u t i o n e n v]
8080 9090

10.0.0.17

8080 9090
8080 9090

localhost
Net
4

apiserver{}
apiserver{}
4

apiserver{}
4

apiserver{}
4

apiserver{}
apiserver{}
4

apiserver{}
Deployment object definition
• API sub-group: [apps/v1]
• replicas (integer)
• minReadySeconds (integer)
• progressDeadlineSeconds (integer)
• paused (boolean)
• revisionHistoryLimit (integer)
• selector (LabelSelector)
• strategy (DeploymentStrategy)
• template (PodTemplateSpec)
apiserver{} $ kubectl
apiserver{} $ kubectl
K K K K
K K K K
apiserver{} $ kubectl
$ kubectl

apiserver{}
‘’

apiserver{} $ kubectl
Pod object definition
• API sub-group: [core “”] kind: Pod
• metadata (ObjectMeta) apiVersion: v1
matadata: apiserver{}
• name (string)
name: test-pod
• annotations (object)
labels:
• labels (object)
ver: 1.0
• spec (PodSpec) spec:
• nodeName (integer) containers:
• containers (container array) - name: main
• name (string) image: web-server:1.0
• image (string) imagePullPolicy: Always
• imagePullPolicy (string) ports:
• ports (ContainerPort array)
containerPort: 8080
$ kubectl apply...
$ kubectl get $ kubectl describe
Stag = 10.2.1.88
Sky = 10.0.0.4
app1 = 10.0.0.61
Name: app1
IP: 10.0.0.61
Stag = 10.2.1.88
Sky = 10.0.0.4
app1 = 10.0.0.61
Name: app1
IP: 10.0.0.61
apiVersion: v1
kind: Service
metadata:
name: ps-lb
spec:
type: LoadBalancer
ports:
- port: 80
targetPort: 8080
selector:
app: web

You might also like