Get Started with Kubernetes
Learn how to configure Kubernetes access to CoreWeave Cloud
At CoreWeave, API access tokens are used by clients like kubectl
to interact with our Kubernetes cluster. These access tokens are stored and distributed to users in Kubeconfig files. To learn how to create access tokens and Kubeconfig files, see Manage API Access Tokens.
Org Admins can also create RBAC policies. See How to Create Custom RBAC Access Tokens to learn more.
Install Kubernetes tools
After obtaining the Kubeconfig from the Org Admin, install kubectl
, the Kubernetes command line tool.
- Linux
- macOS
- Windows
Install kubectl
on a Linux system
To install Kubernetes using a native package manager, please view the Kubernetes guide on Installing using Native Package Manager.
The following command is a simple way to install kubectl
on a Linux system by downloading the binary.
$curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
After downloading the kubectl
binary, verify the sha256 sum to ensure it's valid.
$curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl.sha256"$echo "$(<kubectl.sha256) kubectl" | sha256sum --check
This should return kubectl: OK
to confirm the file is valid. If this returns an error, please review the official kubectl
installation guide.
Then, make the binary executable and move it to the system bin
directory:
$chmod +x ./kubectl$sudo mv ./kubectl /usr/local/bin/kubectl
Install kubectl
on a macOS system
Most Mac users use Homebrew to install packages. Use the Brew Installation guide if Brew isn't already installed, then install kubectl
by running the following command:
$brew install kubectl
Install kubectl
on a Windows system
kubectl
can be installed in PowerShell with the following command:
>& $([scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/coreweave/kubernetes-cloud/master/getting-started/k8ctl_setup.ps1')))
Add the -Silent
flag to the end of this string for a non-interactive setup.
To download the kubectl
executable directly, follow the official Kubernetes instructions.
You can also install kubectl
on Windows using these package managers.
>choco install kubernetes-cli
>scoop install kubectl
For more information on Kubernetes installation and configuration, please see the official Kubernetes documentation.
Configure Kubernetes
After kubectl
is installed and the cw-kubeconfig
file has been obtained from the Org Admin, the next step is to move the Kubeconfig to the right location.
If this system has never used Kubernetes before, there probably isn't an existing Kubeconfig. To verify, check the default path for the operating system:
Operating System | Default path |
---|---|
Linux | ~/.kube/config |
macOS | /Users/<username>/.kube/config |
Windows | %USERPROFILE%\.kube\config |
Also, check the environment and verify no value is set for KUBECONFIG
:
- Linux or macOS
- Windows
$echo $KUBECONFIG
>echo %KUBECONFIG%
If a Kubeconfig exists, Advanced Kubeconfig Environments explains how to merge them.
If there is not an existing Kubeconfig, follow the steps below for the operating system.
- Linux and macOS
- Windows
Assuming that cw-kubeconfig
was downloaded to ~/Downloads
, create the directory and move the file to the correct location.
$mkdir ~/.kube$mv ~/Downloads/cw-kubeconfig ~/.kube/config
Assuming that cw-kubeconfig
was downloaded to %USERPROFILE%\Downloads
, create the directory and move the file to the correct location.
>mkdir %USERPROFILE%\.kube>mv %USERPROFILE%\Downloads\cw-kubeconfig %USERPROFILE%\.kube\config
To use a different Kubeconfig path, see Advanced Kubeconfig Environments.
Verify Kubernetes credentials
Since a new account will not yet have any resources, listing cluster secrets
is a good way to test that proper communication with the cluster is in place. To verify the CoreWeave Kubernetes configuration using kubectl
, invoke the following commands.
First, use the coreweave
context:
$kubectl config use-context coreweave
Next, request the secret
objects:
$kubectl get secret
This should return the default secrets
, such as:
NAME TYPE DATA AGEdefault-token-frqgm kubernetes.io/service-account-token 3 3h
Retrieve the API access token
The API token is only shown once in CoreWeave Cloud, when the API token is first created. If it is needed later, for example for use with applications like self-hosted Grafana, tokens can be retrieved later from their associated Kubeconfig file.
To view the API access token stored in the kubeconfig
, run:
$kubectl config view --raw
Example output:
apiVersion: v1clusters:- cluster:certificate-authority-data: DATA+OMITTEDserver: https://k8s.ord1.coreweave.comname: coreweavecontexts:- context:cluster: coreweavenamespace: tenant-EXAMPLEuser: token-EXAMPLE-USERname: coreweavecurrent-context: coreweavekind: Configpreferences: {}users:- name: token-EXAMPLE-USERuser:token: 123example456
The API access token in this example is 123example456
. If the Kubeconfig has more than one context, it may have multiple tokens.
To learn more about organization management and token creation, see: Organizations.
Congratulations! 🎉
Kubernetes is now ready to use on CoreWeave Cloud to deploy all types of services!
💥 Check out some examples of what you can do on CoreWeave Cloud!