GithubHelp home page GithubHelp logo

punkch / terraform-tiller Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sagikazarmark/terraform-tiller

0.0 2.0 0.0 14 KB

Install Tiller on a Kubernetes cluster using Terraform

License: MIT License

Makefile 23.52% HCL 76.48%

terraform-tiller's Introduction

Tiller Terraform Module

CircleCI

Install Tiller on a Kubernetes cluster using Terraform.

Installation / Usage

  1. Configure a kubernetes provider in the parent module
  2. Add the following snippet to your terraform config:
module "tiller" {
  source  = "github.com/sagikazarmark/terraform-tiller"
  version = "~> 0.1.0"
}

Configuration

Name Default Description
rbac_enabled false Whether to create role-based access control resources (service account and cluster role binding).
tiller_namespace kube-system The Kubernetes namespace to use to deploy Tiller.
tiller_service_account tiller The Kubernetes service account to add to Tiller.
tiller_replicas 1 The amount of Tiller instances to run on the cluster.
tiller_image gcr.io/kubernetes-helm/tiller The image used to install Tiller.
tiller_version v2.11.0 The Tiller image version to install.
tiller_max_history 0 (unlimited) Limit the maximum number of revisions saved per release. Use 0 for no limit.
tiller_net_host empty Install Tiller with net=host.
tiller_node_selector empty Determine which nodes Tiller can land on.

Initial Chart installation

You might want to preinstall your servers with Kubernetes plugins such as unsupported ingress controllers, right after Tiller is installed. Since Terraform still doesn't support depends_on feature on modules, such as this one, there's manual work that needs to be done. This is an example how you can make sure Helm Chart installation starts after the Tiller service is ready:

module "tiller" {
  ...
}

resource "null_resource" "install_voyager" {
  provisioner "local-exec" {
    command     = "./helm/voyager.sh ${local_file.kube_cluster_yaml.filename}"
    interpreter = ["bash", "-c"]
  }
}
#!/usr/bin/env bash

wait_for_tiller () {
	KUBECONFIG=$1 kubectl --namespace kube-system get pods \
		--field-selector=status.phase==Running | grep 'tiller-deploy' \
		| grep '1/1' \
		> /dev/null 2>&1
}

until wait_for_tiller $1; do
	echo "Waiting for tiller-deploy to get ready..."
	sleep 5
done

echo "Installing Voyager Ingress..."

helm repo add appscode https://charts.appscode.com/stable --kubeconfig $CWD/../kube_config_cluster.yml
helm repo update --kubeconfig $CWD/../kube_config_cluster.yml

helm install appscode/voyager --name voyager-operator --version 8.0.1 \
	--namespace kube-system --set cloudProvider=baremetal \
	--kubeconfig $1 > /dev/null 2>&1

echo "Voyager Ingress installed!"

Why

After a rather long development and review period Terraform accepted a Helm provider as an official plugin. It provides an option to automatically install Tiller on a cluster if necessary, but unfortunately it's a bit buggy and it usually comes with an older Helm/Tiller version (at the time of this writing the included version is 2.9.0 while the latest is 2.12.0). So I created this terraform module to install Tiller separately from the Helm provider.

License

The MIT License (MIT). Please see License File for more information.

terraform-tiller's People

Contributors

sagikazarmark avatar mkozjak avatar

Watchers

James Cloos avatar Pencho BELNEYSKI avatar

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.