Created
July 12, 2018 15:36
-
-
Save joshy91/36fcbd919a8e43de8f0cfe7720f736b8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Create and describe an alpine and an nginx pod then delete pods | |
#Create and describe alpine pod | |
echo “apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: alpine | |
namespace: default | |
spec: | |
containers: | |
- name: alpine | |
image: alpine | |
command: | |
- sleep | |
- "3600" | |
imagePullPolicy: IfNotPresent | |
restartPolicy: Always” >> alpine-pod.yaml | |
kubectl create -f alpine-pod.yaml | |
kubectl describe pod alpine | |
#Create and describe nginx pod | |
echo “apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: nginx | |
namespace: default | |
spec: | |
containers: | |
- name: nginx | |
image: nginx | |
command: | |
- start | |
imagePullPolicy: IfNotPresent | |
restartPolicy: Always” >> nginx-pod.yaml | |
kubectl create -f nginx-pod.yaml | |
kubectl describe pod nginx | |
#Destroy pods | |
kubectl delete pod nginx | |
kubectl delete pod alpine |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment