← Back to articles

Kubernetes for Beginner

Kubernetes Docker DevOps Beginner

First Topics to Understand About Kubernetes

Topics to Be Solid Before Going Deep Dive for K8s

Looks like you start to feel overwhelmed, hahahaha. It's normal. Take it slow.

Here I try to compact things for you.

Etcd

Etcd is where Kubernetes saves the memory.

Service

NodePort, ClusterIP and LoadBalancer.

How Deployment - Replica - Pods Works

Deployment is a manager for pods, you can manage how many pods you want to provision here and which image tag you wanna use. Take a look here:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment <your deployment name>
  labels:
    app: nginx
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:1.14.2
        ports:
        - containerPort: 80

To ease up everything, deployment manage replica and replica manage pods.

Quick Tips to Handle YAML

Few More Commands I Use Everyday

You can use your pareto.

kubectl get pods -n <your-namespace>
kubectl describe pods -n <your-namespace>    # for serious debugging
kubectl get deploy -n <your-namespace>
kubectl get all
kubectl get svc -n <your-namespace>
kubectl config current-context
<kubectl> -o wide                            # for more context
kubectl get pv
kubectl get pvc
kubectl get secret

You can use k9s or Lens as you go through all the work. k9s works for me as it is simple and looks like I live in 2026 lol hahahah. But if you're still a beginner you can practice all the commands.

Can refer here for more commands: kubectl Quick Reference

For your exposure, your SRE/DevOps won't use command ops to create new deployment via kubectl. For checking the usage maybe yes, or they will use Argo since it's more friendly and got visual. Check out here: Wazuh Kubernetes example

The command is good for you to understand all the concepts, but in my experience, all deployment, namespace and service are already defined by the application used e.g: Datadog, Wazuh, Emissary (API gateway).

Namespace

Namespace is an isolated room for your application to live. In production, few apps will work in a few namespaces.

Example:

All the resources might not be exchanged since we provide them all by the namespace.

Quick tips: if you don't understand Kubernetes docs, app docs sometimes explain better. I find Wazuh docs a bit better to explain all the K8s things.

Secret

Secret is some of the sensitive values that are meant to be kept in a secret store such as AWS Secret Manager and 1Password. Normal practice is we save the secret in the secret store and not hardcode the secret in our repo due to vulnerability reasons.

After the value is getting saved in the secret store, we need to route the secret from our repo to the secret store.

Here is your reference: secret.yaml example