Anytime a team needs to run a container on Kubernetes they will need to define a pod within which to run the container.
- Create a YAML formatted pod manifest pod.yml to create a pod named app1 that runs a container named app1cont using image ifccncf/arg-output with these command line arguments: -lines 56 -F
- Create the pod with the
kubectl
command using the YAML file created in the previous step - When the pod is running display summary data about the pod in JSON format using the
kubectl
command and redirect the output to a file named out1.json - All of the files you need to work with have been created, empty, for your convenience
kubectl run app1 --image=lfccncf/arg-output --dry-run=client -o yaml
apiVersion: v1
kind: Pod
metadata:
creationTimestamp: null
labels:
run: app1
name: app1
spec:
containers:
- image: lfccncf/arg-output
name: app1
resources: {}
dnsPolicy: ClusterFirst
restartPolicy: Always
status: {}
apiVersion: v1
kind: Pod
metadata:
creationTimestamp: null
labels:
run: app1
name: app1
spec:
containers:
- image: lfccncf/arg-output
name: app1
args: ["-lines", "56", "-F"]
kubectl create -f .\app1-pod.yaml
kubectl get po app1 -o json > app1.json