Commit 2a2c483e authored by Ľuboslav Pivarč's avatar Ľuboslav Pivarč
Browse files

Inserted Rancher repo hero & add tf for rancher

parent dabaca10
.vault_pass
config.yaml
ansible_hosts
#Ansible
openstack_inventory.*
secrets.sh
.vault_pass
#Terraform
terraform.tfstate.d
terraform.tfstate
.terraform
app-cred-tf5edirex-openrc.sh
secrets.sh
#
secrets
~
# Ansible repo for setting up Rancher
# Rancher
========
Rancher v2.2.7
--------------
## Requirements (1 node setup)
------------------------------
2vcpu 8 GB
Recommendation: always using SSD disks that allows the maximum IOPs for Ranchcer server as performance can decrease...
More info: https://rancher.com/docs/rancher/v2.x/en/installation/requirements/
# Ansible
## Installation of Rancher Master
1. Set destination host in ansible_hosts `[barn]` section.
2. Run `ansible-playbook setup-barn.yml` with 'tf-edirex' key
## A
3. Login to rancher
4. set up Authentication https://rancher.com/docs/rancher/v2.x/en/admin-settings/authentication/github/
## B
3. Run `terraform init` & `terraform plan` & `terraform apply` (This will create cluster and setup authentication in Rancher)
resource "rancher2_cluster" "europdx" {
name = "${var.cluster_name}"
description = "Our beautiful cluster"
rke_config {
network {
plugin = "canal"
}
}
enable_network_policy = true
}
resource "rancher2_auth_config_github" "github" {
client_id = "${var.github_client_id}"
client_secret = "${var.github_client_secret}"
access_mode = "${var.github_acess_mode}"
allowed_principal_ids = ["${var.lubo_github}", "${var.radim_github}"]
}
provider "rancher2" {
alias = "bootstrap"
api_url = "${var.rancher_url}"
bootstrap = true
}
resource "rancher2_bootstrap" "admin" {
provider = "rancher2.bootstrap"
current_password = "${var.password}"
password = "${var.password}"
telemetry = true
}
provider "rancher2" {
api_url = "${rancher2_bootstrap.admin.url}"
token_key = "${rancher2_bootstrap.admin.token}"
}
provider "openstack" {
auth_url = "https://identity.cloud.muni.cz/v3"
region = "brno1"
}
terraform {
backend "swift" {
container = "rancher_edirex_terraform_state"
archive_container = "rancher_edirex_terraform-state-archive"
}
}
variable "github_client_id" {
default = ""
}
variable "github_client_secret" {
default = ""
}
variable "rancher2_access_key" {
default = ""
}
variable "rancher2_secret_key" {
default = ""
}
variable "radim_github" {
default = "github_user://15783625"
}
variable "lubo_github" {
default = "github_user://41989919"
}
variable "github_acess_mode" {
default = "required"
}
variable "cluster_name" {
default = "europdx"
}
variable "rancher_url" {
default = "https://rancher.edirex.ics.muni.cz"
}
variable "password" {
default = ""
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment