
Introduction
Reading about automation is easy. Building it is where most teams get stuck. This tutorial walks through one complete, small example: a pipeline that tests code, builds an image, deploys it automatically to a Kubernetes cluster, watches its health, and rolls back when something goes wrong.
The goal is to show how NoOps automation tools fit together in practice. You will not need to copy every detail. The aim is to understand the flow so you can adapt it to your own stack.
If you are new to the idea, a quick definition helps. What is NoOps? It is an approach where automation and managed services handle routine operations, such as provisioning, releasing, scaling, and recovering from common failures, while people design the system, set policies, and stay accountable for results. In the NoOps vs DevOps comparison, DevOps is the shared-ownership culture and NoOps pushes the automation further. This tutorial uses habits from both.
What You Will Build
A hypothetical service called shop-api will move through this path:
- A developer opens a pull request.
- A CI pipeline runs tests and builds a container image.
- The infrastructure is created from code.
- A GitOps tool deploys the approved version to a staging cluster.
- Health checks decide whether the new version receives traffic.
- Monitoring alerts when users are affected.
- A person promotes the release to production.
All names, repositories, and URLs below are placeholders.
Prerequisites
Before you begin, you should have:
- A Git hosting account and a repository for the application code.
- A separate repository for configuration and deployment files.
- A container registry.
- A Kubernetes cluster for staging, preferably a managed one.
- A cloud account with a spending limit or budget alert.
- Basic knowledge of Git, Docker, and the command line.
| Component | Purpose | Example tool |
|---|---|---|
| Source control | Tracks all changes | Git |
| CI pipeline | Tests and builds | GitHub Actions |
| Infrastructure as code | Creates cloud resources | Terraform |
| Orchestrator | Runs containers | Kubernetes |
| GitOps controller | Applies Git state to the cluster | Argo CD |
| Monitoring | Collects metrics and alerts | Prometheus, Grafana |
These are examples. Other tools can do the same jobs, so check current documentation before choosing.
Step 1: Separate Code From Configuration
Keep two repositories. One holds the application code. The other holds the deployment configuration for each environment. This separation has two benefits. Configuration changes do not trigger application builds, and the configuration repository becomes a clear, auditable record of what should be running.
A simple layout for the configuration repository:
shop-config/
base/ # shared Kubernetes files
overlays/
staging/ # staging-specific settings
production/ # production-specific settings
Protect the main branch. Require pull requests and at least one review for every change.
Step 2: Define Infrastructure as Code
Describe your cluster, networks, and supporting services in Terraform files and store them in version control. Use a remote state backend with locking, so two people cannot apply changes at the same time.
A safe workflow:
- Run
terraform fmtandterraform validateon every pull request. - Run
terraform planand post the result for reviewers. - Apply only after the pull request is approved and merged.
- Keep production state and staging state separate.
Reviewing a plan before it runs is one of the most valuable safety habits in infrastructure automation. It shows exactly what will be created, changed, or destroyed.
Step 3: Build a CI Pipeline
The CI pipeline checks every change. A minimal example for GitHub Actions:
name: ci
on:
pull_request:
push:
branches: [main]
jobs:
build-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run tests
run: make test
- name: Build image
run: docker build -t registry.example.com/shop-api:${{ github.sha }} .
Notes:
- Tag images with the commit hash, not “latest.” This makes every deployment traceable and every rollback exact.
- Add steps for dependency and image scanning, and for signing images, as your maturity grows.
- Store registry credentials in the platform’s secrets feature, never in the repository.
Step 4: Make the Application Deployable
Kubernetes decides whether a container is healthy by using probes. Add them to the Deployment definition:
readinessProbe:
httpGet:
path: /healthz
port: 8080
initialDelaySeconds: 5
periodSeconds: 10
livenessProbe:
httpGet:
path: /healthz
port: 8080
periodSeconds: 20
The readiness probe controls whether traffic is sent to a container. The liveness probe controls whether it should be restarted. Together they provide the basic self-healing behaviour. Also set sensible CPU and memory requests and limits, so one faulty service cannot starve the others.
Step 5: Connect GitOps
Install a GitOps controller such as Argo CD in the cluster. Then tell it which repository path to watch:
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: shop-api
namespace: argocd
spec:
project: default
source:
repoURL: https://git.example.com/platform/shop-config.git
targetRevision: main
path: overlays/staging
destination:
server: https://kubernetes.default.svc
namespace: shop
syncPolicy:
automated:
prune: true
selfHeal: true
With this setup, the controller compares the cluster with the repository. If someone changes a setting by hand, selfHeal restores the approved version. prune removes resources that were deleted from Git.
For staging, automatic sync is convenient. For production, many teams prefer manual sync or an approval step, so a person confirms each release. This is a good example of matching automation to risk.
Step 6: Update the Release Process
When CI builds a new image, the release process updates the image tag in the configuration repository, usually through an automated pull request. The flow becomes:
- CI builds image
shop-api:abc123. - An automated pull request updates the tag in
overlays/staging. - After review or passing checks, the change merges.
- Argo CD detects the change and deploys.
Because the deployment is just a Git commit, rolling back means reverting that commit. The previous version returns, and the history shows who changed what and when.
Step 7: Add Monitoring and Alerts
Automation without visibility is risky. Collect metrics with Prometheus and show them in Grafana. Then alert on user-facing symptoms. Here is an example rule that fires when more than five percent of requests fail for five minutes:
groups:
- name: shop-api
rules:
- alert: HighErrorRate
expr: |
sum(rate(http_requests_total{job="shop-api",status=~"5.."}[5m]))
/
sum(rate(http_requests_total{job="shop-api"}[5m])) > 0.05
for: 5m
labels:
severity: page
annotations:
summary: "More than 5% of requests are failing"
Metric names depend on how your application is instrumented, so adjust them. Each alert should link to a short runbook that explains what it means and what to check first.
Step 8: Add Safe Releases
For stronger protection, use progressive delivery. A tool such as Argo Rollouts can send a small share of traffic to the new version, check metrics, and continue or reverse automatically. A typical pattern:
- Send 10 percent of traffic to the new version.
- Watch error rate and response time for a set period.
- If metrics stay within limits, increase the share. If not, roll back.
Define the limits carefully. Thresholds that are too tight cause needless rollbacks, and thresholds that are too loose let problems through.
Step 9: Add Guardrails
Automation needs boundaries. Useful guardrails include:
- Policy checks with tools like Open Policy Agent or Kyverno, to block risky settings, such as containers running with excessive privileges.
- Least privilege for the CI pipeline and the GitOps controller. The pipeline that builds software should not hold broad production access.
- Secrets management through a dedicated tool, not repository files.
- Budget alerts and resource limits to prevent runaway costs.
- A documented way to pause automation if it misbehaves.
Verification Checklist
Before calling the pipeline ready, confirm that you can:
- Open a pull request and see tests run.
- Merge and watch a new image appear in the registry.
- See the staging cluster update without manual commands.
- Break a health check on purpose and watch traffic stop going to the faulty copy.
- Revert a commit and watch the previous version return.
- Trigger a test alert and confirm the right person is notified.
Troubleshooting
| Symptom | Likely cause | What to check |
|---|---|---|
| Pipeline passes but the pod never becomes ready | Wrong health check path or port | Probe settings, application logs |
| GitOps tool shows “out of sync” repeatedly | Another process also changes the same resource | Controllers or manual edits fighting each other |
| Deployment pulls the wrong image | Mutable tags in use | Switch to commit-based tags |
| Alerts fire constantly | Thresholds too tight or noisy metrics | Alert duration, grouping, and targets |
| Costs rise unexpectedly | Scaling limits missing or test resources left running | Autoscaler maximums, unused resources |
| Terraform plan wants to delete resources | State mismatch or manual changes | State file, recent console edits |
Best Practices
- Start with one service and one environment, then expand.
- Keep every change reviewable and reversible.
- Write the rollback steps before the first production release.
- Practice failures in staging, not only successes.
- Keep a named owner for each service and each alert.
- Review automation permissions regularly.
- Document how everything works, so knowledge does not live in one person’s head.
Building the Skills
A pipeline like this touches many areas: Git, containers, Kubernetes, Terraform, monitoring, and security. If you want structured practice, a NoOps training course with hands-on labs can help you build these skills in order. NoOpsSchool describes learning programs and certification tracks for NoOps engineers, architects, managers, and professionals. If you are weighing NoOps engineer certification, check the official page for the syllabus, exam format, fees, and validity, and do not assume details that are not published. Whatever you choose, build a small project like this one, because working examples show your skills better than a certificate alone.
When to Bring in Outside Help
Some organizations do not have time to learn everything before they need results. NoOps consulting services often include an assessment of current delivery practices, a plan for what to automate first, and help implementing pipelines and monitoring. If you decide to hire NoOps freelancers, start with a small, clearly defined task, verify their experience with your exact tools, limit their access to what they need, and require documentation and code ownership at handover. Be cautious about promises of guaranteed results.
Frequently Asked Questions
Do I need Kubernetes to automate deployments?
No. Managed platforms and serverless services can also automate releases. Kubernetes is a common choice for teams that want more control.
Should production deploy automatically?
That depends on risk. Many teams automate staging fully and keep an approval step for production.
Why use commit hashes instead of “latest” tags?
Hash-based tags identify exactly what is running, which makes audits and rollbacks reliable.
How long does a setup like this take?
It varies by team and system. Start small and expand after each stage proves itself.
Is GitOps the same as CI/CD?
No. CI/CD builds, tests, and delivers changes. GitOps is a method for applying and maintaining the desired state, with Git as the source of truth. They work well together.
What if automation makes a wrong change?
Use staged rollouts, limits, alerts, and a tested rollback path. Revert the change in Git and investigate afterwards.
Conclusion
A good NoOps-style pipeline is built from simple, repeatable pieces: version control, automated tests, infrastructure as code, health checks, GitOps, monitoring, and safe release methods. None of them removes human responsibility. Together, they move routine work to machines and leave people free to review, decide, and improve.
Build the smallest working version first. Confirm each step with the verification checklist, then add policies, progressive delivery, and more environments as confidence grows. A pipeline you understand and can explain is worth more than a complex one nobody can maintain.