Kubernetes - Interview preparation guide
Thilan Dissanayaka Interview Guides March 25, 2020

Kubernetes - Interview preparation guide

What is Kubernetes and why is it used?

Kubernetes (K8s) is an open-source container orchestration platform that automates:

  • Deployment
  • Scaling
  • Load balancing
  • Management of containerized applications

It abstracts infrastructure and simplifies application operations in distributed environments.

What is a Pod in Kubernetes?

A Pod is the smallest deployable unit in Kubernetes. It can contain one or more containers that share:

Network namespace (IP, port space)

Storage volumes

Lifecycle

All containers in a pod are co-located and scheduled together.

What is the difference between a Deployment and a StatefulSet?

Deployment: Manages stateless applications, supports scaling and rolling updates.

StatefulSet: Manages stateful applications that require:

Persistent storage

Stable network identity

Ordered deployment and scaling

What is a Service in Kubernetes?

A Service exposes a set of Pods as a network service. Types include:

ClusterIP: Internal-only access (default)

NodePort: Exposes service on each node’s IP at a static port

LoadBalancer: Uses external load balancer (e.g., in cloud)

ExternalName: Maps service to a DNS name

What is a ConfigMap and a Secret?

ConfigMap: Stores non-confidential configuration data in key-value pairs.

Secret: Stores sensitive data (like passwords, tokens) in base64-encoded format. Both are injected into Pods as environment variables or mounted files.

How does Kubernetes handle container scheduling?

The Kube-scheduler assigns Pods to Nodes based on:

Resource requirements (CPU, memory)

Node selectors / affinity rules

Taints and tolerations

Availability and other policies

What are Namespaces in Kubernetes?

Namespaces provide logical isolation within a cluster. They help:

Separate resources (like dev, test, prod)

Apply resource quotas and RBAC

Avoid naming collisions

What are liveness and readiness probes?

Liveness probe: Checks if the container is running. If it fails, the container is restarted.

Readiness probe: Checks if the container is ready to accept traffic. If it fails, the pod is removed from the service endpoint.

What is the role of etcd in Kubernetes?

etcd is a key-value store used as the backing store for all cluster data. It stores:

Cluster state

Configuration data

Metadata about nodes, pods, secrets, etc.

It must be highly available and consistent.

How do you perform rolling updates and rollbacks in Kubernetes?

With kubectl and Deployments:

kubectl rollout restart deployment — triggers rolling update

kubectl rollout undo deployment — rolls back to the previous revision Kubernetes ensures zero-downtime deployments by managing replicas and readiness.

What is a DaemonSet?

A DaemonSet ensures that a copy of a Pod runs on every node in the cluster (or a subset). Useful for:

Log collection (e.g., Fluentd)

Node monitoring (e.g., Prometheus Node Exporter)

Storage daemons

What is a Helm chart?

Helm is a package manager for Kubernetes. A Helm chart is a pre-configured Kubernetes resource template that simplifies deployment and versioning of applications.

How do you secure a Kubernetes cluster?

Use RBAC (Role-Based Access Control)

Enable Pod Security Policies or Pod Security Admission

Use network policies to limit traffic

Secure etcd with TLS

Restrict access to Kubernetes API

Use image scanning and signed containers

What is a Kubernetes Operator?

An Operator is a method of packaging, deploying, and managing a Kubernetes application using custom controllers and CRDs (Custom Resource Definitions). Operators automate complex application lifecycle tasks like backups, upgrades, and scaling.

ALSO READ
Blockchain 0x000 – Understanding the Fundamentals
May 21, 2020 Web3 Development

Imagine a world where strangers can exchange money, share data, or execute agreements without ever needing to trust a central authority. No banks, no intermediaries, no single point of failure yet...

Identity and Access Management (IAM)
May 11, 2020 Identity & Access Management

Who are you — and what are you allowed to do? That's the fundamental question every secure system must answer. And it's exactly what Identity and Access Management (IAM) is built to solve.

How I built a web based CPU Simulator
May 07, 2020 Pet Projects

As someone passionate about computer engineering, reverse engineering, and system internals, I've always been fascinated by what happens "under the hood" of a computer. This curiosity led me to...

Writing a Shell Code for Linux
Apr 21, 2020 Exploit Development

Shellcode is a small piece of machine code used as the payload in exploit development. In this post, we write Linux shellcode from scratch — starting with a simple exit, building up to spawning a shell, and explaining every decision along the way.

Exploiting a Stack Buffer Overflow on Windows
Apr 12, 2020 Exploit Development

In a previous tutorial we discusses how we can exploit a buffer overflow vulnerability on a Linux machine. I wen through all theories in depth and explained each step. Now today we are going to jump...

Access Control Models
Apr 08, 2020 Identity & Access Management

Access control is one of the most fundamental concepts in security. Every time you set file permissions, assign user roles, or restrict access to a resource, you're implementing some form of access control. But not all access control is created equal...

Exploiting a  Stack Buffer Overflow  on Linux
Apr 01, 2020 Exploit Development

Have you ever wondered how attackers gain control over remote servers? How do they just run some exploit and compromise a computer? If we dive into the actual context, there is no magic happening....

Basic concepts of Cryptography
Mar 01, 2020 Cryptography

Ever notice that little padlock icon in your browser's address bar? That's cryptography working silently in the background, protecting everything you do online. Whether you're sending an email,...

Common Web Application Attacks
Feb 05, 2020 Application Security

Web applications are one of the most targeted surfaces by attackers. This is primarily because they are accessible over the internet, making them exposed and potentially vulnerable. Since these...

Remote Code Execution (RCE)
Jan 02, 2020 Application Security

Remote Code Execution (RCE) is the holy grail of application security vulnerabilities. It allows an attacker to execute arbitrary code on a remote server — and the consequences are as bad as it sounds. In this post, we'll go deep into RCE across multiple languages, including PHP, Java, Python, and Node.js.