Skip to main content

Useful Commands

Useful commands to help you get comfortable using Kubernetes on CoreWeave Cloud

Kubernetes is harder to pronounce than it is to use. If you've never used it before, you'll be comfortable deploying your Docker containers on CoreWeave Cloud in no time.

We've put the following command reference together to help you perform simple tasks as you get better acquainted.

Additional resources

Refer to the Kubernetes official documentation for more in-depth explanations of these commands.

Apply and edit manifests

kubectl apply -f [manifest.yaml] # Apply a manifest to deploy a resource or apply changes by overwriting an existing manifest
kubectl edit [resource_type] [resource_name/id] # Edit the manifest of a resource using a text editor

Status commands

# General syntax
kubectl get [resource_type]

# Deployments
kubectl get deployments # Shows all running Deployments
kubectl get deployment [deployment-name] # Shows a specific Deployment

# Services
kubectl get services # Shows all services in the current Namespace
kubectl get services # ...sorted by name
kubectl get services --namespace [namespace] # a specific Namespace

# PVCs
kubectl get pvc # Show active Persistent Volume Claims (Storage Volumes)

# Virtual Servers
kubectl get vs

# Pods
kubectl get pods # Shows all Pods in the current Namespace
kubectl get pods -o wide # ...with more information
kubectl get pods --namespace [namespace] # a specific Namespace

# The number of CPUs, GPUs, and memory requested by each Pod.
# Note: This assumes jq is installed.
kubectl get pods -o json | jq '.items[] | {name:, cpu: .spec.containers[].resources.requests.cpu, gpu: .spec.containers[].resources.requests."", memory: .spec.containers[].resources.requests.memory}'

Describe Pods and get logs

# General syntax
kubectl describe [resource_type] [resource_name/id]

# Pods
kubectl describe pods # Shows detailed information about all Pods
kubectl describe pod [pod_id] # ...about a specific Pod
kubectl describe pod [pod_id] -o yaml # ...about a specific Pod, in YAML format

# Logs
kubectl logs -f [pod_id] # Gets streaming logs of a pod

Delete resources

kubectl delete [resource_type] [resource_name/id]
kubectl delete pod [pod_id] # Deletes a pod, deployment will start a new one
kubectl delete deployment [deployment_name] # Deletes a deployment, will not restart

Scale deployments

kubectl scale --replicas=[number] [resource_type]/[resource_name/id]

## Scale a deployment to [number] of replicas
kubectl scale --replicas=[number] deployments/[deployment_name]

Interact with running pods

kubectl exec -it [pod_id] /bin/bash # Opens a bash shell in your pod