Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kubernetes The Hard Way on DigitalOcean (Terraform)

Kubernetes The Hard Way on DigitalOcean (Terraform)

This repository contains Terraform configuration files to quickly provision the necessary DigitalOcean Droplets to complete the Kubernetes The Hard Way tutorial.

Infrastructure Overview

This setup creates 4 Droplets:

  • jump-box: jumphost
  • server: Control plane node
  • node-1, node-0*: Worker nodes

This configuration mirrors the official tutorial's requirements and lets you focus on Kubernetes component configuration.

🚀 Getting Started

Prerequisites

  • Terraform: Install Terraform on your local machine
  • DigitalOcean Account & API Token: Generate a Personal Access Token with read/write permissions
  • SSH Key Pair: Required for Droplet access

1. Configure Variables

Create a terraform.tfvars file in the root directory:

dotoken = "YOUR_DO_API_TOKEN_HERE"
ssh_pub_key = "~/.ssh/k8s_hard_way_rsa.pub"
Variable Description Example
dotoken DigitalOcean Personal Access Token "xxxxxxxxxxxx..."
ssh_pub_key Path to your public SSH key "~/.ssh/id_rsa.pub"

2. Initialize and Apply

Run the following commands in your terminal to initialize the provider and provision the infrastructure:

terraform init
terraform apply -var-file="variables.tfvars"  # Type 'yes' to confirm

💾 Outputs

After provisioning, retrieve the Droplet IP addresses:

terraform output

Outputs include:

jump_box = "XXX.XXX.XXX.XXX"
node-0 = "XXX.XXX.XXX.XXX"
node-1 = "XXX.XXX.XXX.XXX"
server = "XXX.XXX.XXX.XXX"

⚠️ Cleanup

To destroy resources and avoid billing:

terraform destroy -var-file="variables.tfvars  # Type 'yes' to confirm

Disclaimer: This configuration is for educational purposes only with the Kubernetes The Hard Way tutorial. Do not use for production workloads.

About

Terraform configuration to provision DigitalOcean infrastructure for the Kubernetes The Hard Way tutorial.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages