Coder Social home page Coder Social logo

do_terraform's Introduction

Digitalocean Terraform Tutorial

  1. Clone this repo
  2. Install terraform
  3. Install doctl
  4. Run terraform init in this repo. This will initialize Terraform and get us ready to run Terraform plans.
  5. Run doctl auth init to login to DigitalOcean. This will get us ready to pull data from DigitalOcean.
  6. Get an API token from your DigitalOcean account from https://cloud.digitalocean.com/account/api/tokens
  7. Set it to DIGITALOCEAN_TOKEN in your terminal environment with export DIGITALOCEAN_TOKEN=<your token>. This will be used by Terraform.
  8. Run terraform plan -out plan.tfplan to plan this Terraform application.
  9. Run terraform apply "plan.tfplan" to apply this to your DigitalOcean account. This will launch a K8s cluster, a Postgres DB, and a Redis DB. This can take a long time to run. Note the Postgres and Redis databases are just for show, nothing is setup to use them.
  10. Run doctl kubernetes cluster kubeconfig save dcsil-cluster to download the kubernetes config for the cluster we just launched (named dcsil-cluster).
  11. Run ./launch.sh to launch nginx/load balancers on your Kubernetes Cluster. This script will set up a DCSIL namespace, then launch our nginx application on Kubernetes. Next it will launch a LoadBalancer that is set up to serve data from any apps with the label "nginx". This script can take a while to run.
  12. Go to the IP Address the script prints out. This should show the nginx page.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.