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:
pulumi version
mkdir my-pulumi-project
cd my-pulumi-project
pulumi new typescript
Step 3: Install doctl https://docs.digitalocean.com/reference/doctl/how-to/install/
doctl version
export DIGITALOCEAN_TOKEN="YOUR_TOKEN_HERE"
doctl auth init
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 digitalocean token 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
Step 12: After creating the cluster secret responsible to verify the DNS you can go to the service-infra repo and run:
pulumi up
Made with ❤️ by Stoix