Getting Kubernetes into your pipeline is where it starts paying off - automated, repeatable and reviewed. Here is a working integration and the habits that keep it reliable.
A working pipeline snippet
Set the new image and wait for the rollout inside a pipeline.
deploy:
stage: deploy
script:
- kubectl set image deploy/web web=ghcr.io/acme/web:$CI_COMMIT_SHA
- kubectl rollout status deploy/web --timeout=120s
rules:
- if: '$CI_COMMIT_BRANCH == "main"'Do this
- Set requests/limits and use the HorizontalPodAutoscaler for elastic workloads
- Separate config (ConfigMap) from secrets and mount them, don't bake them in
- Use readiness probes to gate traffic and PodDisruptionBudgets for safe drains
- Adopt GitOps (ArgoCD/Flux) so the cluster state lives in reviewed Git
Avoid this
- No resource requests/limits - the scheduler can't pack pods and OOM kills surprise you
- Using :latest images so rollbacks and caching become unpredictable
- Liveness probes that are too aggressive, restarting healthy-but-slow pods
- Treating Secrets as encrypted - they are only base64-encoded at rest by default
Want senior help putting Kubernetes to work - or a team bootcamp on it? CodeWizard runs Israel's largest DevOps community and embeds named senior engineers with a transparent hours log. Book a free consult or explore the Academy.