Skip to content
kubernetes-operators logo

Kubernetes Infrastructure Patterns

kubernetes-operators

Kubernetes infrastructure patterns including operators, Helm, GitOps, and component provisioning.

SKILL.md

Full skill instructions

Kubernetes Infrastructure Patterns

Infrastructure provisioning using Kubernetes operators, Helm, and GitOps practices.

Core Stack

ComponentToolPurpose
ContainerDockerImage building
OrchestrationKubernetesWorkload management
Package ManagerHelmChart management
GitOpsArgoCD, KustomizeDeclarative deployments
CI/​CDGitHub Actions, Argo WorkflowsAutomation
MonitoringPrometheus, Grafana, LokiObservability
NetworkingIngress, NetworkPoliciesTraffic management

Context7 Library IDs

Query these for current best practices:

  • ArgoCD: /​argoproj/​argo-cd
  • Helm: /​helm/​helm

Execution Rules

  1. GitOps first. All changes through git, not kubectl apply ad-hoc
  2. Helm best practices. Values.yaml for configuration, templates for logic
  3. Security. No secrets in code, use External Secrets Operator
  4. Idempotent. All operations safe to retry
  5. Validate. Always helm template and kubectl diff before apply

Available Operators

TypeOperatorCRD KindNamespace
PostgreSQLCloudNative-PGClusterdatabases
Redis/​ValkeyRedis OperatorRedisdatabases
S3/​StorageSeaweedFSHelmseaweedfs
KafkaStrimziKafkakafka
MongoDBPerconaPerconaServerMongoDBdatabases
MySQLPerconaPerconaXtraDBClusterdatabases
NATSNATS HelmHelmnats
RabbitMQRabbitMQ OperatorRabbitmqClustermessaging

Size Presets

SizeCPU RequestMemoryStorageReplicas
small100m256Mi5Gi1
medium500m1Gi20Gi1-2
large1000m4Gi100Gi3

Infrastructure Provisioning Process

Step 1: Parse Requirements

Extract infrastructure from task XML:

<infrastructure>
    <component type="postgresql" name="app-db">
        <size>small</​size>
        <replicas>1</​replicas>
        <database>app_production</​database>
    </​component>
</​infrastructure>

Step 2: Generate Manifests

Create manifests in the infra/ directory:

infra/
├── postgresql/
│   └── cluster.yaml
├── valkey/
│   └── redis.yaml
├── seaweedfs/
│   └── bucket-init.yaml
└── kustomization.yaml

Step 3: PostgreSQL Example

apiVersion: postgresql.cnpg.io/​v1
kind: Cluster
metadata:
  name: app-db
  namespace: databases
spec:
  instances: 1
  storage:
    size: 5Gi
    storageClass: mayastor
  bootstrap:
    initdb:
      database: app_production
      owner: app_user

Step 4: Valkey/​Redis Example

apiVersion: redis.redis.opstreelabs.in/​v1beta2
kind: Redis
metadata:
  name: app-cache
  namespace: databases
spec:
  kubernetesConfig:
    image: redis:7-alpine
  storage:
    volumeClaimTemplate:
      spec:
        storageClassName: mayastor
        accessModes: ["ReadWriteOnce"]
        resources:
          requests:
            storage: 1Gi

Step 5: Apply and Wait

# Apply manifests
kubectl apply -k infra/

# Wait for PostgreSQL
kubectl wait --for=condition=Ready cluster/​app-db -n databases --timeout=300s

# Wait for Valkey
kubectl wait --for=condition=Ready redis/​app-cache -n databases --timeout=300s

Step 6: Create Infrastructure ConfigMap

apiVersion: v1
kind: ConfigMap
metadata:
  name: app-infra-config
  namespace: app
  labels:
    cto.platform/​type: infrastructure-config
data:
  DATABASE_URL: postgresql://app_user:[email protected]:5432/​app
  DATABASE_HOST: app-db-rw.databases.svc
  DATABASE_PORT: "5432"
  DATABASE_NAME: app
  
  REDIS_URL: redis://app-cache.databases.svc:6379
  REDIS_HOST: app-cache.databases.svc
  REDIS_PORT: "6379"
  
  S3_ENDPOINT: http://seaweedfs-filer.seaweedfs.svc:8333
  S3_BUCKET: app-uploads

