All Projects â†’ kubernetes-digitalocean-terraform â†’ Kubernetes Digitalocean Terraform

kubernetes-digitalocean-terraform / Kubernetes Digitalocean Terraform

Licence: mit
📋 🌊 🌎 Setup a simple Kubernetes cluster in Digital Ocean using Terraform

Projects that are alternatives of or similar to Kubernetes Digitalocean Terraform

Lambda Deployment Example
Automated Lambda Deployments with Terraform & CodePipeline
Stars: ✭ 25 (-92.28%)
Mutual labels:  terraform, hcl, deployment
K8s Digitalocean Terraform
Deploy latest Kubernetes cluster on DigitalOcean using Terraform
Stars: ✭ 33 (-89.81%)
Mutual labels:  digitalocean, terraform, hcl
Terraform Vsphere Kubespray
Deploy a Kubernetes HA cluster on VMware vSphere
Stars: ✭ 141 (-56.48%)
Mutual labels:  terraform, hcl, deployment
Doact
A Terraform module for hosting your own runner for CI/CD on Digital Ocean to run jobs in your GitHub Actions workflows. 🚀
Stars: ✭ 42 (-87.04%)
Mutual labels:  digitalocean, terraform, hcl
Terraform With Circleci Example
This is an example of automatic deployments of your infrastructure using terraform and CircleCI 2.0 workflows
Stars: ✭ 142 (-56.17%)
Mutual labels:  terraform, hcl, deployment
Typhoon
Minimal and free Kubernetes distribution with Terraform
Stars: ✭ 1,397 (+331.17%)
Mutual labels:  digitalocean, terraform, hcl
Terraform Kubestack
Terraform GitOps Framework — Everything you need to build reliable automation for AKS, EKS and GKE Kubernetes clusters in one free and open-source framework.
Stars: ✭ 300 (-7.41%)
Mutual labels:  terraform, hcl
phoenix example
An example Phoenix app with one-click deployments to different cloud services.
Stars: ✭ 62 (-80.86%)
Mutual labels:  digitalocean, deployment
Terraform Aws Eks Cluster
Terraform module for provisioning an EKS cluster
Stars: ✭ 256 (-20.99%)
Mutual labels:  terraform, hcl
Provisioning
Kubernetes cluster provisioning using Terraform.
Stars: ✭ 277 (-14.51%)
Mutual labels:  terraform, hcl
Procsd
Manage your application processes in production hassle-free like Heroku CLI with Procfile and Systemd
Stars: ✭ 181 (-44.14%)
Mutual labels:  digitalocean, deployment
Cloudblock
Cloudblock automates deployment of secure ad-blocking for all of your devices - even when mobile. Step-by-step text and video guides included! Compatible clouds include AWS, Azure, Google Cloud, and Oracle Cloud. Cloudblock deploys Wireguard VPN, Pi-Hole DNS Ad-blocking, and DNS over HTTPS in a cloud provider - or locally - using Terraform and Ansible.
Stars: ✭ 257 (-20.68%)
Mutual labels:  terraform, hcl
Elasticsearch Cloud Deploy
Deploy Elasticsearch on the cloud easily
Stars: ✭ 308 (-4.94%)
Mutual labels:  terraform, hcl
Kubecdn
Self-hosted CDN based on Kubernetes
Stars: ✭ 314 (-3.09%)
Mutual labels:  terraform, hcl
dropship
Super simple deployment tool
Stars: ✭ 62 (-80.86%)
Mutual labels:  deployment, hcl
terraform-cloudinit-container-server
A batteries included cloud-init config to quickly and easily deploy a single Docker image or Docker Compose file to any Cloudâ„¢ VM.
Stars: ✭ 52 (-83.95%)
Mutual labels:  digitalocean, terraform
Engine
Deploy your apps on any Cloud provider in just a few seconds
Stars: ✭ 1,132 (+249.38%)
Mutual labels:  digitalocean, terraform
Terraform Examples
Terraform samples for all the major clouds you can copy and paste. The future, co-created.
Stars: ✭ 256 (-20.99%)
Mutual labels:  terraform, hcl
Kubenow
Deploy Kubernetes. Now!
Stars: ✭ 285 (-12.04%)
Mutual labels:  terraform, hcl
Iam Policy Json To Terraform
Small tool to convert an IAM Policy in JSON format into a Terraform aws_iam_policy_document
Stars: ✭ 282 (-12.96%)
Mutual labels:  terraform, hcl

