[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7387AFB5BYZVW20R6S7Y89K":3,"skill-same:01M7387AFB5BYZVW20R6S7Y89K":65},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":37,"commitSha":38,"skillDirectory":39,"forksCount":40,"repositoryHtmlUrl":41,"repositoryHomepageUrl":6,"ownerHtmlUrl":42,"ownerBlogUrl":43,"ownerDescription":6,"updatedAt":44,"install":45,"resources":58},"01M7387AFB5BYZVW20R6S7Y89K","deploy-to-kubernetes",null,"Deploy applications to Kubernetes clusters using kubectl manifests for Deployments, Services, ConfigMaps, Secrets, and Ingress resources. Implement health checks, resource limits, rolling updates, and Helm chart packaging for production deployments. Use when deploying new applications to EKS, GKE, AKS, or self-hosted clusters, migrating from Docker Compose to container orchestration, implementing zero-downtime rolling updates, or setting up multi-environment deployments across dev, staging, and production.","roohe\u002Fagentic-super-skills","roohe","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F99054084?v=4","01M734WCDFP6RZVT5CNM00QR26","01M734WCE4BD0T4NZS5PCV9V5F",10,"MIT","https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Fdeploy-to-kubernetes\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: deploy-to-kubernetes\nlocale: caveman-lite\nsource_locale: en\nsource_commit: 82c77053\ntranslator: \"Julius Brussee homage — caveman\"\ntranslation_date: \"2026-04-23\"\ndescription: >\n  Deploy applications to Kubernetes clusters using kubectl manifests for Deployments,\n  Services, ConfigMaps, Secrets, and Ingress resources. Implement health checks, resource\n  limits, rolling updates, and Helm chart packaging for production deployments. Use when\n  deploying new applications to EKS, GKE, AKS, or self-hosted clusters, migrating from\n  Docker Compose to container orchestration, implementing zero-downtime rolling updates,\n  or setting up multi-environment deployments across dev, staging, and production.\nlicense: MIT\nallowed-tools: Read Write Edit Bash Grep Glob\nmetadata:\n  author: Philipp Thoss\n  version: \"1.0\"\n  domain: devops\n  complexity: intermediate\n  language: multi\n  tags: kubernetes, k8s, kubectl, deployment, service\n---\n\n# Deploy to Kubernetes\n\nDeploy containerized applications to Kubernetes with production-ready configurations including health checks, resource management, and automated rollouts.\n\n## When to Use\n\n- Deploying new applications to Kubernetes clusters (EKS, GKE, AKS, self-hosted)\n- Migrating from Docker Compose or traditional VMs to container orchestration\n- Implementing zero-downtime rolling updates and rollbacks\n- Managing application configuration and secrets in Kubernetes\n- Setting up multi-environment deployments (dev, staging, production)\n- Creating reusable Helm charts for application distribution\n\n## Inputs\n\n- **Required**: Kubernetes cluster access (`kubectl cluster-info`)\n- **Required**: Container images pushed to registry (Docker Hub, ECR, GCR, Harbor)\n- **Required**: Application requirements (ports, environment variables, volumes)\n- **Optional**: TLS certificates for HTTPS ingress\n- **Optional**: Persistent storage requirements (StatefulSets, PVCs)\n- **Optional**: Helm CLI for chart-based deployments\n\n## Procedure\n\n> See [Extended Examples](references\u002FEXAMPLES.md) for complete configuration files and templates.\n\n\n### Step 1: Create Namespace and Resource Quotas\n\nOrganize applications into namespaces with resource limits and RBAC.\n\n```bash\n# Create namespace\nkubectl create namespace myapp-prod\n\n# Apply resource quota\ncat \u003C\u003CEOF | kubectl apply -f -\napiVersion: v1\nkind: ResourceQuota\nmetadata:\n  name: compute-quota\n  namespace: myapp-prod\nspec:\n  hard:\n    requests.cpu: \"10\"\n    requests.memory: \"20Gi\"\n    limits.cpu: \"20\"\n    limits.memory: \"40Gi\"\n    persistentvolumeclaims: \"5\"\n    services.loadbalancers: \"2\"\n---\napiVersion: v1\nkind: LimitRange\nmetadata:\n  name: default-limits\n  namespace: myapp-prod\nspec:\n  limits:\n  - default:\n      cpu: \"500m\"\n      memory: \"512Mi\"\n    defaultRequest:\n      cpu: \"100m\"\n      memory: \"128Mi\"\n    type: Container\nEOF\n\n# Create service account\ncat \u003C\u003CEOF | kubectl apply -f -\napiVersion: v1\nkind: ServiceAccount\nmetadata:\n  name: myapp\n  namespace: myapp-prod\n---\napiVersion: rbac.authorization.k8s.io\u002Fv1\nkind: Role\nmetadata:\n  name: myapp-role\n  namespace: myapp-prod\nrules:\n- apiGroups: [\"\"]\n  resources: [\"configmaps\", \"secrets\"]\n  verbs: [\"get\", \"list\", \"watch\"]\n---\napiVersion: rbac.authorization.k8s.io\u002Fv1\nkind: RoleBinding\nmetadata:\n  name: myapp-rolebinding\n  namespace: myapp-prod\nsubjects:\n- kind: ServiceAccount\n  name: myapp\n  namespace: myapp-prod\nroleRef:\n  kind: Role\n  name: myapp-role\n  apiGroup: rbac.authorization.k8s.io\nEOF\n\n# Verify namespace setup\nkubectl get resourcequota -n myapp-prod\nkubectl get limitrange -n myapp-prod\nkubectl get sa -n myapp-prod\n```\n\n**Got:** Namespace created with resource quotas limiting compute and storage. LimitRange sets default CPU\u002Fmemory requests and limits. ServiceAccount configured with least-privilege RBAC.\n\n**If fail:** For quota errors, verify cluster has sufficient resources with `kubectl describe nodes`. For RBAC errors, check cluster-admin permissions with `kubectl auth can-i create role --namespace myapp-prod`. Use `kubectl describe` on rejected resources to see quota\u002Flimit violations.\n\n### Step 2: Configure Application Secrets and ConfigMaps\n\nExternalize configuration and sensitive data using ConfigMaps and Secrets.\n\n```bash\n# Create ConfigMap from literal values\nkubectl create configmap myapp-config \\\n  --namespace=myapp-prod \\\n  --from-literal=LOG_LEVEL=info \\\n  --from-literal=API_TIMEOUT=30s \\\n  --from-literal=FEATURE_FLAGS='{\"newUI\":true,\"betaAPI\":false}'\n\n# Create ConfigMap from file\ncat > app.properties \u003C\u003CEOF\ndatabase.pool.size=20\ncache.ttl=3600\nretry.attempts=3\nEOF\n\nkubectl create configmap myapp-properties \\\n  --namespace=myapp-prod \\\n  --from-file=app.properties\n\n# Create Secret for database credentials\nkubectl create secret generic myapp-db-secret \\\n  --namespace=myapp-prod \\\n  --from-literal=username=appuser \\\n  --from-literal=password='sup3rs3cr3t!' \\\n  --from-literal=connection-string='postgresql:\u002F\u002Fdb.example.com:5432\u002Fmyapp'\n\n# Create TLS secret for ingress\nkubectl create secret tls myapp-tls \\\n  --namespace=myapp-prod \\\n  --cert=path\u002Fto\u002Ftls.crt \\\n  --key=path\u002Fto\u002Ftls.key\n\n# Verify secrets\u002Fconfigmaps\nkubectl get configmap -n myapp-prod\nkubectl get secret -n myapp-prod\nkubectl describe configmap myapp-config -n myapp-prod\n```\n\nFor more complex configurations, use YAML manifests:\n\n```yaml\n# configmap.yaml\napiVersion: v1\nkind: ConfigMap\nmetadata:\n  name: myapp-config\n  namespace: myapp-prod\ndata:\n  nginx.conf: |\n    server {\n      listen 8080;\n      location \u002F {\n        proxy_pass http:\u002F\u002Fbackend:3000;\n        proxy_set_header Host $host;\n      }\n    }\n  app-config.json: |\n    {\n      \"logLevel\": \"info\",\n      \"features\": {\n        \"authentication\": true,\n        \"metrics\": true\n      }\n    }\n---\n# secret.yaml\napiVersion: v1\nkind: Secret\nmetadata:\n  name: myapp-secret\n  namespace: myapp-prod\ntype: Opaque\nstringData:  # Automatically base64 encoded\n  api-key: \"sk-1234567890abcdef\"\n  jwt-secret: \"my-jwt-signing-key\"\n```\n\n**Got:** ConfigMaps store non-sensitive configuration, Secrets store credentials\u002Fkeys. Values accessible to Pods via environment variables or volume mounts. TLS secrets properly formatted for Ingress resources.\n\n**If fail:** For encoding issues, use `stringData` instead of `data` in YAML. For TLS secret errors, verify certificate and key format with `openssl x509 -in tls.crt -text -noout`. For access issues, check ServiceAccount RBAC permissions. View decoded secret with `kubectl get secret myapp-secret -o jsonpath='{.data.api-key}' | base64 -d`.\n\n### Step 3: Create Deployment with Health Checks and Resource Limits\n\nDeploy application with production-ready configuration including probes and resource management.\n\n```yaml\n# deployment.yaml\napiVersion: apps\u002Fv1\nkind: Deployment\nmetadata:\n  name: myapp\n  namespace: myapp-prod\n  labels:\n    app: myapp\n    version: v1.0.0\nspec:\n  replicas: 3\n  strategy:\n    type: RollingUpdate\n    rollingUpdate:\n      maxSurge: 1\n      maxUnavailable: 0  # Zero-downtime updates\n  selector:\n    matchLabels:\n      app: myapp\n  template:\n    metadata:\n      labels:\n        app: myapp\n        version: v1.0.0\n      annotations:\n        prometheus.io\u002Fscrape: \"true\"\n        prometheus.io\u002Fport: \"8080\"\n        prometheus.io\u002Fpath: \"\u002Fmetrics\"\n    spec:\n      serviceAccountName: myapp\n      securityContext:\n        runAsNonRoot: true\n        runAsUser: 1000\n        fsGroup: 1000\n      containers:\n      - name: myapp\n        image: myregistry.io\u002Fmyapp:v1.0.0\n        imagePullPolicy: IfNotPresent\n        ports:\n        - name: http\n          containerPort: 8080\n          protocol: TCP\n        env:\n        - name: LOG_LEVEL\n          valueFrom:\n            configMapKeyRef:\n              name: myapp-config\n              key: LOG_LEVEL\n        - name: DB_USERNAME\n          valueFrom:\n            secretKeyRef:\n              name: myapp-db-secret\n              key: username\n        - name: DB_PASSWORD\n          valueFrom:\n            secretKeyRef:\n              name: myapp-db-secret\n              key: password\n        - name: POD_NAME\n          valueFrom:\n            fieldRef:\n              fieldPath: metadata.name\n        - name: POD_NAMESPACE\n          valueFrom:\n            fieldRef:\n              fieldPath: metadata.namespace\n        resources:\n          requests:\n            cpu: 250m\n            memory: 256Mi\n          limits:\n            cpu: 500m\n            memory: 512Mi\n        livenessProbe:\n          httpGet:\n            path: \u002Fhealthz\n            port: http\n          initialDelaySeconds: 30\n          periodSeconds: 10\n          timeoutSeconds: 5\n          failureThreshold: 3\n        readinessProbe:\n          httpGet:\n            path: \u002Fready\n            port: http\n          initialDelaySeconds: 5\n          periodSeconds: 5\n          timeoutSeconds: 3\n          failureThreshold: 2\n        startupProbe:\n          httpGet:\n            path: \u002Fhealthz\n            port: http\n          initialDelaySeconds: 0\n          periodSeconds: 10\n          timeoutSeconds: 3\n          failureThreshold: 30  # 5 minutes for slow startup\n        volumeMounts:\n        - name: config\n          mountPath: \u002Fetc\u002Fmyapp\n          readOnly: true\n        - name: cache\n          mountPath: \u002Fvar\u002Fcache\u002Fmyapp\n      volumes:\n      - name: config\n        configMap:\n          name: myapp-properties\n      - name: cache\n        emptyDir: {}\n      imagePullSecrets:\n      - name: registry-credentials\n```\n\nApply and monitor deployment:\n\n```bash\n# Apply deployment\nkubectl apply -f deployment.yaml\n\n# Watch rollout status\nkubectl rollout status deployment\u002Fmyapp -n myapp-prod\n\n# Check pod status\nkubectl get pods -n myapp-prod -l app=myapp\n\n# View pod logs\nkubectl logs -n myapp-prod -l app=myapp --tail=50 -f\n\n# Describe deployment for events\nkubectl describe deployment myapp -n myapp-prod\n\n# Check resource usage\nkubectl top pods -n myapp-prod -l app=myapp\n```\n\n**Got:** Deployment creates 3 replicas with rolling update strategy. Pods pass readiness probes before receiving traffic. Liveness probes restart unhealthy pods. Resource requests\u002Flimits prevent OOM kills. Logs show successful application startup.\n\n**If fail:** For ImagePullBackOff, verify image exists and imagePullSecret is valid with `kubectl get secret registry-credentials -o yaml`. For CrashLoopBackOff, check logs with `kubectl logs pod-name --previous`. For probe failures, test endpoints manually with `kubectl port-forward` and `curl localhost:8080\u002Fhealthz`. For OOMKilled pods, increase memory limits or investigate memory leaks.\n\n### Step 4: Expose Application with Services and Load Balancers\n\nCreate Service resources to expose applications internally and externally.\n\n```yaml\n# service.yaml\napiVersion: v1\nkind: Service\nmetadata:\n  name: myapp\n  namespace: myapp-prod\n# ... (see EXAMPLES.md for complete configuration)\n```\n\nApply and test services:\n\n```bash\n# Apply services\nkubectl apply -f service.yaml\n\n# Get service details\nkubectl get svc -n myapp-prod\n\n# ... (see EXAMPLES.md for complete configuration)\n```\n\n**Got:** LoadBalancer Service provisions external LB with public IP\u002Fhostname. ClusterIP Service provides stable internal DNS. Endpoints list shows healthy Pod IPs. Curl requests succeed with expected responses.\n\n**If fail:** For pending LoadBalancer, check cloud provider integration and quotas. For no endpoints, verify Pod labels match Service selector with `kubectl get pods --show-labels`. For connection refused, verify targetPort matches container port. Use `kubectl port-forward` to bypass Service layer for debugging.\n\n### Step 5: Configure Horizontal Pod Autoscaling\n\nImplement automatic scaling based on CPU\u002Fmemory or custom metrics.\n\n```yaml\n# hpa.yaml\napiVersion: autoscaling\u002Fv2\nkind: HorizontalPodAutoscaler\nmetadata:\n  name: myapp-hpa\n  namespace: myapp-prod\n# ... (see EXAMPLES.md for complete configuration)\n```\n\nInstall metrics-server if not available:\n\n```bash\n# Install metrics-server\nkubectl apply -f https:\u002F\u002Fgithub.com\u002Fkubernetes-sigs\u002Fmetrics-server\u002Freleases\u002Flatest\u002Fdownload\u002Fcomponents.yaml\n\n# Verify metrics-server\nkubectl get deployment metrics-server -n kube-system\nkubectl top nodes\n# ... (see EXAMPLES.md for complete configuration)\n```\n\n**Got:** HPA monitors CPU\u002Fmemory metrics. When thresholds exceeded, replicas scale up to maxReplicas. When load decreases, replicas scale down gradually (stabilization window prevents flapping). Metrics visible with `kubectl top`.\n\n**If fail:** For \"unknown\" metrics, verify metrics-server is running and Pods have resource requests defined. For no scaling, check current utilization is exceeding targets with `kubectl top pods`. For flapping, increase stabilizationWindowSeconds. For slow scale-up, reduce periodSeconds in scaleUp policies.\n\n### Step 6: Package Application with Helm Chart\n\nCreate reusable Helm chart for multi-environment deployments.\n\n```bash\n# Create Helm chart structure\nhelm create myapp-chart\ncd myapp-chart\n\n# Edit Chart.yaml\ncat > Chart.yaml \u003C\u003CEOF\n# ... (see EXAMPLES.md for complete configuration)\n```\n\n**Got:** Helm chart packages all Kubernetes resources with templated values. Dry-run shows rendered manifests. Install deploys all resources in correct order. Upgrades perform rolling updates. Rollback reverts to previous revision.\n\n**If fail:** For template errors, run `helm template .` to render locally without installing. For dependency issues, run `helm dependency update`. For value override failures, verify YAML path exists in values.yaml. Use `helm get manifest myapp -n myapp-prod` to see actual deployed resources.\n\n## Validation\n\n- [ ] Pods in Running state with all containers ready\n- [ ] Readiness probes pass before Pods added to Service endpoints\n- [ ] Liveness probes restart unhealthy containers automatically\n- [ ] Resource requests and limits prevent OOM kills and node overcommit\n- [ ] Secrets and ConfigMaps mounted correctly with expected values\n- [ ] Services resolve via DNS (cluster.local) from other Pods\n- [ ] LoadBalancer\u002FIngress accessible from external networks\n- [ ] HPA scales replicas up under load and down when idle\n- [ ] Rolling updates complete with zero downtime\n- [ ] Logs collected and accessible via kubectl logs or centralized logging\n\n## Pitfalls\n\n- **Missing readiness probes**: Pods receive traffic before fully started. Always implement readiness probes that verify application dependencies.\n\n- **Insufficient startup time**: Fast liveness probes kill slow-starting apps. Use startupProbe with generous failureThreshold for initialization.\n\n- **No resource limits**: Pods consume unlimited CPU\u002Fmemory causing node instability. Always set requests and limits.\n\n- **Hardcoded configuration**: Environment-specific values in manifests prevent reuse. Use ConfigMaps, Secrets, and Helm values.\n\n- **Default service account**: Pods have unnecessary cluster permissions. Create dedicated ServiceAccounts with minimal RBAC.\n\n- **No rolling update strategy**: Deployments recreate all Pods simultaneously causing downtime. Use RollingUpdate with maxUnavailable: 0.\n\n- **Secrets in version control**: Sensitive data committed to Git. Use sealed-secrets, external-secrets-operator, or vault.\n\n- **No pod disruption budget**: Cluster maintenance drains nodes and breaks service. Create PodDisruptionBudget to ensure minimum available replicas.\n\n## Related Skills\n\n- `setup-docker-compose` - Container orchestration fundamentals before Kubernetes\n- `containerize-mcp-server` - Creating container images for deployment\n- `write-helm-chart` - Advanced Helm chart development\n- `manage-kubernetes-secrets` - SealedSecrets and external-secrets-operator\n- `configure-ingress-networking` - NGINX Ingress and cert-manager setup\n- `implement-gitops-workflow` - ArgoCD\u002FFlux for declarative deployments\n- `setup-container-registry` - Image registry integration\n","# Deploy to Kubernetes\n\nDeploy containerized applications to Kubernetes with production-ready configurations including health checks, resource management, and automated rollouts.\n\n## When to Use\n\n- Deploying new applications to Kubernetes clusters (EKS, GKE, AKS, self-hosted)\n- Migrating from Docker Compose or traditional VMs to container orchestration\n- Implementing zero-downtime rolling updates and rollbacks\n- Managing application configuration and secrets in Kubernetes\n- Setting up multi-environment deployments (dev, staging, production)\n- Creating reusable Helm charts for application distribution\n\n## Inputs\n\n- **Required**: Kubernetes cluster access (`kubectl cluster-info`)\n- **Required**: Container images pushed to registry (Docker Hub, ECR, GCR, Harbor)\n- **Required**: Application requirements (ports, environment variables, volumes)\n- **Optional**: TLS certificates for HTTPS ingress\n- **Optional**: Persistent storage requirements (StatefulSets, PVCs)\n- **Optional**: Helm CLI for chart-based deployments\n\n## Procedure\n\n> See [Extended Examples](references\u002FEXAMPLES.md) for complete configuration files and templates.\n\n\n### Step 1: Create Namespace and Resource Quotas\n\nOrganize applications into namespaces with resource limits and RBAC.\n\n```bash\n# Create namespace\nkubectl create namespace myapp-prod\n\n# Apply resource quota\ncat \u003C\u003CEOF | kubectl apply -f -\napiVersion: v1\nkind: ResourceQuota\nmetadata:\n  name: compute-quota\n  namespace: myapp-prod\nspec:\n  hard:\n    requests.cpu: \"10\"\n    requests.memory: \"20Gi\"\n    limits.cpu: \"20\"\n    limits.memory: \"40Gi\"\n    persistentvolumeclaims: \"5\"\n    services.loadbalancers: \"2\"\n---\napiVersion: v1\nkind: LimitRange\nmetadata:\n  name: default-limits\n  namespace: myapp-prod\nspec:\n  limits:\n  - default:\n      cpu: \"500m\"\n      memory: \"512Mi\"\n    defaultRequest:\n      cpu: \"100m\"\n      memory: \"128Mi\"\n    type: Container\nEOF\n\n# Create service account\ncat \u003C\u003CEOF | kubectl apply -f -\napiVersion: v1\nkind: ServiceAccount\nmetadata:\n  name: myapp\n  namespace: myapp-prod\n---\napiVersion: rbac.authorization.k8s.io\u002Fv1\nkind: Role\nmetadata:\n  name: myapp-role\n  namespace: myapp-prod\nrules:\n- apiGroups: [\"\"]\n  resources: [\"configmaps\", \"secrets\"]\n  verbs: [\"get\", \"list\", \"watch\"]\n---\napiVersion: rbac.authorization.k8s.io\u002Fv1\nkind: RoleBinding\nmetadata:\n  name: myapp-rolebinding\n  namespace: myapp-prod\nsubjects:\n- kind: ServiceAccount\n  name: myapp\n  namespace: myapp-prod\nroleRef:\n  kind: Role\n  name: myapp-role\n  apiGroup: rbac.authorization.k8s.io\nEOF\n\n# Verify namespace setup\nkubectl get resourcequota -n myapp-prod\nkubectl get limitrange -n myapp-prod\nkubectl get sa -n myapp-prod\n```\n\n**Got:** Namespace created with resource quotas limiting compute and storage. LimitRange sets default CPU\u002Fmemory requests and limits. ServiceAccount configured with least-privilege RBAC.\n\n**If fail:** For quota errors, verify cluster has sufficient resources with `kubectl describe nodes`. For RBAC errors, check cluster-admin permissions with `kubectl auth can-i create role --namespace myapp-prod`. Use `kubectl describe` on rejected resources to see quota\u002Flimit violations.\n\n### Step 2: Configure Application Secrets and ConfigMaps\n\nExternalize configuration and sensitive data using ConfigMaps and Secrets.\n\n```bash\n# Create ConfigMap from literal values\nkubectl create configmap myapp-config \\\n  --namespace=myapp-prod \\\n  --from-literal=LOG_LEVEL=info \\\n  --from-literal=API_TIMEOUT=30s \\\n  --from-literal=FEATURE_FLAGS='{\"newUI\":true,\"betaAPI\":false}'\n\n# Create ConfigMap from file\ncat > app.properties \u003C\u003CEOF\ndatabase.pool.size=20\ncache.ttl=3600\nretry.attempts=3\nEOF\n\nkubectl create configmap myapp-properties \\\n  --namespace=myapp-prod \\\n  --from-file=app.properties\n\n# Create Secret for database credentials\nkubectl create secret generic myapp-db-secret \\\n  --namespace=myapp-prod \\\n  --from-literal=username=appuser \\\n  --from-literal=password='sup3rs3cr3t!' \\\n  --from-literal=connection-string='postgresql:\u002F\u002Fdb.example.com:5432\u002Fmyapp'\n\n# Create TLS secret for ingress\nkubectl create secret tls myapp-tls \\\n  --namespace=myapp-prod \\\n  --cert=path\u002Fto\u002Ftls.crt \\\n  --key=path\u002Fto\u002Ftls.key\n\n# Verify secrets\u002Fconfigmaps\nkubectl get configmap -n myapp-prod\nkubectl get secret -n myapp-prod\nkubectl describe configmap myapp-config -n myapp-prod\n```\n\nFor more complex configurations, use YAML manifests:\n\n```yaml\n# configmap.yaml\napiVersion: v1\nkind: ConfigMap\nmetadata:\n  name: myapp-config\n  namespace: myapp-prod\ndata:\n  nginx.conf: |\n    server {\n      listen 8080;\n      location \u002F {\n        proxy_pass http:\u002F\u002Fbackend:3000;\n        proxy_set_header Host $host;\n      }\n    }\n  app-config.json: |\n    {\n      \"logLevel\": \"info\",\n      \"features\": {\n        \"authentication\": true,\n        \"metrics\": true\n      }\n    }\n---\n# secret.yaml\napiVersion: v1\nkind: Secret\nmetadata:\n  name: myapp-secret\n  namespace: myapp-prod\ntype: Opaque\nstringData:  # Automatically base64 encoded\n  api-key: \"sk-1234567890abcdef\"\n  jwt-secret: \"my-jwt-signing-key\"\n```\n\n**Got:** ConfigMaps store non-sensitive configuration, Secrets store credentials\u002Fkeys. Values accessible to Pods via environment variables or volume mounts. TLS secrets properly formatted for Ingress resources.\n\n**If fail:** For encoding issues, use `stringData` instead of `data` in YAML. For TLS secret errors, verify certificate and key format with `openssl x509 -in tls.crt -text -noout`. For access issues, check ServiceAccount RBAC permissions. View decoded secret with `kubectl get secret myapp-secret -o jsonpath='{.data.api-key}' | base64 -d`.\n\n### Step 3: Create Deployment with Health Checks and Resource Limits\n\nDeploy application with production-ready configuration including probes and resource management.\n\n```yaml\n# deployment.yaml\napiVersion: apps\u002Fv1\nkind: Deployment\nmetadata:\n  name: myapp\n  namespace: myapp-prod\n  labels:\n    app: myapp\n    version: v1.0.0\nspec:\n  replicas: 3\n  strategy:\n    type: RollingUpdate\n    rollingUpdate:\n      maxSurge: 1\n      maxUnavailable: 0  # Zero-downtime updates\n  selector:\n    matchLabels:\n      app: myapp\n  template:\n    metadata:\n      labels:\n        app: myapp\n        version: v1.0.0\n      annotations:\n        prometheus.io\u002Fscrape: \"true\"\n        prometheus.io\u002Fport: \"8080\"\n        prometheus.io\u002Fpath: \"\u002Fmetrics\"\n    spec:\n      serviceAccountName: myapp\n      securityContext:\n        runAsNonRoot: true\n        runAsUser: 1000\n        fsGroup: 1000\n      containers:\n      - name: myapp\n        image: myregistry.io\u002Fmyapp:v1.0.0\n        imagePullPolicy: IfNotPresent\n        ports:\n        - name: http\n          containerPort: 8080\n          protocol: TCP\n        env:\n        - name: LOG_LEVEL\n          valueFrom:\n            configMapKeyRef:\n              name: myapp-config\n              key: LOG_LEVEL\n        - name: DB_USERNAME\n          valueFrom:\n            secretKeyRef:\n              name: myapp-db-secret\n              key: username\n        - name: DB_PASSWORD\n          valueFrom:\n            secretKeyRef:\n              name: myapp-db-secret\n              key: password\n        - name: POD_NAME\n          valueFrom:\n            fieldRef:\n              fieldPath: metadata.name\n        - name: POD_NAMESPACE\n          valueFrom:\n            fieldRef:\n              fieldPath: metadata.namespace\n        resources:\n          requests:\n            cpu: 250m\n            memory: 256Mi\n          limits:\n            cpu: 500m\n            memory: 512Mi\n        livenessProbe:\n          httpGet:\n            path: \u002Fhealthz\n            port: http\n          initialDelaySeconds: 30\n          periodSeconds: 10\n          timeoutSeconds: 5\n          failureThreshold: 3\n        readinessProbe:\n          httpGet:\n            path: \u002Fready\n            port: http\n          initialDelaySeconds: 5\n          periodSeconds: 5\n          timeoutSeconds: 3\n          failureThreshold: 2\n        startupProbe:\n          httpGet:\n            path: \u002Fhealthz\n            port: http\n          initialDelaySeconds: 0\n          periodSeconds: 10\n          timeoutSeconds: 3\n          failureThreshold: 30  # 5 minutes for slow startup\n        volumeMounts:\n        - name: config\n          mountPath: \u002Fetc\u002Fmyapp\n          readOnly: true\n        - name: cache\n          mountPath: \u002Fvar\u002Fcache\u002Fmyapp\n      volumes:\n      - name: config\n        configMap:\n          name: myapp-properties\n      - name: cache\n        emptyDir: {}\n      imagePullSecrets:\n      - name: registry-credentials\n```\n\nApply and monitor deployment:\n\n```bash\n# Apply deployment\nkubectl apply -f deployment.yaml\n\n# Watch rollout status\nkubectl rollout status deployment\u002Fmyapp -n myapp-prod\n\n# Check pod status\nkubectl get pods -n myapp-prod -l app=myapp\n\n# View pod logs\nkubectl logs -n myapp-prod -l app=myapp --tail=50 -f\n\n# Describe deployment for events\nkubectl describe deployment myapp -n myapp-prod\n\n# Check resource usage\nkubectl top pods -n myapp-prod -l app=myapp\n```\n\n**Got:** Deployment creates 3 replicas with rolling update strategy. Pods pass readiness probes before receiving traffic. Liveness probes restart unhealthy pods. Resource requests\u002Flimits prevent OOM kills. Logs show successful application startup.\n\n**If fail:** For ImagePullBackOff, verify image exists and imagePullSecret is valid with `kubectl get secret registry-credentials -o yaml`. For CrashLoopBackOff, check logs with `kubectl logs pod-name --previous`. For probe failures, test endpoints manually with `kubectl port-forward` and `curl localhost:8080\u002Fhealthz`. For OOMKilled pods, increase memory limits or investigate memory leaks.\n\n### Step 4: Expose Application with Services and Load Balancers\n\nCreate Service resources to expose applications internally and externally.\n\n```yaml\n# service.yaml\napiVersion: v1\nkind: Service\nmetadata:\n  name: myapp\n  namespace: myapp-prod\n# ... (see EXAMPLES.md for complete configuration)\n```\n\nApply and test services:\n\n```bash\n# Apply services\nkubectl apply -f service.yaml\n\n# Get service details\nkubectl get svc -n myapp-prod\n\n# ... (see EXAMPLES.md for complete configuration)\n```\n\n**Got:** LoadBalancer Service provisions external LB with public IP\u002Fhostname. ClusterIP Service provides stable internal DNS. Endpoints list shows healthy Pod IPs. Curl requests succeed with expected responses.\n\n**If fail:** For pending LoadBalancer, check cloud provider integration and quotas. For no endpoints, verify Pod labels match Service selector with `kubectl get pods --show-labels`. For connection refused, verify targetPort matches container port. Use `kubectl port-forward` to bypass Service layer for debugging.\n\n### Step 5: Configure Horizontal Pod Autoscaling\n\nImplement automatic scaling based on CPU\u002Fmemory or custom metrics.\n\n```yaml\n# hpa.yaml\napiVersion: autoscaling\u002Fv2\nkind: HorizontalPodAutoscaler\nmetadata:\n  name: myapp-hpa\n  namespace: myapp-prod\n# ... (see EXAMPLES.md for complete configuration)\n```\n\nInstall metrics-server if not available:\n\n```bash\n# Install metrics-server\nkubectl apply -f https:\u002F\u002Fgithub.com\u002Fkubernetes-sigs\u002Fmetrics-server\u002Freleases\u002Flatest\u002Fdownload\u002Fcomponents.yaml\n\n# Verify metrics-server\nkubectl get deployment metrics-server -n kube-system\nkubectl top nodes\n# ... (see EXAMPLES.md for complete configuration)\n```\n\n**Got:** HPA monitors CPU\u002Fmemory metrics. When thresholds exceeded, replicas scale up to maxReplicas. When load decreases, replicas scale down gradually (stabilization window prevents flapping). Metrics visible with `kubectl top`.\n\n**If fail:** For \"unknown\" metrics, verify metrics-server is running and Pods have resource requests defined. For no scaling, check current utilization is exceeding targets with `kubectl top pods`. For flapping, increase stabilizationWindowSeconds. For slow scale-up, reduce periodSeconds in scaleUp policies.\n\n### Step 6: Package Application with Helm Chart\n\nCreate reusable Helm chart for multi-environment deployments.\n\n```bash\n# Create Helm chart structure\nhelm create myapp-chart\ncd myapp-chart\n\n# Edit Chart.yaml\ncat > Chart.yaml \u003C\u003CEOF\n# ... (see EXAMPLES.md for complete configuration)\n```\n\n**Got:** Helm chart packages all Kubernetes resources with templated values. Dry-run shows rendered manifests. Install deploys all resources in correct order. Upgrades perform rolling updates. Rollback reverts to previous revision.\n\n**If fail:** For template errors, run `helm template .` to render locally without installing. For dependency issues, run `helm dependency update`. For value override failures, verify YAML path exists in values.yaml. Use `helm get manifest myapp -n myapp-prod` to see actual deployed resources.\n\n## Validation\n\n- [ ] Pods in Running state with all containers ready\n- [ ] Readiness probes pass before Pods added to Service endpoints\n- [ ] Liveness probes restart unhealthy containers automatically\n- [ ] Resource requests and limits prevent OOM kills and node overcommit\n- [ ] Secrets and ConfigMaps mounted correctly with expected values\n- [ ] Services resolve via DNS (cluster.local) from other Pods\n- [ ] LoadBalancer\u002FIngress accessible from external networks\n- [ ] HPA scales replicas up under load and down when idle\n- [ ] Rolling updates complete with zero downtime\n- [ ] Logs collected and accessible via kubectl logs or centralized logging\n\n## Pitfalls\n\n- **Missing readiness probes**: Pods receive traffic before fully started. Always implement readiness probes that verify application dependencies.\n\n- **Insufficient startup time**: Fast liveness probes kill slow-starting apps. Use startupProbe with generous failureThreshold for initialization.\n\n- **No resource limits**: Pods consume unlimited CPU\u002Fmemory causing node instability. Always set requests and limits.\n\n- **Hardcoded configuration**: Environment-specific values in manifests prevent reuse. Use ConfigMaps, Secrets, and Helm values.\n\n- **Default service account**: Pods have unnecessary cluster permissions. Create dedicated ServiceAccounts with minimal RBAC.\n\n- **No rolling update strategy**: Deployments recreate all Pods simultaneously causing downtime. Use RollingUpdate with maxUnavailable: 0.\n\n- **Secrets in version control**: Sensitive data committed to Git. Use sealed-secrets, external-secrets-operator, or vault.\n\n- **No pod disruption budget**: Cluster maintenance drains nodes and breaks service. Create PodDisruptionBudget to ensure minimum available replicas.\n\n## Related Skills\n\n- `setup-docker-compose` - Container orchestration fundamentals before Kubernetes\n- `containerize-mcp-server` - Creating container images for deployment\n- `write-helm-chart` - Advanced Helm chart development\n- `manage-kubernetes-secrets` - SealedSecrets and external-secrets-operator\n- `configure-ingress-networking` - NGINX Ingress and cert-manager setup\n- `implement-gitops-workflow` - ArgoCD\u002FFlux for declarative deployments\n- `setup-container-registry` - Image registry integration\n",{"name":5,"locale":23,"license":14,"metadata":24,"translator":31,"description":32,"allowed-tools":33,"source_commit":34,"source_locale":35,"translation_date":36},"caveman-lite",{"tags":25,"author":26,"domain":27,"version":28,"language":29,"complexity":30},"kubernetes, k8s, kubectl, deployment, service","Philipp Thoss","devops","1.0","multi","intermediate","Julius Brussee homage — caveman","Deploy applications to Kubernetes clusters using kubectl manifests for Deployments, Services, ConfigMaps, Secrets, and Ingress resources. Implement health checks, resource limits, rolling updates, and Helm chart packaging for production deployments. Use when deploying new applications to EKS, GKE, AKS, or self-hosted clusters, migrating from Docker Compose to container orchestration, implementing zero-downtime rolling updates, or setting up multi-environment deployments across dev, staging, and production.\n","Read Write Edit Bash Grep Glob","82c77053","en","2026-04-23","master","f483e54f3ad5f202a77d45f2e57f8d970b71195f","skills_library\u002Fdeploy-to-kubernetes",2,"https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills","https:\u002F\u002Fgithub.com\u002Froohe","yoou.link","2026-05-19 15:56:07",{"source":8,"skillName":5,"commands":46,"prompt":56,"zipAvailable":57},[47,50,53],{"tool":48,"command":49},"npx","npx skills add roohe\u002Fagentic-super-skills --skill deploy-to-kubernetes",{"tool":51,"command":52},"bunx","bunx skills add roohe\u002Fagentic-super-skills --skill deploy-to-kubernetes",{"tool":54,"command":55},"pnpm","pnpm dlx skills add roohe\u002Fagentic-super-skills --skill deploy-to-kubernetes","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Fdeploy-to-kubernetes\u002FSKILL.md",true,[59],{"path":60,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":63,"sourceHtmlUrl":64},"references\u002FEXAMPLES.md","REFERENCE","参考文档",11694,"https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Fdeploy-to-kubernetes\u002Freferences\u002FEXAMPLES.md",[66,73,80,87,94,101],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":18},"01M73D865CZME2FCMKA4PQM348","zarr-python","Chunked N-D arrays for cloud storage. Compressed arrays, parallel I\u002FO, S3\u002FGCS integration, NumPy\u002FDask\u002FXarray compatible, for large-scale scientific computing pipelines.","https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Fzarr-python\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":18},"01M73D7Z64J4ABWZJD7P44XBBF","youtube-downloader","Download and process YouTube content for research. Use when: downloading competitor videos for analysis; extracting audio for podcasts; getting transcripts for content repurposing; archiving webinars; research content curation","https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Fyoutube-downloader\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":18},"01M73D7K8778TGZV3GJFR3703D","yc-pitch-deck","Create a compelling startup pitch deck that follows the structure proven to raise billions from top investors. Master the YC and Sequoia formats that get founders funded. Use when: **Fundraising** to create investor pitch decks; **YC application** to structure your narrative; **Demo Day prep** to craft your 2-minute pitch; **Angel investors** to communicate your opportunity; **Partnership pitches** to structure compelling asks","https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Fyc-pitch-deck\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":18},"01M73D70KJSE0E8Z28YMNNRT04","x-twitter-scraper","Use when the user needs X (Twitter) data or confirmation-gated X actions through Xquik: tweet search, user lookup, follower extraction, media download, monitoring, webhooks, MCP, SDKs, posting, likes, DMs, and profile updates. Requires a Xquik API key. Never ask for X login material.","https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Fx-twitter-scraper\u002FSKILL.md",[],[],{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":18},"01M73D6ED01GV077R7K4NZNFZJ","write-vignette","Create R package vignettes using R Markdown or Quarto. Covers vignette setup, YAML configuration, code chunk options, building and testing, and CRAN requirements for vignettes. Use when adding a Getting Started tutorial, documenting complex workflows spanning multiple functions, creating domain-specific guides, or when CRAN submission requires user-facing documentation beyond function help pages.","https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Fwrite-vignette\u002FSKILL.md",[],[],{"skillNo":102,"name":103,"nameZh":6,"description":104,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":18},"01M73D69YJR0BK3NFHE0CYG3EF","write-validation-documentation","Write IQ\u002FOQ\u002FPQ validation documentation for computerized systems in regulated environments. Covers protocols, reports, test scripts, deviation handling, and approval workflows. Use when validating R or other software for regulated use, preparing for a regulatory audit, documenting qualification of computing environments, or creating and updating validation protocols and reports for new or re-qualified systems.","https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Fwrite-validation-documentation\u002FSKILL.md",[],[]]