Chapter 4 – Application scheduling and lifecycle management
You have two virtual machines: master-0
and worker-0
, please complete the following mock scenarios.
Scenario 1
SSH to the worker-0
node, and provision a new pod called ngnix
with a single container nginx.
Use the following command:
kubectl run nginx --image=nginx:alpine
Scenario 2
SSH to worker-0
, and then scale the nginx
to 5 copies.
Use the following command:
kubectl scale deployment nginx --replicas=5
Scenario 3
SSH to worker-0
, set a configMap
with a username and password, then attach a new pod with a busybox.
Create a yaml definition called packt-cm.yaml
to define ConfigMap
as the following:
apiVersion: v1
kind: ConfigMap
metadata:
name: packt-configmap
data:
myKey: packtUsername
myFav: packtPassword
Use the following command...