Task
Create a pod with the following characteristics, and leave it running when complete:
- The pod must run in the
frontend
namespace. Check if the namespace has already been created and create if necessary- The name of the pod should be
cache
- Use the
library/redis
image with the3.2
tag- Expose port
6379
kubectl create ns frontend
Answer1:
kubectl run cache --image=library/redis:3.2 --port 6379 -n frontend
Answer2:
kubectl -n frontend run cache --image=library/redis:3.2 --port 6379 --expose