• OSS based stack (deployed via Terraform)

Components

  • 2x docker for Catle
    • demo-rancher-minimal-server-se401-[oss_login]
    • demo-rancher-minimal-host-se40x-oss_login

Prerequisities

  • OpenStack login/pass and key_pair
  • Latest stable Docker
  • Dockerfile contain all needed tooling (terraform, ansible, rancher-compose, …)

Start instances for Rancher in OpenStack

  • If you have Windows OS, some steps need to be done in different way (commands, paths, …) to run docker container
## Clone repozitory:
[root@workstation ]# git clone https://github.com/VAdamec/rancher-demo

# Run Docker
[root@workstation ]$ docker build -t rancher-minimal .
[root@workstation ]$ cp ~/.ssh/<your_oss_ssh_key> terraform.pem
[root@workstation ]$ docker run -v `pwd`:/code -ti rancher-minimal /bin/bash

## Rename sample variables and add your credentials
[root@container /]$ cd /code
[root@container code]$ mv variables.sample variables.tf # setup your credentials to OpenStack
[root@container code]$ terraform plan
[root@container code]$ terraform apply
[root@container code]$ terraform output  # to see IP addresses of instances

Setup rancher and hosts via Ansible

[root@container code]$ ansible-playbook -i ./terraform.py rancher-provision.yml -b

Setup rancher manually

Login to UI

  • get IPADDRESS of demo-rancher-minimal-server-se401-[oss_login] and put it to browser http://IPADDRESS
    • you should be abble to see UI and after a few seconds also registered host(s)

Examples

# You need Environment API key and URL exported, http://IPADDRESS/env/1a5/api/keys

export RANCHER_URL=http://<server_ip>/v2-beta/projects/1a5
export RANCHER_ACCESS_KEY=xxxxxxx
export RANCHER_SECRET_KEY=xxxxxxxxxxxxxxxxx

cd wordpress
rancher-compose up
#... some changes ...
rancher-compose up --force-upgrade
rancher-compose down
rancher-compose rm

 

Advertisements