Part 3 Flashcards

1
Q

Service

  1. Create a deployment named kplabs-service
  2. The deployment should have three replicas and the image should be based on nginx
  3. Create a service based on NodePort.
  4. The service port should be 8080.
  5. Verify if you are able to see the index.html of Nginx from service port.
A

kubectl run kplabs-service –image=nginx –replicas 3

kubectl expose deployment kplabs-service –port=8080 –target-port=80 –type=NodePort

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Service and Endpoints

  1. Create a deployment named deployment-manual

Launch 3 replicas of nginx image. Create a service named service-manual.

Create an endpoint with the IP address of all the pods of deployment-manual and associate it with service-manual.

Verify the endpoints of the service to check if IP addresses have been populated.

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Load Balanacer Service

  1. Create a deployment named kplabs-dmz
  2. There should be two replicas of nginx image as part of the deployment.
  3. Create a service name service-elb and it should be based on LoadBalancer type.
  4. The Load Balancer should list on Port 80.
  5. Once launched, verify that the nginx default page load when you open the Load Balancer IP in browser.
A

kubectl run deployment-manual –image=nginx –replicas 3

kubectl expose deployment deployment-manual –name=service-elb –port=80 –type=LoadBalancer

minikube service service-elb

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Single Service Ingress

  1. Create a pod named single-pod. Expose Port 80.

2, Create service named single-service. The service should listen on port of 8080. It should direct traffic to single-pod

  1. Create an ingress named single-ingress. Ingress should have following specification:
    i) Should direct all the traffic to single-service on the service port of 8080
  2. Verify if the ingress is created.
  3. Describe all the ingress rules.
  4. Does the ingress have any IP address on “ADDRESS” field? If not, find out what can be the reason behind it?
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q
  1. Create an ingress which satisfies following requirement:

  1. example.com –| Requests Redirects to | service1:8085
  2. |
  3. test.com –| Requests Redirects to | service2:8089
    1. Other Requests -| Requests Redirects to | service3:9005
  4. All the pods should be based on nginx image.
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Question 6: Namespaces

  1. Create a namespace named kplabs-namespace
  2. Launch a POD from nginx image. Expose Port 8080. Pod should be in kplabs-namespace
  3. Verify the status of the pod with kubectl command.
A

kubectl create namespace kplabs-namespace

kubectl run kplabs-namespace-pod –image=nginx -n kplabs-namespace –restart=Never

kubectl get pods -n kplabs-namespace

kubectl expose pod kplabs-namespace-pod –type=NodePort –name=nginx-service -n kplabs-namespace –port 8080

How well did you know this?
1
Not at all
2
3
4
5
Perfectly