<< All versions
Skill v1.0.1
currentAutomated scan100/1001mangesh1/dev-skills-collection/kubernetes
8 files
──Details
PublishedOctober 25, 2026 at 09:47 PM
Content Hashsha256:cf1a1c5356644ca0...
Git SHA23e297e5a4df
Bump Typepatch
──Files
Files (1 file, 5.4 KB)
SKILL.md5.4 KBactive
SKILL.md · 264 lines · 5.4 KB
version: "1.0.1" name: kubernetes description: Kubernetes and kubectl mastery for deployments, services, pods, debugging, and cluster management. Use when user asks to "deploy to k8s", "create deployment", "debug pod", "kubectl commands", "scale service", "check pod logs", "create ingress", or any Kubernetes tasks.
Kubernetes
Essential kubectl commands and Kubernetes patterns.
Context & Namespace
bash
# View contextskubectl config get-contextskubectl config current-context# Switch contextkubectl config use-context production# Set default namespacekubectl config set-context --current --namespace=my-app# Use namespace in commandkubectl get pods -n kube-systemkubectl get pods --all-namespaces # or -A
Pods
bash
# List podskubectl get podskubectl get pods -o wide # More detailskubectl get pods -w # Watch modekubectl get pods --show-labelskubectl get pods -l app=web # By label# Pod detailskubectl describe pod my-podkubectl get pod my-pod -o yaml# Logskubectl logs my-podkubectl logs my-pod -f # Followkubectl logs my-pod --tail=100kubectl logs my-pod -c my-container # Specific containerkubectl logs my-pod --previous # Previous crash# Exec into podkubectl exec -it my-pod -- /bin/shkubectl exec -it my-pod -c my-container -- bash# Port forwardkubectl port-forward my-pod 8080:80kubectl port-forward svc/my-service 8080:80# Copy fileskubectl cp my-pod:/app/file.txt ./file.txtkubectl cp ./file.txt my-pod:/app/# Deletekubectl delete pod my-podkubectl delete pod my-pod --grace-period=0 --force
Deployments
bash
# Create deploymentkubectl create deployment web --image=nginx:latest --replicas=3# Listkubectl get deploymentskubectl get deploy# Scalekubectl scale deployment web --replicas=5# Update imagekubectl set image deployment/web nginx=nginx:1.25# Rollout statuskubectl rollout status deployment/web# Rollbackkubectl rollout undo deployment/webkubectl rollout undo deployment/web --to-revision=2# Historykubectl rollout history deployment/web# Restart (rolling)kubectl rollout restart deployment/web
Deployment YAML
yaml
apiVersion: apps/v1kind: Deploymentmetadata:name: weblabels:app: webspec:replicas: 3selector:matchLabels:app: webtemplate:metadata:labels:app: webspec:containers:- name: webimage: nginx:1.25ports:- containerPort: 80resources:requests:cpu: 100mmemory: 128Milimits:cpu: 500mmemory: 256MilivenessProbe:httpGet:path: /healthport: 80initialDelaySeconds: 10periodSeconds: 30readinessProbe:httpGet:path: /readyport: 80initialDelaySeconds: 5periodSeconds: 10env:- name: NODE_ENVvalue: "production"- name: DB_PASSWORDvalueFrom:secretKeyRef:name: db-secretkey: password
Services
yaml
# ClusterIP (internal)apiVersion: v1kind: Servicemetadata:name: webspec:selector:app: webports:- port: 80targetPort: 8080---# LoadBalancer (external)apiVersion: v1kind: Servicemetadata:name: web-publicspec:type: LoadBalancerselector:app: webports:- port: 80targetPort: 8080---# NodePortapiVersion: v1kind: Servicemetadata:name: web-nodeportspec:type: NodePortselector:app: webports:- port: 80targetPort: 8080nodePort: 30080
bash
# Quick exposekubectl expose deployment web --port=80 --target-port=8080kubectl expose deployment web --type=LoadBalancer --port=80# List serviceskubectl get svckubectl describe svc web
ConfigMaps & Secrets
bash
# ConfigMapkubectl create configmap app-config --from-literal=key=valuekubectl create configmap app-config --from-file=config.yaml# Secretkubectl create secret generic db-creds \--from-literal=username=admin \--from-literal=password=secret123# Viewkubectl get configmap app-config -o yamlkubectl get secret db-creds -o jsonpath='{.data.password}' | base64 -d
Apply & Delete
bash
# Apply manifestkubectl apply -f deployment.yamlkubectl apply -f ./k8s/ # All files in directorykubectl apply -f https://example.com/manifest.yaml# Deletekubectl delete -f deployment.yamlkubectl delete deployment webkubectl delete all -l app=web # By label# Dry runkubectl apply -f deployment.yaml --dry-run=clientkubectl apply -f deployment.yaml --dry-run=server
Debugging Quick Reference
bash
# Pod not starting?kubectl describe pod my-pod # Check Events sectionkubectl get events --sort-by='.lastTimestamp'# CrashLoopBackOff?kubectl logs my-pod --previous # Logs from crashed container# Can't connect to service?kubectl get endpoints my-service # Check if endpoints existkubectl run debug --rm -it --image=busybox -- wget -qO- http://my-service# Resource issues?kubectl top podskubectl top nodeskubectl describe node <node-name> # Check Allocatable vs Allocated
Reference
For debugging patterns: references/debugging.md For YAML templates: references/manifests.md