All Projects → puzzle → ansible-rancher

puzzle / ansible-rancher

Licence: other
Some Ansible plays & roles to install Rancher and Kubernetes Cluster

Programming Languages

Jinja
831 projects

Projects that are alternatives of or similar to ansible-rancher

check rancher2
Monitoring plugin to check Docker / Kubernetes clusters managed by Rancher 2.x
Stars: ✭ 19 (-24%)
Mutual labels:  rancher
paas-templates
Bosh, CFAR, CFCR and OSB services templates for use with COA (cf-ops-automation) framework
Stars: ✭ 16 (-36%)
Mutual labels:  rancher
gitlab-docker-rancher-letsencrypt-setup
Automated private dev environment with docker, gitlab CI/CD...
Stars: ✭ 15 (-40%)
Mutual labels:  rancher
ui-driver-hetzner
Rancher UI driver for the Hetzner Cloud docker driver.
Stars: ✭ 238 (+852%)
Mutual labels:  rancher
rancher2-ansible
Provision a single node rancher2 k8s cluster using Ansible
Stars: ✭ 18 (-28%)
Mutual labels:  rancher
rancher-redis
A containerized redis master/slave configuration with sentinels for use in Rancher
Stars: ✭ 13 (-48%)
Mutual labels:  rancher
ansible-role-rke2
Ansible Role to install RKE2 Kubernetes.
Stars: ✭ 118 (+372%)
Mutual labels:  rancher
rancher-terraform-digitalocean
Terraform module for a rancher server on digitalocean.
Stars: ✭ 21 (-16%)
Mutual labels:  rancher
Performance-Engineers-DevOps
This repository helps performance testers and engineers who wants to dive into DevOps and SRE world.
Stars: ✭ 35 (+40%)
Mutual labels:  rancher
monitoring-rancher
🤠How to Set up Rancher Server Monitoring with TIG Stack?
Stars: ✭ 22 (-12%)
Mutual labels:  rancher
cattlectl
gain control over your ranch
Stars: ✭ 33 (+32%)
Mutual labels:  rancher
bovine
Manager for single node Rancher clusters
Stars: ✭ 51 (+104%)
Mutual labels:  rancher
terraform-metal-k3s
Manage K3s (k3s.io) region clusters on Equinix Metal
Stars: ✭ 41 (+64%)
Mutual labels:  rancher
nextmoov
We are nextmoov — a Belgian Digital Agency that reinvents the way we work.
Stars: ✭ 13 (-48%)
Mutual labels:  rancher
keycloak-sso-configs
common keycloak single sign on configurations
Stars: ✭ 19 (-24%)
Mutual labels:  rancher
faas-rancher
[DEPRECATED] Enable Rancher as a backend for Functions as a Service (OpenFaaS) https://github.com/alexellis/faas
Stars: ✭ 30 (+20%)
Mutual labels:  rancher
Certified-Rancher-Operator-Thai
มาเรียนรู้ Kuberntes แบบ On-Premise และ Architecture ของ Rancher ที่ใช้ในการจัดการ Kubernetes Cluster เพื่อนำสู่ Certified Kubernetes Administrator และ Certified Rancer Operator
Stars: ✭ 78 (+212%)
Mutual labels:  rancher
metrics-server-on-rancher-2.0.2
Method to Setup Metrics-Server on Kubernetes via Rancher-Deployed Cluster
Stars: ✭ 14 (-44%)
Mutual labels:  rancher
skalogs-bundle
Open Source data and event driven real time Monitoring and Analytics Platform
Stars: ✭ 16 (-36%)
Mutual labels:  rancher
k3d-demo
Demo of k3d: Tool to run k3s (Kubernetes) in Docker
Stars: ✭ 197 (+688%)
Mutual labels:  rancher

Ansible Playbooks and Roles for Rancher

Disclaimer!: We use this as a base for our own and customer setup at puzzle. Heavy work in progress and a lot of things that can be improved. Feel free to contribute. We are happy to assist.

These Ansible playbook and roles can be used to:

Prerequisites

We recommend you to run this playbooks inside a pipenv.

