DevOps Expert

The DevOps Expert agent specializes in deployment, CI/CD, infrastructure, and operational excellence.

Expertise Areas#

  • CI/CD - GitHub Actions, GitLab CI, Jenkins
  • Containers - Docker, Docker Compose, Kubernetes
  • Cloud Platforms - AWS, GCP, Azure, Vercel
  • Infrastructure as Code - Terraform, Pulumi, CDK
  • Monitoring - Prometheus, Grafana, Datadog
  • Logging - ELK stack, CloudWatch, structured logging
  • Security - Secrets management, network security

Usage Examples#

CI/CD Pipeline#

Use the devops-expert agent to create a GitHub Actions workflow for a Next.js app with: - Linting and testing - Preview deployments - Production deployment

Response includes:

  • Complete workflow file
  • Environment configuration
  • Caching strategies
  • Deployment steps

Docker Setup#

Use the devops-expert agent to create a production-ready Dockerfile for a Node.js API.

Response includes:

  • Multi-stage build
  • Security hardening
  • Optimization tips
  • Docker Compose setup

Infrastructure#

Use the devops-expert agent to set up AWS infrastructure for a serverless application.

Response includes:

  • Terraform/CDK code
  • Service configuration
  • Security groups
  • IAM policies

CI/CD Patterns#

GitHub Actions Workflow#

1name: CI/CD Pipeline 2 3on: 4 push: 5 branches: [main, develop] 6 pull_request: 7 branches: [main] 8 9env: 10 NODE_VERSION: '20' 11 12jobs: 13 lint-and-test: 14 runs-on: ubuntu-latest 15 steps: 16 - uses: actions/checkout@v4 17 18 - name: Setup Node.js 19 uses: actions/setup-node@v4 20 with: 21 node-version: ${{ env.NODE_VERSION }} 22 cache: 'npm' 23 24 - name: Install dependencies 25 run: npm ci 26 27 - name: Lint 28 run: npm run lint 29 30 - name: Type check 31 run: npm run type-check 32 33 - name: Test 34 run: npm run test:ci 35 36 - name: Upload coverage 37 uses: codecov/codecov-action@v3 38 39 build: 40 needs: lint-and-test 41 runs-on: ubuntu-latest 42 steps: 43 - uses: actions/checkout@v4 44 45 - name: Setup Node.js 46 uses: actions/setup-node@v4 47 with: 48 node-version: ${{ env.NODE_VERSION }} 49 cache: 'npm' 50 51 - name: Install dependencies 52 run: npm ci 53 54 - name: Build 55 run: npm run build 56 57 - name: Upload build artifact 58 uses: actions/upload-artifact@v3 59 with: 60 name: build 61 path: .next 62 63 deploy-preview: 64 if: github.event_name == 'pull_request' 65 needs: build 66 runs-on: ubuntu-latest 67 environment: 68 name: preview 69 url: ${{ steps.deploy.outputs.url }} 70 steps: 71 - uses: actions/checkout@v4 72 73 - name: Deploy to Vercel 74 id: deploy 75 uses: amondnet/vercel-action@v25 76 with: 77 vercel-token: ${{ secrets.VERCEL_TOKEN }} 78 vercel-org-id: ${{ secrets.VERCEL_ORG_ID }} 79 vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }} 80 81 deploy-production: 82 if: github.ref == 'refs/heads/main' 83 needs: build 84 runs-on: ubuntu-latest 85 environment: 86 name: production 87 url: https://example.com 88 steps: 89 - uses: actions/checkout@v4 90 91 - name: Deploy to Vercel 92 uses: amondnet/vercel-action@v25 93 with: 94 vercel-token: ${{ secrets.VERCEL_TOKEN }} 95 vercel-org-id: ${{ secrets.VERCEL_ORG_ID }} 96 vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }} 97 vercel-args: '--prod'

Docker Configuration#