Validation Commands

# Helm validation
helm lint ./​chart
helm template ./​chart --debug

# Kubernetes validation
kubectl diff -f manifest.yaml
kubeval manifest.yaml

# ArgoCD
argocd app diff app-name

# Check status
kubectl get all -n databases
kubectl get cluster -n databases -o wide
kubectl get redis -n databases

Error Handling

If provisioning fails:

  1. Check operator logs: kubectl logs -n operators -l app.kubernetes.io/​name=<operator>
  2. Describe the resource: kubectl describe cluster/​app-db -n databases
  3. Check events: kubectl get events -n databases --sort-by='.lastTimestamp'
  4. Verify storage class: kubectl get storageclass mayastor

Guidelines

  • Use operators for stateful services (databases, caches)
  • Store connection details in ConfigMaps for other agents
  • Always wait for resources to be ready before completing
  • Document connection information in infra/​README.md
  • Use GitOps (ArgoCD) for production deployments
  • Never hardcode secrets in manifests

More DevOps & CI/CD skills

Project scaffolding, deployment configuration, and CI/CD setup for Google ADK agents.

6K 472.6K
View

Set up tracing, logging, and monitoring for deployed ADK agents across Cloud Trace, BigQuery, and third-party platforms.

6K 472.6K
View

Enterprise Azure infrastructure architect generating Bicep or Terraform from workload descriptions.

1.5K 454.3K
View
azure-kubernetes logo
DevOps & CI/CD

azure-kubernetes

Plan and configure production-ready Azure Kubernetes Service clusters with Day-0 and Day-1 best practices.

1.5K 447.1K
View

Raw mechanical interfaces fusing Swiss typographic print with military terminal aesthetics. Rigid grids, extreme type scale contrast, utilitarian color, analog degradation effects. For data-heavy dashboards, portfolios, or editorial sites that need to feel like declassified blueprints.

92.7K 354.9K
View
just-scrape logo
DevOps & CI/CD

just-scrape

Web search, scraping, extraction, crawling, and monitoring via ScrapeGraph AI CLI.

69 245K
View

Skill for working with Firebase Hosting (Classic). Use this when you want to deploy static web apps, Single Page Apps (SPAs), or simple microservices. Do NOT use for Firebase App Hosting.

462 159.7K
View

Deploy and manage web apps with Firebase App Hosting. Use this skill when deploying Next.js/Angular apps with backends.

462 159.1K
View
deploy-to-vercel logo
DevOps & CI/CD

deploy-to-vercel

Deploy applications and websites to Vercel. Use when the user requests deployment actions like "deploy my app", "deploy and give me the link", "push this live", or "create a preview deployment".

31.9K 146.6K
View
programmatic-seo logo
DevOps & CI/CD

programmatic-seo

Build SEO-optimized pages at scale using templates, data, and proven playbook patterns.

53.3K 140.1K
View

Design and build isolated, reusable Convex backend components with clear boundaries and app-facing wrappers.

63 123.5K
View

Deploy and manage projects on Vercel using token-based authentication. Use when working with Vercel CLI using access tokens rather than interactive login — e.g. "deploy to vercel", "set up vercel", "add environment variables to vercel".

31.9K 116.1K
View

Coding & apps AI tools

Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View
Imagica logo
Coding & apps

Imagica

Build a no-code AI app in minutes.

Freemium
View
E
Coding & apps

Emergent.sh

An IDE for code migration from legacy to modern frameworks through coding agents.

Freemium
View
Wonder Dynamics logo
Coding & apps

Wonder Dynamics

Automate CGI animation in live-action scenes

Paid
View
M
Coding & apps

Mixo

Launch a website in seconds with AI.

Paid
View
AI Code Convert logo
Coding & apps

AI Code Convert

Streamline Your Coding Experience with AI Code Helper

Free
View