Skip to main content

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.

Install kubectl on a Linux system

note

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
Additional Resources

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 SystemDefault 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:

$ echo $KUBECONFIG
Existing 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.

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
tip

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   AGE
default-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: v1
clusters:
- cluster:
certificate-authority-data: DATA+OMITTED
server: https://k8s.ord1.coreweave.com
name: coreweave
contexts:
- context:
cluster: coreweave
namespace: tenant-EXAMPLE
user: token-EXAMPLE-USER
name: coreweave
current-context: coreweave
kind: Config
preferences: {}
users:
- name: token-EXAMPLE-USER
user:
token: 123example456

The API access token in this example is 123example456. If the Kubeconfig has more than one context, it may have multiple tokens.

Additional Resources

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!