Introduction
This post contains a collection of common Argo workflow and Kubernetes commands that I’ve used in my work. These commands are organized by category for easy reference.
Argo Setup and Installation
Initial Setup
## Create Argo namespace
kubectl create ns argo
## Apply Argo manifests with PostgreSQL
kubectl apply -n argo -f https://raw.githubusercontent.com/argoproj/argo/stable/manifests/quick-start-postgres.yaml
## Create cluster role binding
kubectl create clusterrolebinding mkang-cluster-admin-binding --clusterrole=cluster-admin [email protected]
## Port forward Argo server
kubectl -n argo port-forward deployment/argo-server 2746:2746
Workflow Management
## List all workflows
kubectl get wf
## List workflows for specific user
kubectl get wf | grep mkang
Kubernetes Resource Management
Pod Management
## List pods with wide output
kubectl get pods --wide
## Get pod details
kubectl describe pod <pod-name>
## Get pod logs
kubectl logs <pod-name>
## Get pod YAML
kubectl get pod <pod-name> -o yaml
Deployment Management
## Scale deployments
kubectl scale deployment <deployment-name> --replicas <number>
## Delete deployments
kubectl delete deployment <deployment-name>
## Describe deployments
kubectl describe deployment <deployment-name>
StatefulSet Management
## List statefulsets
kubectl get statefulsets
## Scale statefulsets
kubectl scale statefulset <statefulset-name> --replicas <number>
## Delete statefulsets
kubectl delete statefulset <statefulset-name>
Node Management
## List nodes
kubectl get nodes
## Describe node
kubectl describe node <node-name>
## Get node information
kubectl get no <node-name>
Resource Monitoring
## Get pod resource usage
kubectl top pod <pod-name>
## Get node resource usage
kubectl top nodes
## Get cluster information
kubectl cluster-info
Secret and ConfigMap Management
## Get secrets
kubectl get secrets
## Get secret details
kubectl get secrets <secret-name> -o json
## Get configmaps
kubectl get configmap <configmap-name>
## Get configmap details
kubectl get configmap <configmap-name> -o yaml
Service Account and Role Management
## List service accounts
kubectl get serviceaccount
## List cluster roles
kubectl --namespace kube-system get clusterrole
## Delete roles
kubectl delete role <role-name>
## Delete service accounts
kubectl delete serviceaccount <serviceaccount-name>
Common Troubleshooting Commands
## Get events
kubectl get events
## Get pod logs with follow
kubectl logs -f <pod-name>
## Get pod details in YAML format
kubectl describe pod <pod-name> -o yaml
## Check API versions
kubectl api-versions
Cleanup Commands
## Delete multiple resources
kubectl delete deployment,service,ingress <resource-name>
## Delete resources by label
kubectl delete all -l app=<label-name>
## Delete namespace and all resources
kubectl delete namespace <namespace-name>