YAML for DevOps, Kubernetes, and CI

Kubernetes manifests, GitHub Actions, Helm, Compose, and YAML-powered automation workflows with practical validation commands.

View
StandardDetailedCompact
Export
Copy the compact sheet, download it, or print it.
Download
`D` dense toggle · `C` copy all
## Kubernetes YAML patterns
Minimal Kubernetes Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
  name: expressyou-api
spec:
  replicas: 2
  selector:
    matchLabels:
      app: expressyou-api
  template:
    metadata:
      labels:
        app: expressyou-api
    spec:
      containers:
        - name: api
          image: us-central1-docker.pkg.dev/project/repo/api:latest
          ports:
            - containerPort: 8080

# Define a basic Deployment resource in YAML.

Minimal GitHub Actions workflow
name: CI
on: [push]
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: npm test

# Define an automation workflow in YAML.

Apply a manifest
kubectl apply -f deployment.yaml

# Create or update Kubernetes resources from YAML.

Preview resource changes
kubectl diff -f deployment.yaml

# Show what would change before applying a manifest.

## Validation and rendering
Inspect Kubernetes manifest fields
kubectl explain deployment.spec.template.spec.containers

# Read documentation for manifest fields from the terminal.

Lint a Helm chart
helm lint ./chart

# Validate templated YAML before rendering or deploy.

Render a composed YAML config
docker compose config

# Validate and resolve a Compose file.

Lint YAML-based Ansible playbooks
ansible-lint playbook.yml

# Catch common style and correctness issues in playbooks.

Recommended next

No recommendations yet.