Use kubectl
to create a namespace {yourname}
and deploy the below into that namespace:
kubectl create namespace yourname
kubectl -n yourname create deployment lab4 --image=sirfragalot/docker-demo:dcus --replicas=3 --port=8080
kubectl -n yourname expose deployment lab4 --type=NodePort
kubectl -n yourname get svc
curl localhost:31xxx
when you specify the ‘–port’ in create deployment this is only metadata - a hint that is used for the service to understand which target port to map to.