Git Product home page Git Product logo

tf-drone-deployment's Introduction

Drone Deployment

This repository outlines the steps needed to deploy drone with helm on an eks cluster. The cluster and load balancer sitting in front of the drone service will be provisioned with terraform.

Table of Contents

  1. EKS Cluster Deployment Pre-reqs
  2. Deploying an EKS Cluster with Terraform
  3. Installing/Configuring Helm
  4. Deploying Drone with Helm

EKS Cluster Deployment Pre-reqs

There are some things we'll need to do before we can deploy an EKS cluster with terraform.

1. Clone this Repo

2. Install Terraform

Install terraform by following the documentation outlined here.

NOTE: It's better to download the binary for a specific version of terraform. Certain terraform configurations require a specific versions of terraform. You can manage different versions of terraform with a tool like stow.

3. Configure the Terraform AWS Provider

This step assumes you have an AWS account already. Learn how to configure the terraform aws provider here.

4. EKS Module pre-reqs

The terraform eks module is being used to deploy our eks cluster. The eks module requires that the following software be installed on your system before it can be used:

  1. Kubectl : Installation Instructions
  2. AWS IAM Authenticator : Installation Instructions

5.Configuring the Terraform Backend

  1. Edit the bucket used for remote state in main.tf

NOTE: For demo purposes, keeping your terraform state local is fine.

EKS Cluster Deployment

cdinto the terraform directory and run the following commands:

  1. terraform init
  2. terraform plan
  3. terraform apply

Installing and Configuring Helm

1. Configuring kubectl

After the terraform apply is finished, a kubeconfig file kubeconfig_<env>-<workspace>-cluster will be generated in the terraform directory. We need to set the apppropriate context, so that the kubectl client will be able to interact with the eks cluster we spun up. Follow the steps outlined below to configure kubectl:

  1. Run export KUBECONFIG=/full/path/to/kubeconfig_<env>-<workspace>-cluster

2. Creating a Service Account and Cluster Role Bindings for Tiller

Now that we've configured kubectl, we can create kubernetes resources that Helm needs.

  1. cd into the k8s directory.
  2. Run kubectl create -f rbac-config.yaml

This command will create a Service Account and Cluser Role Binding for Tiller that will allow it to deploy kubernetes resources.

3. Installing Helm

Follow the steps outlined in this here to install helm on your workstation. Tiller will be installed after the eks cluster is deployed.

4. Install Tiller on the EKS Cluster

The following steps outline the installation of tiller on our EKS cluster:

  1. Run export KUBE_CONFIG=/full/path/to/kubeconfig_<env>-<workspace>-cluster
  2. Run helm init

Deploying Drone with Helm

  1. cd into the helm directory.
  2. Populate values.yaml file with the necessary information.
  3. Run helm install --name drone -f values.yaml stable/demo

Accessing Drone

  1. cd into the terraform directory and run terraform outputs. This will return the hostname of the elastic load balancer.
  2. Drone should now be accessible via the load balancer hostname.
  3. Create a CNAME so you can access drone at the URL we specified earlier.

Danke!

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.