SAP Certified Development Associate - Side-by-Side Extensibility based on SAP BTP Kyma runtime Questions and Answers
Question 17
When would you use kubect!? Note: There are 3 correct Answers to this question.
Options:
A.
To plot time series data
B.
To run interactive commands
C.
To view pod logs
D.
To forward ports from remote machines to pods
E.
To deploy containers into production clusters
Answer:
B, C, D
Explanation:
Explanation:
kubectl is a command-line tool that allows you to run commands against Kubernetes clusters1. You can use kubectl in SAP BTP, Kyma runtime for the following purposes:
To run interactive commands. kubectl supports various commands that let you interact with your cluster resources, such as creating, updating, deleting, describing, or executing them. For example, you can use kubectl create to create a resource from a file or kubectl exec to run a command in a container2.
To view pod logs. kubectl allows you to view the logs of a pod or a container in a pod using the kubectl logs command. This can help you troubleshoot issues or monitor the pod activity3.
To forward ports from remote machines to pods. kubectl enables you to forward one or more local ports to a pod using the kubectl port-forward command. This can allow you to access a pod from your local machine for debugging or testing purposes4.
References:
1: Kubernetes / Overview of kubectl
2: Kubernetes / kubectl Cheat Sheet
3: Kubernetes / Viewing logs
4: Kubernetes / Use Port Forwarding to Access Applications in a Cluster
Question 18
What happens when you delete a pod managed by a Replica Set?
Options:
A.
The Replica Set will schedule a new pod.
B.
The pod is deleted until the redeployment of the Replica Set.
C.
The Replica Set is deleted as well.
Answer:
A
Explanation:
Explanation:
When you delete a pod managed by a Replica Set, the Replica Set will schedule a new pod to replace the deleted one. This is because the Replica Set’s purpose is to maintain a stable set of replica pods running at any given time. As such, it is often used to guarantee the availability of a specified number of identical pods1. The Replica Set controller monitors the number of pods it owns and creates or deletes pods as needed to reach the desired number. The Replica Set identifies its pods by using a selector that matches the pods’ labels2. Therefore, deleting a pod will reduce the number of pods that match the selector, and trigger the Replica Set to create a new pod with the same pod template3.
References:
1: ReplicaSet | Kubernetes
2: Labels and Selectors | Kubernetes
3: Pods, Deployments and Replica Sets: Kubernetes Resources Explained