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.
- EKS Cluster Deployment Pre-reqs
- Deploying an EKS Cluster with Terraform
- Installing/Configuring Helm
- Deploying Drone with Helm
There are some things we'll need to do before we can deploy an EKS cluster with 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.
This step assumes you have an AWS account already. Learn how to configure the terraform aws provider here.
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:
- Kubectl : Installation Instructions
- AWS IAM Authenticator : Installation Instructions
- Edit the bucket used for remote state in main.tf
NOTE: For demo purposes, keeping your terraform state local is fine.
cd
into the terraform directory and run the following commands:
terraform init
terraform plan
terraform apply
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:
- Run
export KUBECONFIG=/full/path/to/kubeconfig_<env>-<workspace>-cluster
Now that we've configured kubectl, we can create kubernetes resources that Helm needs.
cd
into the k8s directory.- 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.
Follow the steps outlined in this here to install helm on your workstation. Tiller will be installed after the eks cluster is deployed.
The following steps outline the installation of tiller on our EKS cluster:
- Run
export KUBE_CONFIG=/full/path/to/kubeconfig_<env>-<workspace>-cluster
- Run
helm init
cd
into the helm directory.- Populate values.yaml file with the necessary information.
- Run
helm install --name drone -f values.yaml stable/demo
cd
into the terraform directory and runterraform outputs
. This will return the hostname of the elastic load balancer.- Drone should now be accessible via the load balancer hostname.
- Create a CNAME so you can access drone at the URL we specified earlier.