Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

What is the purpose of operators?

Answer»

As compared to stateless applications, achieving desired status changes and upgrades are handled the same way for every replica, managing Kubernetes applications is more challenging. The stateful nature of stateful applications may require different handling for upgrading each replica, as each replica might be in a different state. Therefore, managing stateful applications often requires a human operator. This is supposed to be assisted by Kubernetes Operator. Moreover, this will pave the way for a standard process to be automated across several Kubernetes clusters.


2.

What service and namespace are referred to in the following file?

Answer»
apiVersion: v1
kind: ConfigMap
metadata:
name: some-configmap
data:
some_url: silicon.chip

It is clear from the above file that the service “silicon” is a reference to a namespace called “chip”.


3.

Why should namespaces be used? How does using the default namespace cause problems?

Answer»

Over the course of time, using the default namespace alone is proving to be difficult, since you are unable to get a good overview of all the applications you can manage within the cluster as a whole. The namespaces allow applications to be organized into groups that make sense, such as a namespace for all monitoring applications and another for all security applications. 

Additionally, namespaces can be used for managing Blue/Green environments, in which each namespace contains its own version of an app as well as sharing resources with other namespaces (such as logging or monitoring). It is also possible to have one cluster with multiple teams using namespaces. The use of the same cluster by multiple teams may lead to conflict.  Suppose they end up creating an app that has the same name, this means that one team will override the app created by the other team as Kubernetes prohibits two apps with the same name (within the same namespace).


4.

How should TLS be configured with Ingress?

Answer»

Add tls and secretName entries.

spec:
tls:
- hosts:
- some_app.com
secretName: someapp-secret-tls
5.

What is Ingress Default Backend?

Answer»

It SPECIFIES what to do with an incoming request to the Kubernetes cluster that isn't mapped to any backend i.e what to do when no rules being defined for the incoming HTTP request If the DEFAULT backend SERVICE is not defined, it's recommended to define it so that users still see some kind of MESSAGE INSTEAD of an unclear error.

6.

What is GKE?

Answer»

GKE is GOOGLE Kubernetes Engine that is used for managing and orchestrating systems for Docker containers. With the help of Google Public Cloud, we can ALSO orchestrate the container CLUSTER.

7.

Why do we need Operators?

Answer»

The process of managing APPLICATIONS in Kubernetes isn't as straightforward as managing STATELESS applications, where REACHING the desired status and upgrades are both handled the same way for every replica. In stateful applications, upgrading each replica might require different handling due to the stateful nature of the APP, each replica might be in a different status. As a result, we often NEED a human operator to manage stateful applications. Kubernetes Operator is supposed to assist with this.

This will also help with automating a standard process on multiple Kubernetes clusters

8.

What is an Operator?

Answer»

"Operators are software extensions to K8s which make USE of custom resources to manage applications and their components. Operators FOLLOW Kubernetes principles, notably the CONTROL LOOP."

9.

In the following file which service and in which namespace is referred?

Answer»

apiVersion: v1kind: ConfigMapmetadata: NAME: some-configmapdata: some_url: SILICON.chip

Answer - It's referencing the SERVICE "silicon" in the NAMESPACE CALLED "chip".

10.

Why use namespaces? What is the problem with using the default namespace?

Answer»

While using the default namespace alone, it becomes hard over TIME to get an overview of all the APPLICATIONS you can manage in your cluster. Namespaces make it easier to organize the applications into groups that make sense, like a namespace of all the MONITORING applications and a namespace for all the security applications, etc.

Namespaces can also be useful for managing Blue/Green environments where each namespace can include a different VERSION of an app and also share resources that are in other namespaces (namespaces like logging, monitoring, etc.).

Another use case for namespaces is one cluster with multiple teams. When multiple teams use the same cluster, they might end up stepping on each other's toes. For EXAMPLE, if they end up creating an app with the same name it means one of the teams overrides the app of the other team because there can't be two apps in Kubernetes with the same name (in the same namespace).

11.

How to configure TLS with Ingress?

Answer»

ADD TLS and secretName entries.

spec: tls: - HOSTS: - some_app.com secretName: someapp-secret-tls
12.

Complete the following configurationspec file to make it Ingress

Answer»

metadata: NAME: someapp-ingressspec:

EXPLANATION -

One of the several ways to ANSWER this question.

apiVersion: networking.k8s.io/v1kind: Ingressmetadata: name: someapp-ingressspec: rules: - host: my.host http: paths: - backend: serviceName: someapp-internal-service servicePort: 8080
13.

How to turn the service defined below in the spec into an external one?

Answer»

spec: selector: APP: some-app PORTS: - PROTOCOL: UDP PORT: 8080 targetPort: 8080

Explanation - 

Adding type: LoadBalancer and nodePort as follows:

spec: selector: app: some-app type: LoadBalancer ports: - protocol: UDP port: 8080 targetPort: 8080 nodePort: 32412