Kubernetes operations automation for Platxa platform. Debug instances, manage clusters, scale deployments, and perform infrastructure operations with guided workflows.
Automated Kubernetes operations for the Platxa platform with guided debugging workflows.
This skill provides operational commands for managing Platxa's Kubernetes infrastructure:
| Category | Operations |
|---|---|
| Cluster | Setup, health check, node status |
| Instance | Status, logs, events, scale, wake, shell |
| Helm | Diff, sync, release status |
| Debug | Pod, network, storage, ingress diagnostics |
| Monitor | Service health, resource usage, alerts |
Required tools (verify with which <tool>):
kubectl - Kubernetes CLI (configured with cluster access)helm - Helm package managerhelmfile - Declarative Helm releasesVerify cluster connectivity:
kubectl cluster-info
kubectl get nodes
| Operation | Command | Description |
|---|---|---|
| Setup Kind | ./install.sh kind |
Install local Kind cluster |
| Setup DOKS | ./install.sh doks |
Install DOKS production cluster |
| Health Check | kubectl get pods -A |
Check all pod statuses |
| Node Status | kubectl get nodes -o wide |
List nodes with resources |
| Operation | Command | Description |
|---|---|---|
| List All | kubectl get ns -l platxa.io/tier=instance |
List instance namespaces |
| Status | kubectl get all -n instance-{name} |
Instance resources |
| Logs | kubectl logs -n instance-{name} -l app=odoo --tail=100 |
View logs |
| Events | kubectl get events -n instance-{name} --sort-by='.lastTimestamp' |
Recent events |
| Scale Up | kubectl scale deploy odoo-{name} -n instance-{name} --replicas=1 |
Wake instance |
| Scale Down | kubectl scale deploy odoo-{name} -n instance-{name} --replicas=0 |
Sleep instance |
| Shell | kubectl exec -n instance-{name} -it deploy/odoo-{name} -- /bin/bash |
Access pod |
| Operation | Command | Description |
|---|---|---|
| Helm Diff | helmfile -e kind diff |
Preview changes |
| Helm Sync | helmfile -e kind sync |
Apply releases |
| Release Status | helm list -A |
All Helm releases |
When a user requests K8s operations, follow this workflow:
Detect intent from user message:
Before executing commands:
kubectl config current-contextkubectl get ns <namespace>Run appropriate commands from Operations Reference above. Always show the command before executing for transparency.
Interpret output and identify:
Based on findings:
User: "The abc123xy instance isn't loading"
Response:
Checking instance status...
kubectl get all -n instance-abc123xy
# Output: deployment replicas=0
The instance is scaled to zero (sleeping). Waking it up:
kubectl scale deploy odoo-abc123xy -n instance-abc123xy --replicas=1
kubectl wait --for=condition=available deploy/odoo-abc123xy -n instance-abc123xy --timeout=120s
Instance is now running. Access at: https://abc123xy.platxa.com
User: "Is the cluster healthy before I deploy?"
Response:
Running cluster health check...
Nodes:
kubectl get nodes
# All nodes Ready ✓
Core Services:
kubectl get pods -n traefik-system
kubectl get pods -n postgres-system
kubectl get pods -n monitoring
# All pods Running ✓
Resource Availability:
kubectl top nodes
# CPU/Memory within limits ✓
Cluster is healthy. Safe to proceed with deployment.
Preview changes with: helmfile -e kind diff
User: "Instance demo keeps restarting"
Response:
Investigating crash loop...
Pod Status:
kubectl get pods -n instance-demo -l app=odoo
# STATUS: CrashLoopBackOff, Restarts: 5
Recent Events:
kubectl get events -n instance-demo --sort-by='.lastTimestamp' | head -20
# Event: OOMKilled
Container Logs (last crash):
kubectl logs -n instance-demo -l app=odoo --previous --tail=50
# Error: Cannot allocate memory
Root Cause: Out of Memory (OOMKilled)
Fix Options:
1. Increase memory limit in instance tier
2. Reduce Odoo workers: kubectl edit configmap odoo-config -n instance-demo
3. Check for memory leaks in custom addons
User: "Update the Traefik ingress controller"
Response:
Previewing Traefik update...
helmfile -e kind -l name=traefik diff
Changes:
- image: traefik:v2.10.5 -> traefik:v2.11.0
- Added new middleware configuration
Ready to apply? Running sync:
helmfile -e kind -l name=traefik sync
Verifying deployment:
kubectl rollout status deploy/traefik -n traefik-system
Traefik updated successfully. All ingress routes operational.
Symptom: Unable to connect to the server
Causes:
Fix:
# Kind: Restart cluster
kind get clusters
kind export kubeconfig --name platxa
# DOKS: Refresh credentials
doctl kubernetes cluster kubeconfig save <cluster-id>
Symptom: forbidden: User cannot <action>
Causes:
Fix: Check and apply RBAC:
kubectl auth can-i <verb> <resource> -n <namespace>
# If denied, apply appropriate RoleBinding
Symptom: NotFound: <resource> not found
Causes:
Fix: Verify resource exists:
kubectl get <resource-type> -A | grep <name>
kubectl get ns | grep instance
Symptom: Pod in Pending state
Causes:
Fix:
kubectl describe pod <pod> -n <namespace>
# Check Events section for scheduling failure reason
get, describe, logs, events - No cluster changesdiff - Preview only, no applyscale - Changes replica countsync - Applies Helm releasesdelete - Removes resourceskubectl delete ns - Deletes entire namespacehelmfile destroy - Removes all releaseskubectl drain - Evicts all pods from nodeAlways preview changes with diff before sync.
Never run destructive commands without explicit user confirmation.
After completing an operation, verify: