GithubHelp home page GithubHelp logo

rancher-cluster's Introduction

Rancher Cluster

Requirements

Setup

Make sure you fill in the inventory file (ansible/inventory.ini) with the ip of the servers that make up the cluster. The local_ip variables are meant to be the ips of the local network between the nodes, they will be used by the load balancer setup below.

Usage

Install Ansible

$> make init

Prepare nodes

Check if requirements are met and install Docker.

$> make prepare

Create Rancher config

Fill with appropriate values for your cluster.

$> make config

Setup cluster

$> make cluster

After the install process finishes, copy the kubectl config file to $HOME/.kube/config:

$> cp kube_config_cluster.yml ~/.kube/config

You should have access to the cluster via kubectl:

$> kubectl cluster-info
Kubernetes master is running at https://192.168.0.101:6443
coredns is running at https://192.168.0.101:6443/api/v1/namespaces/kube-system/services/coredns:dns/proxy

You should then apply the manifests in the k8s-manifests folder and initialize Helm.

$> kubectl apply -f k8s-manifests/ --recursive
namespace/cert-manager created
serviceaccount/tiller created
clusterrolebinding.rbac.authorization.k8s.io/tiller created

$> helm init --service-account tiller --history-max 200
$HELM_HOME has been configured at /Users/bob/.helm.

Tiller (the Helm server-side component) has been installed into your Kubernetes Cluster.

Next, we install cert-manager:

$> kubectl apply -f https://raw.githubusercontent.com/jetstack/cert-manager/release-0.9/deploy/manifests/00-crds.yaml
customresourcedefinition.apiextensions.k8s.io/certificates.certmanager.k8s.io created
customresourcedefinition.apiextensions.k8s.io/certificaterequests.certmanager.k8s.io created
customresourcedefinition.apiextensions.k8s.io/challenges.certmanager.k8s.io created
customresourcedefinition.apiextensions.k8s.io/clusterissuers.certmanager.k8s.io created
customresourcedefinition.apiextensions.k8s.io/issuers.certmanager.k8s.io created
customresourcedefinition.apiextensions.k8s.io/orders.certmanager.k8s.io created

$> helm repo add jetstack https://charts.jetstack.io
"jetstack" has been added to your repositories

$> helm repo update
Hang tight while we grab the latest from your chart repositories...
...Skip local chart repository
...Successfully got an update from the "jetstack" chart repository
...Successfully got an update from the "stable" chart repository

$> helm install \
    --name cert-manager \
    --namespace cert-manager \
    --version v0.9.1 \
    jetstack/cert-manager

Now we install the stable version of Rancher. You will need to provide the hostname of your load balancer and a valid email for Let's Encrypt.

$> helm install rancher-stable/rancher \
    --name rancher \
    --namespace cattle-system \
    --set hostname=yourhostname.com \
    --set ingress.tls.source=letsEncrypt \
    --set [email protected]

To access the cluster externally we need a load balancer. There are different ways to do this; we will use nginx. Install it with

$> make loadbalancer

This will run a docker container with nginx in node1 of the inventory file (ansible/inventory.ini) outside of the cluster. This means that nginx will serve requests for this specific ip (the external ip of node1), so fill in the inventory accordingly.

Once the cluster is properly setup, follow the guides to install the different apps.

rancher-cluster's People

Contributors

jrchatruc avatar metdinov avatar

Stargazers

 avatar  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.