Skip to main contentIBM Cloud-Native

Kubernetes Lab 8 - Services

Problem

We have a jedi-deployment and yoda-deployment that need to communicate with others. The jedi needs to talk to the world(outside the cluster), while yoda only needs to talk to jedi council(others in the cluster).

Your Task

  • Examine the two deployments, and create two services that meet the following criteria:

jedi-svc

  • The service name is jedi-svc.
  • The service exposes the pod replicas managed by the deployment named jedi-deployment.
  • The service listens on port 80 and its targetPort matches the port exposed by the pods.
  • The service type is NodePort.

yoda-svc

  • The service name is yoda-svc.
  • The service exposes the pod replicas managed by the deployment named yoda-deployment.
  • The service listens on port 80 and its targetPort matches the port exposed by the pods.
  • The service type is ClusterIP.

Setup environment:

kubectl apply -f https://gist.githubusercontent.com/csantanapr/87df4292e94441617707dae5de488cf4/raw/cb515f7bae77a3f0e76fdc7f6aa0f4e89cc5fec7/lab-8-service-setup.yaml