Kubernetes - DigitalOcean - Terraform

Deploy your Kubernetes cluster on DigitalOcean using Terraform.

Requirements

On Mac

With brew installed, all tools can be installed with

brew install terraform kubectl 

Do all the following steps from a development machine. It does not matter where it is, as long as it is connected to the internet. This one will be subsequently used to access the cluster via kubectl.

Generate private / public keys

ssh-keygen -t rsa -b 4096

The system will prompt you for a file path to save the key, we will go with ~/.ssh/id_rsa in this tutorial.

Add your public key in the DigitalOcean control panel

Do it here. Name it and paste the public key just below Add SSH Key.

Add this key to your SSH agent

eval `ssh-agent -s`
ssh-add ~/.ssh/id_rsa

Invoke Terraform

We put our DigitalOcean token in the file ./secrets/DO_TOKEN (this directory is mentioned in .gitignore, of course, so we don't leak it)

Then we setup the environment variables (step into this repository root).

export TF_VAR_do_token=$(cat ./secrets/DO_TOKEN)
export TF_VAR_ssh_fingerprint=$(ssh-keygen -E MD5 -lf ~/.ssh/id_rsa.pub | awk '{print $2}' | sed 's/MD5://g')

If you are using an older version of OpenSSH (<6.9), replace the last line with

export TF_VAR_ssh_fingerprint=$(ssh-keygen -lf ~/.ssh/id_rsa.pub | awk '{print $2}')

There is a convenience script for you in ./setup_terraform.sh. Invoke it as

. ./setup_terraform.sh

Optionally, you can customize the datacenter region via:

export TF_VAR_do_region=fra1

The default region is nyc3. You can find a list of available regions from DigitalOcean.

After setup, call terraform apply

terraform apply

That should do! kubectl is configured, so you can just check the nodes (get no) and the pods (get po).

$ KUBECONFIG=$PWD/secrets/admin.conf kubectl get no
NAME          LABELS                               STATUS
X.X.X.X   kubernetes.io/hostname=X.X.X.X   Ready     2m
Y.Y.Y.Y   kubernetes.io/hostname=Y.Y.Y.Y   Ready     2m

$ KUBECONFIG=$PWD/secrets/admin.conf kubectl --namespace=kube-system get po
NAME                                   READY     STATUS    RESTARTS   AGE
kube-apiserver-X.X.X.X                    1/1       Running   0          13m
kube-controller-manager-X.X.X.X           1/1       Running   0          12m
kube-proxy-X.X.X.X                        1/1       Running   0          12m
kube-proxy-X.X.X.X                        1/1       Running   0          11m
kube-proxy-X.X.X.X                        1/1       Running   0          12m
kube-scheduler-X.X.X.X                    1/1       Running   0          13m

You are good to go. Now, we can keep on reading to dive into the specifics.

Setup kubectl

After the installation is complete, terraform will put the kubeconfig in secrets/admin.conf. Test your brand new cluster

KUBECONF=$PWD/secrets/admin.conf kubectl get nodes

You should get something similar to

$ kubectl get nodes
NAME          LABELS                               STATUS
X.X.X.X       kubernetes.io/hostname=X.X.X.X       Ready

Deploy microbot with External IP

The file 04-microbot.yaml will be rendered (i.e. replace the value EXT_IP1), and then kubectl will create the Service and Replication Controller.

To see the IP of the service, run kubectl get svc and look for the EXTERNAL-IP (should be the first worker's ext-ip).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].