Coder Social home page Coder Social logo

rancher-as-code's Introduction

Rancher as Code

This repository contains:

  1. An example on how to set up rancher server in an HA configuration using terraform.
  2. How to provision a cluster for workloads and attach that to rancher using terraform
  3. How to manage a provisioned cluster using rancher and terraform
  4. How to deploy applications into the cluster using terraform

Usage

This example uses the terraform RKE provider - https://github.com/yamamoto-febc/terraform-provider-rke. To use this, you need to follow the installation instructions.

Note - currently this project is using a fork of the RKE provider, found here: https://github.com/drpebcak/terraform-provider-rke/tree/backup-folder. This fork will be removed once this PR is merged and released: rancher/terraform-provider-rke#123

  1. Go into the rancher-server directory
  • This directory contains terraform that uses RKE to set up a kubernetes cluster, configures helm, installs cert-manager, and then installs rancher.
  1. Run terraform
terraform init
terraform apply
  • You will probably want to modify some of the locals for your environment
  1. Go into the user-cluster directory
  • This directory contains terraform that uses the rancher2 provider to create a custom cluster that is managed by rancher.
  1. Run terraform
terraform init
terraform apply
  • You will probably want to modify some of the locals for your environment
  1. Go to the install-app directory
  • This directory contains terraform that uses the rancher2 provider to add a custom catalog and install a helm chart.
  1. Run terraform
terraform init
terraform apply

Notes

If you don't work at rancher, you will probably need to modify some of this configuration. The aws provider assumes you want to use a specific profile for access to AWS. Feel free to modify this in rancher-server and user-cluster. We also sort of assume that you want a domain name for rancher-server based on ${local.name}.${local.domain} - you should probably change those as well. Finally, we are assuming that you use Route53 for your DNS. In rancher-server/infra.tf we make a DNS record for your rancher server. If you do not use Route53, you should change this to reference whatever DNS provider you would like to use instead.

rancher-as-code's People

Contributors

drpebcak avatar

Watchers

 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.