Practice Test - Services
Solutions to Practice test - Services
-
How many Services exist on the system?
```
kubectl get services
```
Count the number of services (if any)
-
Information only
-
What is the type of the default kubernetes service?
From the output of Q1, examine the `TYPE` column.
-
What is the targetPort configured on the kubernetes service?
```
$ kubectl describe service | grep TargetPort
```
-
How many labels are configured on the kubernetes service?
```
kubectl describe service
```
...and look for labels.
--- OR ---
```
kubectl describe service --show-labels
```
-
How many Endpoints are attached on the kubernetes service?
```
kubectl describe service
```
...and look for endpoints
-
How many Deployments exist on the system now?
```
kubectl get deployment
```
Count the deployments (if any)
-
What is the image used to create the pods in the deployment?
```
kubectl describe deployment
```
Look in the containers section.
--- OR ---
```
kubectl get deployment -o wide
```
Look in the `IMAGES` column
-
Are you able to access the Web App UI?
Try to access the Web Application UI using the tab simple-webapp-ui above the terminal.
-
Create a new service to access the web application using the service-definition-1.yaml file.
```
vi service-definition-1.yaml
```
Fill in the values as directed, save and exit.
```
kubectl create -f service-definition-1.yaml
```
- Test newly deployed service.