Lab 5: Create a service
Homework Lab : https://labs.play-with-k8s.com/
Create service on overlay network myoverlay0
docker service create --name testWeb -p 80:80 --network=myoverlay0 --replicas 3 httpdChecking Network ID for the service
docker service inspect --format= testWebConnect an existing service to an overlay network
Creating A new service with name testApp
docker service create --name testApp -p 8081:80 --replicas 3 nginx:alpineChecking the current network for the service
docker service inspect --format= testAppConnecting service to userdefined network myoverlay0
docker service update --network-add myoverlay0 testAppChecking the current network Endpoint for the service
docker service inspect --format= testAppRemoving user defined network myoverlay0 for service testApp
docker service update --network-rm myoverlay0 testAppLast updated
Was this helpful?