All dependencies are managed using pipenv, to get a virtual environment use:

# Only if you don't have pipenv yet:
pip install --user pipenv

Switch to the virtual environment and install dependencies into:

pipenv shell --three
pipenv install
# Now you can run ansible-playbook commands inside this pipenv shell:
ansible-playbook ...

You can verify the installed dependencies using pipenv graph (inside the pipenv shell):

$ pipenv graph
ansible==2.9.12
  - cryptography [required: Any, installed: 3.2]
  <--- output truncated --->
  - PyYAML [required: Any, installed: 5.3.1]
jmespath==0.10.0
openshift==0.11.2
  - jinja2 [required: Any, installed: 2.11.2]
    - MarkupSafe [required: >=0.23, installed: 1.1.1]
  - kubernetes [required: ~=11.0.0, installed: 11.0.0]
    - certifi [required: >=14.05.14, installed: 2020.6.20]
  <--- output truncated --->
  - six [required: Any, installed: 1.15.0]
selinux==0.2.1
  - distro [required: >=1.3.0, installed: 1.5.0]
  - setuptools [required: >=39.0, installed: 50.3.2]

Inventory

Check inventories/site for a sample inventory.

There are two special ansible groups:

  • rke_rancher_clusters: Hosts in this group represent a Rancher Control Plane instance
  • custom_k8s_clusters: Hosts in this group represent a custom kubernetes cluster added to a Rancher Control Plane

Members (Nodes) of the Rancher Control Plane and the Kubernetes cluster are managed with the following ansible groups.

Rancher Control Plane

For Rancher Control Plane: Assuming we have a Rancher Control Plane with the name cluster_rancher, we create the cluster_rancher host to the rke_rancher_clusters group and then add all nodes for this to the group rke_cluster_rancher, so the Rancher Control Plane name with a rke_ prefix.

[rke_rancher_clusters]
cluster_rancher # Belongs to Ansible Group rke_cluster_rancher

[rke_cluster_rancher]
rancher01
rancher02
rancher03

Make sure to set at least the following vars:

Custom Kubernetes Cluster

For a custom Kubernetes cluster managed with a Rancher Control Plane: Assuming our cluster has the name mycluster we create a host rancher_mycluster in the custom_k8s_clusters group (so cluster name with a rancher_ prefix). The member nodes of this cluster are then added to a group with the name mycluster. To use some dedicated roles on some nodes you can use other ansible groups which are children of the mycluster group.

[custom_k8s_clusters]
rancher_mycluster

[mycluster:children]
mycluster_master
mycluster_worker

[mycluster_master]
master01

[mycluster_worker]
worker01

Make sure to set at least the following vars:

Playbooks

site.yml

Playbook to apply docker, firewalld, rke_rancher_clusters & custom_rk8s_cluster. Check plays/prepare_k8s_nodes.yml, plays/deploy_rancher.yml & plays/deploy_k8s_cluster.yml for details.

cleanup_k8snode.yml

With this playbook to can cleanup a node which was already added to a kubernetes cluster. Based on https://rancher.com/docs/rancher/v2.x/en/cluster-admin/cleaning-cluster-nodes/

Roles

docker

Simple role to install Docker. Check roles/docker/README.md for more details.

firewalld

The role only configures firewalld depending on the k8s_role the node has (this behaviour can also be disabled if you want to). Based on https://rancher.com/docs/rancher/v2.x/en/installation/options/firewall/

rke_rancher_clusters

Role to deploy a Rancher Control Plane with rke and helm. Check roles/rke_rancher_clusters/README.md for more details.

custom_rk8s_cluster

Role to create a custom Kubernetes cluster on a Rancher Control Plane and add nodes to the cluster. Check roles/custom_k8s_cluster/README.md for more details.

rancher_keepalived

Role to deploy keepalived Daemonsets on Rancher Control Plane and custom Kubernetes clusters. Provides one or multiple highly available virtual IPv4/IPv6 address(es) to the regarding cluster. Usually directly called from rke_rancher_clusters and custom_rk8s_cluster.

License

GPLv3

Author Information

  • Sebastian Plattner
  • Philip Schmid
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].