This document provides a step-by-step guide on how to start and set up a Pulumi project and integrate it with the DigitalOcean CLI (doctl
) for managing infrastructure on DigitalOcean.
Before you begin, ensure you have the following tools installed on your machine:
- Pulumi CLI
- Node.js (Required if using JavaScript/TypeScript for Pulumi)
- Python (Required if using Python for Pulumi)
- doctl (DigitalOcean CLI)
- Git
Follow the official Pulumi installation guide to install Pulumi on your system. You can verify the installation by running:
mkdir my-pulumi-project
cd my-pulumi-project
pulumi new typescript
export DIGITALOCEAN_TOKEN="YOUR_TOKEN_HERE"
docker login -u "youruser" -p "yourtoken" registry.digitalocean.com
docker tag YOUR_IMAGE registry.digitalocean.com/YOUR_REGISTRY/YOUR_IMAGE
docker push registry.digitalocean.com/YOUR_REGISTRY/YOUR_IMAGE
STEP 09: Go to the project infra repository and run the following commands to first create the cluster, make sure to have export the env for the digitlocean token e Kubeconfig path:
doctl kubernetes options versions
pulumi up doctl kubernetes cluster kubeconfig save the clusteName
kubectl config current-context
kubectl create secret generic digitalocean-dns --from-literal=access-token="yourtoken" --namespace default