1# Dockerfile 2FROM node:20-alpine AS base 3 4# Install dependencies only when needed 5FROM base AS deps 6RUN apk add --no-cache libc6-compat 7WORKDIR /app 8 9COPY package.json package-lock.json ./ 10RUN npm ci --only=production 11 12# Build stage 13FROM base AS builder 14WORKDIR /app 15COPY --from=deps /app/node_modules ./node_modules 16COPY . . 17 18ENV NEXT_TELEMETRY_DISABLED 1 19RUN npm run build 20 21# Production stage 22FROM base AS runner 23WORKDIR /app 24 25ENV NODE_ENV production 26ENV NEXT_TELEMETRY_DISABLED 1 27 28RUN addgroup --system --gid 1001 nodejs 29RUN adduser --system --uid 1001 nextjs 30 31COPY --from=builder /app/public ./public 32COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./ 33COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static 34 35USER nextjs 36 37EXPOSE 3000 38ENV PORT 3000 39 40CMD ["node", "server.js"]

Docker Compose#

1# docker-compose.yml 2version: '3.8' 3 4services: 5 app: 6 build: 7 context: . 8 dockerfile: Dockerfile 9 ports: 10 - "3000:3000" 11 environment: 12 - DATABASE_URL=postgresql://postgres:postgres@db:5432/app 13 - REDIS_URL=redis://redis:6379 14 depends_on: 15 - db 16 - redis 17 restart: unless-stopped 18 19 db: 20 image: postgres:15-alpine 21 environment: 22 POSTGRES_USER: postgres 23 POSTGRES_PASSWORD: postgres 24 POSTGRES_DB: app 25 volumes: 26 - postgres_data:/var/lib/postgresql/data 27 ports: 28 - "5432:5432" 29 30 redis: 31 image: redis:7-alpine 32 ports: 33 - "6379:6379" 34 volumes: 35 - redis_data:/data 36 37volumes: 38 postgres_data: 39 redis_data:

Infrastructure Patterns#

Terraform AWS Setup#

1# main.tf 2terraform { 3 required_providers { 4 aws = { 5 source = "hashicorp/aws" 6 version = "~> 5.0" 7 } 8 } 9} 10 11provider "aws" { 12 region = var.aws_region 13} 14 15# VPC 16module "vpc" { 17 source = "terraform-aws-modules/vpc/aws" 18 19 name = "${var.project_name}-vpc" 20 cidr = "10.0.0.0/16" 21 22 azs = ["${var.aws_region}a", "${var.aws_region}b"] 23 private_subnets = ["10.0.1.0/24", "10.0.2.0/24"] 24 public_subnets = ["10.0.101.0/24", "10.0.102.0/24"] 25 26 enable_nat_gateway = true 27 single_nat_gateway = true 28} 29 30# ECS Cluster 31resource "aws_ecs_cluster" "main" { 32 name = "${var.project_name}-cluster" 33 34 setting { 35 name = "containerInsights" 36 value = "enabled" 37 } 38} 39 40# RDS 41module "rds" { 42 source = "terraform-aws-modules/rds/aws" 43 44 identifier = "${var.project_name}-db" 45 46 engine = "postgres" 47 engine_version = "15" 48 family = "postgres15" 49 major_engine_version = "15" 50 instance_class = "db.t3.micro" 51 52 allocated_storage = 20 53 54 db_name = "app" 55 username = "admin" 56 port = 5432 57 58 vpc_security_group_ids = [module.security_group.security_group_id] 59 subnet_ids = module.vpc.private_subnets 60 61 backup_retention_period = 7 62 deletion_protection = true 63}

Sample Prompts#

TaskPrompt
CI/CD"Create a GitLab CI pipeline for a monorepo"
Docker"Optimize this Dockerfile for smaller image size"
Kubernetes"Set up Kubernetes deployment with auto-scaling"
Monitoring"Configure Prometheus alerts for this service"
Secrets"Set up HashiCorp Vault for secrets management"

Configuration#

1// bootspring.config.js 2module.exports = { 3 agents: { 4 customInstructions: { 5 'devops-expert': ` 6 - Use GitHub Actions for CI/CD 7 - Prefer containerized deployments 8 - Include health checks 9 - Set up proper logging 10 - Follow security best practices 11 `, 12 }, 13 }, 14};