Rancher: New containers for the (server) farm – quick and easy
version: '2'
services:
WordPress:
image: wordpress:latest
environment:
WORDPRESS_DB_HOST: database:3306
WORDPRESS_DB_PASSWORD: wordpress
links:
- database:database
Loadbalancer:
image: rancher/lb-service-haproxy:v0.4.6
ports:
- 80:80/tcp
database:
image: mysql:5.7
environment:
MYSQL_ROOT_PASSWORD: wordpress
MYSQL_PASSWORD: wordpress
MYSQL_USER: wordpress
MYSQL_DATABASE: wordpress
rancher-compose.yml:
version: '2'
services:
WordPress:
scale: 2
start_on_create: true
Loadbalancer:
scale: 1
start_on_create: true
lb_config:
certs: []
port_rules:
- hostname: ''
path: ''
priority: 1
protocol: http
service: WordPress
source_port: 80
target_port: 80
health_check:
response_timeout: 2000
healthy_threshold: 2
port: 42
unhealthy_threshold: 3
interval: 2000
database:
scale: 1
start_on_create: true
In this example, there are two WordPress containers to which the load balancer distributes the requests.
In addition, a catalog with preconfigured stacks can be used in the Rancher interface. For these stacks, you can define which parameters still need to be specified and everything else is already preconfigured. There is a clear catalog of the Rancher community for certain stacks that are frequently used or can also be used very well for testing Rancher.
In addition to the community catalog, you can also create and integrate your own catalog via GitHub. This can also be used to create a catalog of preconfigured stacks in an internal network that are frequently used or where the majority of the configuration is not changed. In most cases, this makes it even easier to start an entire program stack than via rancher-compose and does not require any prior knowledge of which configuration parameters are required for operation.
This is part 5 of a series of blog posts on the topic of Docker/Rancher.
Part 1 provides an overview of Docker and container environments
Part 2 explains the functions of a Docker registry and docker-compose
Part 3 introduces Docker Swarm with a Docker environment distributed across multiple hosts
Part 4 shows Rancher as an orchestration tool for Docker (and other container environments)
ATIX-Crew
Latest posts by ATIX-Crew (see all)
- Foreman Birthday Party 2024 - 1. August 2024
- CrewDay 2024 - 6. June 2024
- Navigating the XZ Security Vulnerability: A Comprehensive Guide - 9. April 2024