Using Services

Challenge

Use kubectl to

  • Create a deployment kubectl create deployment lab2 --image=sirfragalot/docker-demo:dcus
  • Create a service to expose your deployment
  • Access the service internally from the cluster
  • Access the service externally from the cluster
  • Describe services

Expand here to see the solution

Challenge

Use kubectl to

  • Create a pod kubectl run redis --image=redis
  • Create a service called redis-svc to expose the redis pod within the cluster on port 6379
  • Describe service

Expand here to see the solution

Challenge

Use kubectl to

  • Create a pod called my-nginx and expose it on container port 8080.

Expand here to see the solution

Challenge

Use kubectl to

  • Create a pod called httpd using the image httpd:alpine in the default namespace.
  • Next, create a service of type ClusterIP by the same name (httpd).
    • The target port for the service should be 80.

Expand here to see the solution