This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Tasks

This section of the Datum documentation provides pages that guide you through specific tasks. Each task page focuses on a single objective, usually presented as a concise sequence of steps.

1 - Set Up Datum Tools

Set up tools to work with Datum.

The Datum control plane is a collection of multiple projects developed with Kubernetes control plane technology, most of which can be installed into native Kubernetes clusters.

As a result, you will leverage common Kubernetes tooling such as kubectl to interact with Datum.

Install Tools

datumctl

Install datumctl with the Homebrew package manager on macOS or Linux:

brew install datum-cloud/tap/datumctl

Install manually with curl on Linux or macOS

export OS=$(uname -s)
export ARCH=$(uname -m)

curl -Lo ./datumctl.tar.gz https://github.com/datum-cloud/datumctl/releases/latest/download/datumctl_${OS}_${ARCH}.tar.gz

# Extract and install the datumctl binary
tar zxvf datumctl.tar.gz datumctl
chmod +x datumctl
mkdir -p ~/.local/bin
mv ./datumctl ~/.local/bin/datumctl
# and then append (or prepend) ~/.local/bin to $PATH

Install via Go

go install go.datum.net/datumctl@latest
# Ensure that $GOPATH/bin is in your PATH
export PATH=$PATH:$(go env GOPATH)/bin

Install datumctl on Windows using PowerShell

Invoke-WebRequest -Uri "https://github.com/datum-cloud/datumctl/releases/latest/download/datumctl_Windows_x86_64.zip"  -OutFile "datumctl.zip"
Expand-Archive -Path "datumctl.zip" -DestinationPath "datumctl"

Move the datumctl.exe file to a directory in your PATH or simply run it from the current directory:

.\datumctl\datumctl.exe

kubectl

Refer to the official Kubernetes documentation for installation instructions, making sure to skip the Verify kubectl configuration section in the guide you choose.

Later in this guide, you will configure a kubeconfig file as required to interact with Datum via kubectl.

For convenience, homebrew instructions are below:

Install kubectl with the Homebrew package manager on macOS or Linux:

brew install kubectl

Create API Credentials

  1. Sign in to Datum at https://cloud.datum.net
  2. Create an API token by clicking on your User Initials / Avatar (top right) and then navigating to API Keys > New API Key. Save this API Key in your password manager or preferred method of storage.

Configure Tools

Authentication

Configure datumctl authentication by activating the API token created in the previous section. Run the following command and enter your API token at the prompt:

datumctl auth activate-api-token

Add a kubeconfig context for your organization

Obtain your organization’s resource ID with datumctl by listing organizations that your user has access to:

datumctl organizations list

The output is similar to:

DISPLAY NAME           RESOURCE ID
Personal Organization  pp4zn7tiw5be3beygm2d6mbcfe

Create a kubeconfig context to access your organization’s resources by copying the the RESOURCE ID value and executing following command, replacing RESOURCE_ID with the value:

datumctl auth update-kubeconfig --organization RESOURCE_ID

The output is similar to:

Successfully updated kubeconfig at getting-started.kubeconfig

Verify kubectl configuration

Check that kubectl is properly configured by getting authorized user info:

kubectl auth whoami

The output is similar to:

ATTRIBUTE                                                VALUE
Username                                                 datum@example.com
Groups                                                   [system:authenticated]
Extra: authentication.datum.net/datum-organization-uid   [pp4zn7tiw5be3beygm2d6mbcfe]
Extra: authentication.kubernetes.io/credential-id        [JTI=01jgsr1m8fpb9cn0yrh05taa5v]

What’s next

2 - Create a Project

Create a Project via kubectl

Before you begin

This tutorial assumes you have already registered an account and have installed and configured the necessary tools to interact with Datum.

Portal Alternative

This tutorial uses a kubectl with manifest driven workflow to create your first project. Alternatively, you can create your first project via the Datum Cloud Portal.

Confirm your kubeconfig context

Ensure that your kubectl tool is configured to use the correct context to interact with your organization by running the following command:

kubectl config current-context

The output is similar to:

datum-organization-pp4zn7tiw5be3beygm2d6mbcfe

Create a project

Write the following project manifest to intro-project.yaml.

Note that generateName is used here, which will result in a name with the prefix of intro-project- and a random suffix.

apiVersion: resourcemanager.datumapis.com/v1alpha
kind: Project
metadata:
  generateName: intro-project-
spec:

Create the project

kubectl create -f intro-project.yaml

The output is similar to:

project.resourcemanager.datumapis.com/intro-project-zj6wx created

Copy the generated project name, in this example it is intro-project-zj6wx.

Wait for the project’s control plane to become ready, which can take up to two minutes. Exit the command once the control plane status is Ready.

kubectl get projects -w

The output is similar to:

NAME                   AGE   CONTROL PLANE STATUS
intro-project-zj6wx   2s    APIServerProvisioning
intro-project-zj6wx   22s   ControllerManagerProvisioning
intro-project-zj6wx   43s   NetworkServicesOperatorProvisioning
intro-project-zj6wx   64s   WorkloadOperatorProvisioning
intro-project-zj6wx   106s   InfraProviderGCPProvisioning
intro-project-zj6wx   2m3s   Ready

Add a kubeconfig context for your project

Create a kubeconfig context to access your project’s resources by executing following command, replacing PROJECT_NAME with your project’s name.

Note: If you created your project via Datum Cloud Portal, you’ll want to copy/paste the same project name into the command below.

datumctl auth update-kubeconfig --project PROJECT_NAME

Confirm that the project’s control plane is accessible:

kubectl explain locations.spec
GROUP:      networking.datumapis.com
KIND:       Location
VERSION:    v1alpha

FIELD: spec <Object>


DESCRIPTION:
    LocationSpec defines the desired state of Location.

... continued

What’s next