A Detailed Overview of Rancher's Architecture
This newly-updated, in-depth guidebook provides a detailed overview of the features and functionality of the new Rancher: an open-source enterprise Kubernetes platform.Get the eBook
Don’t have access to Cloud infrastructure? Maybe you would like to use Rancher for local development just like you do in production?
No problem, you can install Rancher 2.0 on your desktop.
In this tutorial we will install Docker-for-Desktop Edge release and enable the built in Kubernetes engine to run your own personal instance of Rancher 2.0 on your desktop.
For this guide you will need a couple of tools to manage and deploy to your local Kubernetes instance.
The Edge install of Docker CE for Windows/Mac includes a basic Kubernetes engine. We can leverage it to install a local Rancher Server. Download and install from the Docker Store.
Sign into Docker then right click on the Docker icon in your System Tray and select
Advanced section increase
Memory to at least
4096 MB. You may want to increase the number of
CPUs assigned and the
Disk image max size while you’re at it.
Kubernetes section, check the box to enable the Kubernetes API. Docker-for-Desktop will automatically create
~/.kube/config file with credentials for
kubectl to access your new local “cluster”.
Don’t see a
Kubernetes section? Check the
General section and make sure you are running the Edge version.
Testing Your Cluster
Open terminal and test it out. Run
kubectl get nodes.
kubectl should return a node named
> kubectl get nodes NAME STATUS ROLES AGE VERSION docker-for-desktop Ready master 6d v1.9.6
Docker-for-Desktop doesn’t come with any extra tools installed. We could apply some static YAML manifest files with
kubectl, but rather than reinventing the wheel, we want leverage existing work from the Kubernetes community.
helm is the package management tool of choice for Kubernetes.
charts provide templating syntax for Kubernetes YAML manifest documents. With
helm we can create configurable deployments instead of just using static files. For more information about creating your own catalog of deployments, check out the docs at https://helm.sh/
Initialize Helm on your Cluster
helm installs the
tiller service on your cluster to manage
chart deployments. Since
docker-for-desktop has RBAC enabled by default we will need to use
kubectl to create a
tiller can deploy to our cluster for us.
ServiceAccount in the
kubectl -n kube-system create serviceaccount tiller
ClusterRoleBinding to give the
tiller account access to the cluster.
kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller
helm to initialize the
helm init --service-account tiller
tillerinstall has full cluster access, and may not be suitable for a production environment. Check out the helm docs for restricting
tilleraccess to suit your security requirements.
Add an Ingress Controller
Ingress controllers are used to provide L7 (hostname or path base) http routing from the outside world to services running in Kubernetes.
We’re going to use
helm to install the Kubernetes stable community
chart. This will create an ingress controller on our local cluster.
The default options for the “rancher”
chart is to use SSL pass-through back to the self-signed cert on the Rancher server pod. To support this we need to add the
--controller.extraArgs.enable-ssl-passthrough="" option when we install the chart.
helm install stable/nginx-ingress --name ingress-nginx --namespace ingress-nginx --set controller.extraArgs.enable-ssl-passthrough=""
We’re going to use
helm install Rancher.
The default install will use Rancher’s built in self-signed SSL certificate. You can check out all the options for this
chart here: https://github.com/jgreat/helm-rancher-server
First add the
rancher-server repository to
helm repo add rancher-server https://jgreat.github.io/helm-rancher-server/charts
Now install the
helm install rancher-server/rancher --name rancher --namespace rancher-system
By default the Rancher server will listen on
rancher.localhost. To access it we will need to set a
hosts file entry so our browser can resolve the name.
- Windows -
- Mac -
Edit the appropriate file for your system and add this entry.
Connecting to Rancher
Browse to https://rancher.localhost
Ignore the SSL warning and you should be greeted by the colorful Rancher login asking you to Set the Admin password.
Congratulations you have your very own local instance of Rancher 2.0. You can add your application
charts and deploy your apps just like production. Happy Containering!
Building scalable infrastructure for companies of all sizes since 1999. From Fortune 500 companies to early stage startups. Early adopter of containers, running production workloads in Docker since version 0.7.