Kubernetes — Container Orchestration at Scale
From Pod scheduling internals and eBPF networking to RBAC hardening, HPA, and production multi-node clusters. Learn on Kind locally, graduate to EKS on AWS.
Lesson objective
- What it teaches
- Under-The-Hood Architecture & Networking · Core Components & Objects · WSL Hands-On Lab · Real-World Project: 3-Tier App · Troubleshooting & Disaster Recovery · Interactive Lab Checklist · Cluster Metrics and Logs: metrics-server, kubectl top, /var/log/pods
- Why it matters
- A required lesson for DevOps Engineer, SRE, Platform Engineer, DevSecOps Engineer, Container/Kubernetes Engineer, Release / CI-CD Engineer, FinOps / Cloud Optimization, DevOps / Platform Architect, MLOps / LLMOps Engineer, Observability Engineer. Recommended for Cloud Engineer. See the role paths
- What you demonstrate
-
- Simulated lab: Create the cluster (takes ~2 min): Run kind create cluster --config kind-cluster.yaml --name devops-lab. Recorded as lab evidence.
- Predict 3 results this lesson prints. You mark each one yourself.
- Optional, real environment: 6 hands-on tasks on your own machine or an external lab site (checklist). Not tracked as evidence.
Under-The-Hood Architecture & Networking 01
Control Plane → Data Plane Flow
When you run kubectl apply -f deployment.yaml, here's the exact journey your manifest takes through the Kubernetes control plane before a Pod lands on a Node.
API Server → etcd → Scheduler → kubelet flow
- API Server validation: kubectl sends a POST to
/apis/apps/v1/namespaces/default/deployments. API server authenticates (x509/OIDC), runs admission webhooks (mutating → validating), validates the schema. - etcd persistence: API server writes the Deployment object to etcd. etcd uses Raft consensus — the write is committed when a quorum of etcd members acknowledges it.
- Deployment Controller: watches for new Deployment objects via API server's watch stream, creates ReplicaSet objects to match
spec.replicas. - ReplicaSet Controller: creates Pod objects in
Pendingstate. Pods have nonodeNameassigned yet. - Scheduler: watches for Pending Pods. Runs Filtering (which nodes can run this pod?) and Scoring (which node is best?) phases. Writes the chosen
nodeNameto the Pod object via a binding. - kubelet on target node: watches for Pods assigned to its node. Calls the container runtime (containerd → runc) to pull the image and start containers. Updates Pod status back to API server.
CNI Networking: Calico VXLAN vs Cilium eBPF
Felix agent programs IP routing tables on the host. In VXLAN mode, packets are encapsulated in UDP (port 4789) adding ~50 bytes of header, reducing effective MTU to ~1450. Increases CPU due to kernel-space encap/decap.kube-proxy: IPTables O(N) vs IPVS O(1)
| Mode | Lookup Complexity | Max Services | Load Balancing Algorithms |
|---|---|---|---|
| IPTables | O(N) — sequential rules | ~5,000 before degradation | Random, Round-Robin only |
| IPVS | O(1) — hash table lookups | 100,000+ | LeastConn, SourceHash, DNAT, WRR |
CoreDNS & Headless Services
CoreDNS uses a pipeline: health → errors → cache → kubernetes → forward.
- Standard Services: Returns a single A record → ClusterIP → iptables/IPVS routes to a pod.
- Headless Services (
clusterIP: None): Returns A records directly mapping to all backing Pod IPs. Used for StatefulSets (Cassandra, Kafka, Elasticsearch). - SRV records: Headless services also emit SRV records for named ports — essential for service discovery protocols like gRPC.
Control Plane Architecture Diagram
Core Components & Objects 02
| Object | Purpose | Key Fields | Best Practice |
|---|---|---|---|
| Pod | Smallest deployable unit. Shares network namespace and volumes. | containers, volumes, nodeSelector | Never run Pods directly — use Deployments. |
| Deployment | Declarative Pod management with rolling updates and rollbacks. | replicas, strategy, selector | Always set maxSurge and maxUnavailable for zero-downtime. |
| StatefulSet | Ordered Pod deployment with stable network identity and persistent storage. | serviceName, volumeClaimTemplates | Use for databases, Kafka, Elasticsearch. |
| Service | Stable virtual IP (ClusterIP) for Pod discovery and load balancing. | type, selector, ports | Use LoadBalancer only when cloud provider provides one; prefer Ingress. |
| HPA | Horizontal Pod Autoscaler — scales replicas based on CPU/memory/custom metrics. | scaleTargetRef, minReplicas, maxReplicas, metrics | Combine with KEDA for event-driven scaling (queue depth, etc.). |
| PVC/PV | Persistent Volume Claim/Volume for durable storage beyond Pod lifecycle. | storageClassName, accessModes, capacity | Use dynamic provisioning (StorageClass) — avoid static PVs in production. |
| NetworkPolicy | L3/L4 firewall rules for Pod-to-Pod communication (requires CNI support). | podSelector, policyTypes, ingress, egress | Default-deny all, then allow only required paths explicitly. |
| RBAC | Role-Based Access Control for API resource permissions. | Role, ClusterRole, RoleBinding, ClusterRoleBinding | Principle of least privilege. Never use verbs: ["*"] in production. |
WSL Hands-On Lab 03
wsl-setup.sh first. This lab requires: kubectl, kind, helm, k9s. Estimated time: 60–90 minutes.Step 1 — Create a Multi-Node Kind Cluster
apiVersion: kind.x-k8s.io/v1alpha4 kind: Cluster nodes: - role: control-plane extraPortMappings: - containerPort: 30080 hostPort: 8080 protocol: TCP - role: worker - role: worker
# Create the cluster (takes ~2 min) $ kind create cluster --config kind-cluster.yaml --name devops-lab Creating cluster "devops-lab" ... ✓ Ensuring node image (kindest/node:v1.29.2) ✓ Preparing nodes 📦 📦 📦 ✓ Writing configuration 📜 ✓ Starting control-plane 🕹️ ✓ Installing CNI 🔌 ✓ Joining worker nodes 🤝 Set kubectl context to "kind-devops-lab" # Verify the cluster $ kubectl get nodes NAME STATUS ROLES AGE VERSION devops-lab-control-plane Ready control-plane 2m v1.29.2 devops-lab-worker Ready <none> 90s v1.29.2 devops-lab-worker2 Ready <none> 90s v1.29.2 # Launch k9s TUI for visual cluster management $ k9s
Step 2 — Deploy a 3-Tier Application
apiVersion: v1 kind: Namespace metadata: name: three-tier-app labels: pod-security.kubernetes.io/enforce: restricted --- apiVersion: v1 kind: ServiceAccount metadata: name: backend-sa namespace: three-tier-app automountServiceAccountToken: false --- apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: backend-reader namespace: three-tier-app rules: - apiGroups: [""] resources: ["configmaps"] verbs: ["get", "list"]
apiVersion: apps/v1 kind: Deployment metadata: name: backend namespace: three-tier-app spec: replicas: 2 strategy: type: RollingUpdate rollingUpdate: maxSurge: 1 maxUnavailable: 0 # Zero-downtime rolling update selector: matchLabels: app: backend template: metadata: labels: app: backend spec: serviceAccountName: backend-sa securityContext: runAsNonRoot: true runAsUser: 1000 fsGroup: 2000 containers: - name: backend image: nginx:alpine ports: - containerPort: 8080 securityContext: allowPrivilegeEscalation: false readOnlyRootFilesystem: true capabilities: drop: ["ALL"] resources: requests: { cpu: "100m", memory: "128Mi" } limits: { cpu: "500m", memory: "256Mi" } readinessProbe: httpGet: { path: /healthz, port: 8080 } initialDelaySeconds: 5 livenessProbe: httpGet: { path: /healthz, port: 8080 } initialDelaySeconds: 15
apiVersion: v1 kind: Service metadata: name: backend-svc namespace: three-tier-app spec: selector: app: backend ports: - port: 80 targetPort: 8080 --- apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: backend-ingress namespace: three-tier-app annotations: nginx.ingress.kubernetes.io/rewrite-target: / spec: ingressClassName: nginx rules: - host: app.local http: paths: - path: / pathType: Prefix backend: service: name: backend-svc port: { number: 80 }
apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: backend-hpa namespace: three-tier-app spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: backend minReplicas: 2 maxReplicas: 10 metrics: - type: Resource resource: name: cpu target: type: Utilization averageUtilization: 70 - type: Resource resource: name: memory target: type: AverageValue averageValue: 200Mi
# Apply all manifests $ kubectl apply -f namespace-rbac.yaml backend-deployment.yaml service-ingress.yaml hpa.yaml # Watch pods come up $ kubectl get pods -n three-tier-app -w # Check HPA status $ kubectl get hpa -n three-tier-app # Inspect a pod's security context $ kubectl get pod backend-xxxx -n three-tier-app -o jsonpath='{.spec.securityContext}' # Test rollout: update image and watch rolling update $ kubectl set image deployment/backend backend=nginx:latest -n three-tier-app $ kubectl rollout status deployment/backend -n three-tier-app # Rollback if needed $ kubectl rollout undo deployment/backend -n three-tier-app
Real-World Project: 3-Tier App 04
Startup: Local Kind Cluster
You're a solo developer deploying a React frontend + Node.js API + PostgreSQL database. Total infrastructure cost: $0 (Kind on WSL2).
# Deploy PostgreSQL credentials using a secured file (never literal CLI arguments) $ install -m 0600 /dev/null secrets/pg_password.txt && printf '%s' 'pg-dev-pass-file-only' > secrets/pg_password.txt $ kubectl create secret generic pg-secret \ --from-file=POSTGRES_PASSWORD=secrets/pg_password.txt \ -n three-tier-app # Deploy using helm (bitnami postgresql chart) $ helm repo add bitnami https://charts.bitnami.com/bitnami $ helm install postgres bitnami/postgresql \ --set auth.existingSecret=pg-secret \ -n three-tier-app # Port-forward to test locally $ kubectl port-forward svc/backend-svc 8080:80 -n three-tier-app
Production Secret Management: External Secrets Operator (ESO)
Upstream reference: External Secrets Operator v0.10.x and Kubernetes Secrets Documentation. Command-line --from-literal arguments expose passwords in /proc/$PID/cmdline, process trees, and shell history. In production, synchronize secrets directly from an external vault (AWS Secrets Manager, HashiCorp Vault, Azure Key Vault) using the External Secrets Operator.
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: pg-secret-sync
namespace: three-tier-app
spec:
refreshInterval: 1h
secretStoreRef:
name: aws-secrets-manager
kind: ClusterSecretStore
target:
name: pg-secret
creationPolicy: Owner
data:
- secretKey: POSTGRES_PASSWORD
remoteRef:
key: production/three-tier-app/database
property: password
SME: EKS on AWS with Terraform
You have 20 engineers. Infrastructure needs to be automated, reliable, and multi-AZ. Uses eksctl for cluster creation and Helm for application deployment.
# Create EKS cluster (takes ~15 min) $ eksctl create cluster \ --name sme-production \ --region us-east-1 \ --nodegroup-name workers \ --node-type t3.medium \ --nodes-min 2 \ --nodes-max 10 \ --managed # Install AWS Load Balancer Controller $ helm install aws-load-balancer-controller \ eks/aws-load-balancer-controller \ --set clusterName=sme-production \ -n kube-system # Enable IRSA for pod-level AWS permissions $ eksctl create iamserviceaccount \ --cluster sme-production \ --namespace three-tier-app \ --name backend-sa \ --attach-policy-arn arn:aws:iam::aws:policy/AmazonS3ReadOnlyAccess \ --approve
Enterprise: Multi-Cluster + GitOps
500+ engineers across 3 regions. Each team owns a namespace. Infrastructure as Code (Terraform), GitOps (ArgoCD), policy enforcement (OPA Gatekeeper), and multi-cluster federation.
Enterprise Policy Enforcement & Multi-Cluster GitOps
Upstream references: OPA Gatekeeper v3.18 and Argo CD ApplicationSet v2.13. Assumptions: Kubernetes v1.31, Gatekeeper admission controller deployed in gatekeeper-system, and Argo CD managing multi-cluster fleet configurations.
In large enterprises, policy-as-code validates Kubernetes manifests before admission. The following ConstraintTemplate and Constraint enforce required metadata labels on namespaces, while the ApplicationSet generates isolated team namespaces across regional clusters.
apiVersion: templates.gatekeeper.sh/v1beta1
kind: ConstraintTemplate
metadata:
name: k8srequiredlabels
spec:
crd:
spec:
names:
kind: K8sRequiredLabels
validation:
openAPIV3Schema:
type: object
properties:
labels:
type: array
items:
type: string
targets:
- target: admission.k8s.gatekeeper.sh
rego: |
package k8srequiredlabels
violation[{"msg": msg, "details": {"missing_labels": missing}}] {
provided := {label | input.review.object.metadata.labels[label]}
required := {label | label := input.parameters.labels[_]}
missing := required - provided
count(missing) > 0
msg := sprintf("Missing required enterprise labels: %v", [missing])
}
---
apiVersion: constraints.gatekeeper.sh/v1beta1
kind: K8sRequiredLabels
metadata:
name: ns-must-have-owner
spec:
match:
kinds:
- apiGroups: [""]
kinds: ["Namespace"]
parameters:
labels: ["owner", "cost-center"]
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: team-namespaces
namespace: argocd
spec:
generators:
- list:
elements:
- cluster: https://k8s-prod-us-east-1.internal
namespace: payments-prod
- cluster: https://k8s-prod-eu-west-1.internal
namespace: payments-prod
template:
metadata:
name: "{{namespace}}-base"
spec:
project: default
source:
repoURL: https://github.com/enterprise/k8s-fleet.git
targetRevision: HEAD
path: teams/payments
destination:
server: "{{cluster}}"
namespace: "{{namespace}}"
syncPolicy:
automated:
prune: true
selfHeal: true
Troubleshooting & Disaster Recovery 05
Pod stuck in Pending state
# Step 1: Describe the pod — look for Events section $ kubectl describe pod <pod-name> -n <namespace> # Common causes from Events: # "0/3 nodes are available: 3 Insufficient cpu" → resource requests too high # "no nodes matched node affinity" → nodeSelector mismatch # "did not match pod anti-affinity rules" → topology constraint violation # "PVC not bound" → storage class issue # Step 2: Check node capacity $ kubectl describe nodes | grep -A 5 "Allocated resources" # Step 3: Check pending PVCs $ kubectl get pvc -n <namespace>
Deployment stuck in Progressing during rollout
# Check rollout status $ kubectl rollout status deployment/<name> -n <ns> --timeout=60s # View ReplicaSets to see old vs new $ kubectl get rs -n <ns> # Check pod logs of new pods (likely failing readinessProbe) $ kubectl logs <new-pod-name> --previous # Emergency rollback $ kubectl rollout undo deployment/<name> -n <ns>
Service not reachable (connection refused / timeout)
# Check if Service has endpoints (if NONE, label selector is wrong) $ kubectl get endpoints <service-name> -n <ns> # Run a debug pod to test connectivity from inside cluster $ kubectl run debug --image=nicolaka/netshoot --rm -it -- bash debug# curl http://<service-name>.<namespace>.svc.cluster.local debug# nslookup <service-name>.<namespace> # Check if NetworkPolicy is blocking traffic $ kubectl get networkpolicies -n <ns>
Disaster Recovery: Stacked etcd Snapshot & Restore Drill
Upstream references: Kubernetes etcd Backup Task, etcd v3.5 Disaster Recovery, and AWS EKS Control Plane Architecture.
Topology Assumptions: Kubernetes v1.31 on a self-managed stacked control-plane node (kubeadm static pod architecture). etcd listens on https://127.0.0.1:2379 with PKI keys at /etc/kubernetes/pki/etcd/.
#!/usr/bin/env bash
# Offline disaster recovery verification script; no live destructive host execution.
set -euo pipefail
# 1. Take a consistent point-in-time snapshot using etcdctl v3 API
export ETCDCTL_API=3
BACKUP_DIR="/var/lib/etcd-backup"
SNAPSHOT_PATH="${BACKUP_DIR}/etcd-snapshot-$(date +%Y%m%d%H%M).db"
mkdir -p "${BACKUP_DIR}"
etcdctl --endpoints=https://127.0.0.1:2379 \
--cacert=/etc/kubernetes/pki/etcd/ca.crt \
--cert=/etc/kubernetes/pki/etcd/server.crt \
--key=/etc/kubernetes/pki/etcd/server.key \
snapshot save "${SNAPSHOT_PATH}"
# 2. Verify snapshot integrity (verifies sha256 checksum, revision, and key count)
etcdctl --write-out=table snapshot status "${SNAPSHOT_PATH}"
# 3. Safe non-destructive restore to a dedicated new directory (never overwrite active /var/lib/etcd!)
RESTORE_DIR="/var/lib/etcd-restored"
etcdctl snapshot restore "${SNAPSHOT_PATH}" \
--data-dir=/var/lib/etcd-restored \
--initial-cluster=control-plane=https://127.0.0.1:2380 \
--initial-cluster-token=etcd-cluster-restore-token \
--initial-advertise-peer-urls=https://127.0.0.1:2380
# 4. Control Plane cutover (Self-Managed only):
# a. Move /etc/kubernetes/manifests/kube-apiserver.yaml away temporarily to prevent partial writes.
# b. Update hostPath volume in /etc/kubernetes/manifests/etcd.yaml to path: /var/lib/etcd-restored.
# c. Wait for kubelet to restart the etcd static pod, then restore kube-apiserver.yaml.
# d. Verify API server health: kubectl get nodes && kubectl get pods -A
Managed EKS vs. Self-Managed Control Planes: In self-managed clusters (kubeadm/bare-metal), operators own etcd quorum, disk I/O latency, TLS cert rotation, and snapshot recovery drills. In Amazon EKS (and GKE/AKS), cloud providers operate a multi-AZ etcd cluster behind an SLA. Customers cannot access port 2379, read PKI private keys, or execute etcdctl snapshot restore. EKS disaster recovery is managed at the workload layer using GitOps (re-deploying desired state from Git), Velero (backing up object metadata and persistent volume snapshots), and AWS automated backup policies.
Interactive Lab Checklist 06
Killercoda CKA Practice Labs
Open All- Create a 3-node Kind cluster and verify all nodes are ReadyLab
- Deploy a Deployment with 3 replicas and verify rolling update worksLab
- Create a Role allowing only pod listing in a specific namespace, bind to a ServiceAccountLab
- Apply a NetworkPolicy that isolates a namespace (deny all ingress/egress by default)Lab
- Configure HPA on a deployment and generate load to trigger auto-scalingLab
- Debug a broken service: fix label selector mismatch causing empty EndpointsSadServers
30-Day Learning Roadmap 07
- Pod, ReplicaSet, Deployment lifecycle
- Services: ClusterIP, NodePort, LoadBalancer
- ConfigMaps & Secrets
- kubectl cheat sheet mastery
- PV/PVC/StorageClass dynamic provisioning
- StatefulSets for databases
- Node affinity & taints/tolerations
- Topology Spread Constraints
- RBAC: Roles, ClusterRoles, Bindings
- NetworkPolicies (Calico/Cilium)
- Pod Security Standards (restricted)
- Ingress + TLS cert-manager
- HPA + KEDA event-driven scaling
- PodDisruptionBudgets
- Multi-cluster management
- EKS on AWS with eksctl
Cluster Metrics and Logs: metrics-server, kubectl top, /var/log/pods 08
Probes, Events and logs --previous (above) tell you about one pod. To see the cluster, you need resource metrics and a log pipeline. kubectl top reads the Metrics API, which metrics-server provides by scraping each kubelet; the HPA uses the same API. Pod logs live as files on each node, which is what a log agent ships.
Recorded from a real run of scripts/recordings/kubernetes.sh; every output below is pasted from scripts/recordings/kubernetes.out. Cover the output, predict it, then compare.
Environment: minikube v1.34.0 (Kubernetes v1.31.0, one node, Docker driver) with Argo CD installed; metrics-server v0.7.2 from minikube addons enable metrics-server. The node reports the host's CPUs and memory, and every number, pod name and uid differs per run.
# Before metrics-server is installed $ kubectl top nodes error: Metrics API not available # After enabling it: is the Metrics API registered and available? $ kubectl get apiservice v1beta1.metrics.k8s.io -o jsonpath='{.status.conditions[0].type}={.status.conditions[0].status}'; echo Available=True # Node usage $ kubectl top nodes NAME CPU(cores) CPU% MEMORY(bytes) MEMORY% da-gitops 141m 1% 1301Mi 8% # Heaviest pods in argocd by memory $ kubectl top pods -n argocd --sort-by=memory | head -4 NAME CPU(cores) MEMORY(bytes) argocd-dex-server-5dfd67bb67-r66wk 1m 57Mi argocd-repo-server-764d477ccd-sn6ls 1m 29Mi argocd-server-6767446cb9-nv29w 1m 28Mi # Where the kubelet keeps pod logs on the node $ minikube -p da-gitops ssh -- sudo ls /var/log/pods | grep argocd-server argocd_argocd-server-6767446cb9-nv29w_450d4098-2405-4d8f-9af1-54f1158ecb47
kubectl top shows current usage only, with no history: use it to spot the heavy pod, and Prometheus with kube-state-metrics and cAdvisor for trends and alerts. Compare usage with requests, because the scheduler places pods by requests, not usage. Logs are written under /var/log/pods/<namespace>_<pod>_<uid>/ and deleted with the pod, so a DaemonSet agent (Fluent Bit, Promtail, Grafana Alloy or the OpenTelemetry Collector) must tail them to Loki, Elasticsearch or CloudWatch if you want them after a crash.
Concrete Metrics Stack & Log-Agent Pipeline Installation
Upstream references: metrics-server v0.7.2 and Fluent Bit v3.2 Loki Pipeline. Assumptions: Kubernetes v1.31, namespace-scoped secret injection, and non-destructive manifest inspection.
apiVersion: apps/v1
kind: Deployment
metadata:
name: metrics-server
namespace: kube-system
labels:
k8s-app: metrics-server
spec:
selector:
matchLabels:
k8s-app: metrics-server
template:
metadata:
labels:
k8s-app: metrics-server
spec:
serviceAccountName: metrics-server
containers:
- name: metrics-server
image: registry.k8s.io/metrics-server/metrics-server:v0.7.2
args:
- --cert-dir=/tmp
- --secure-port=4443
- --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname
- --kubelet-use-node-status-port
- --metric-resolution=15s
ports:
- name: https
containerPort: 4443
protocol: TCP
securityContext:
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 10001
apiVersion: v1
kind: Secret
metadata:
name: loki-credentials
namespace: logging
type: Opaque
stringData:
LOKI_USERNAME: log-collector
LOKI_PASSWORD: synthetic-push-token-do-not-use-in-prod
---
apiVersion: v1
kind: ConfigMap
metadata:
name: fluent-bit-config
namespace: logging
data:
fluent-bit.conf: |
[SERVICE]
Flush 1
Log_Level info
Daemon off
Parsers_File parsers.conf
HTTP_Server On
HTTP_Listen 0.0.0.0
HTTP_Port 2020
[INPUT]
Name tail
Tag kube.*
Path /var/log/pods/*/*/*.log
Parser cri
DB /var/log/flb_kube.db
Mem_Buf_Limit 5MB
Skip_Long_Lines On
Refresh_Interval 10
[FILTER]
Name kubernetes
Match kube.*
Kube_URL https://kubernetes.default.svc:443
Kube_CA_File /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
Kube_Token_File /var/run/secrets/kubernetes.io/serviceaccount/token
Merge_Log On
Keep_Log Off
[OUTPUT]
Name loki
Match kube.*
Host loki-gateway.logging.svc.cluster.local
Port 3100
URI /loki/api/v1/push
Http_User ${LOKI_USERNAME}
Http_Passwd ${LOKI_PASSWORD}
Labels job=fluent-bit, namespace=$kubernetes['namespace_name']
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: fluent-bit
namespace: logging
spec:
selector:
matchLabels:
app.kubernetes.io/name: fluent-bit
template:
metadata:
labels:
app.kubernetes.io/name: fluent-bit
spec:
serviceAccountName: fluent-bit
containers:
- name: fluent-bit
image: cr.fluentbit.io/fluent/fluent-bit:3.2.0
env:
- name: LOKI_USERNAME
valueFrom:
secretKeyRef:
name: loki-credentials
key: LOKI_USERNAME
- name: LOKI_PASSWORD
valueFrom:
secretKeyRef:
name: loki-credentials
key: LOKI_PASSWORD
volumeMounts:
- name: config
mountPath: /fluent-bit/etc/fluent-bit.conf
subPath: fluent-bit.conf
- name: varlog
mountPath: /var/log
readOnly: true
volumes:
- name: config
configMap:
name: fluent-bit-config
- name: varlog
hostPath:
path: /var/log