Deploy a deployment named cache
using the image memcached
with 3 replicas
# create the deployment
kubectl create deployment cache --image=memcached --replicas=3
# expose the deployment using NodePort type
kubectl expose deployment cache --type=NodePort --port=11211
# output the endpoints in json format
kubectl get ep cache -o json > q3.json
# record switch on scale command is deprecated
kubectl scale deployment cache --replicas=5 --record
# record rollout history
kubectl rollout history deployment cache > q3.txt
# BONUS detailed history
kubectl rollout history deployment cache --revision=1