CoreWeave
Search
K
Comment on page

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

1
# General syntax
2
kubectl get [resource_type]
3
4
# Deployments
5
kubectl get deployments # Shows all running Deployments
6
kubectl get deployment [deployment-name] # Shows a specific Deployment
7
8
# Services
9
kubectl get services # Shows all services in the current Namespace
10
kubectl get services --sort-by=.metadata.name # ...sorted by name
11
kubectl get services --namespace [namespace] # ...in a specific Namespace
12
13
# PVCs
14
kubectl get pvc # Show active Persistent Volume Claims (Storage Volumes)
15
16
# Virtual Servers
17
kubectl get vs
18
19
# Pods
20
kubectl get pods # Shows all Pods in the current Namespace
21
kubectl get pods -o wide # ...with more information
22
kubectl get pods --namespace [namespace] # ...in a specific Namespace
23
24
# The number of CPUs, GPUs, and memory requested by each Pod.
25
# Note: This assumes jq is installed.
26
kubectl get pods -o json | jq '.items[] | {name: .metadata.name, cpu: .spec.containers[].resources.requests.cpu, gpu: .spec.containers[].resources.requests."nvidia.com/gpu", 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