ATIX AG
  • Services
    • Consulting
      • Linux Platform Operations​
      • Infrastructure Automation
      • Container Platforms and Cloud
      • DevOps Processes, Tooling and Culture
      • Cloud Native Software Development
    • Products
      • orcharhino
        • About orcharhino
        • Support
        • orcharhino operation
      • Hangar
        • About Hangar
        • Hangar Roadmap
        • Hangar Community
    • Technologies
      • Ansible
      • Docker
      • Foreman
      • GitLab
      • Istio
      • Kubernetes
      • Linux Distributions
      • OpenShift
      • Puppet
      • OpenVox
      • Rancher
      • Rundeck
      • SaltStack
      • SUSE Manager
      • Terraform
  • Trainings
    • Ansible Training
    • Container Training
    • Docker Training
    • Git Training
    • Go Training (Golang)
    • Istio Training
    • Kubernetes Training
    • OpenShift Training
    • orcharhino Training
    • Puppet Trainings
    • Terraform Training
  • Events
    • Webinars
  • Blog
  • Company
    • About Us
    • References
    • Corporate values
    • Social engagement
    • Newsroom
    • Newsletter
    • Contact us
  • Career
  • Search
  • Menu Menu

Rancher

Rancher: New containers for the (server) farm – quick and easy

There are several ways to start new stacks (=applications consisting of several containers) with Rancher. While it is possible to start the individual containers via the command line as with Docker or via docker-compose (see part 2), there are additional, simpler options with Rancher. In the web interface, it is possible to create each container individually – similar to an interactive compilation of a docker-compose file. The more elegant and simpler option is to use rancher-compose.

A docker-compose.yml is used and an additional rancher-compose.yml is created. The extension contains the scaling, configuration of the load balancer and the health checks. If the additional Rancher tools are not required, the extension can also be omitted. However, it should be noted that Rancher has only switched to the same syntax version as docker-compose (version 2) since version 1.2 (released in December 2016), which is why there were previously differences in the structure of the compose files. As a result, not all docker-compose files were automatically compatible with Rancher. Since Rancher version 1.2, however, this is no longer the case and the corresponding docker-compose files can optionally be supplemented by rancher-compose files.
The extension contains the scaling, configuration of the load balancer and the health checks. If the additional Rancher tools are not required, the extension can also be omitted. However, it should be noted that the syntax of docker-compose is now usually used in version 2, while Rancher only understands version 1. This means that not all docker-compose files are automatically compatible with Rancher. There are three ways to use rancher-compose: running it via the command line on the Rancher server in the directory in which the two yml files are located, uploading the yml files in the web interface or copying or writing the yml files directly in the web interface. In the web interface, it is also possible to export the current configuration from any running stack as docker-compose.yml and rancher-compose.yml. To revisit the example from part 2 with a WordPress blog, the example is shown below in a Rancher-Compose version. A load balancer has been added next to the database. This is actually superfluous for a single WordPress container, but the number of WordPress containers can be scaled up at any time and the load is distributed across all existing containers via the load balancer. The WordPress blog itself is then accessible at the address of the server with the load balancer, even if the WordPress container itself is running on a different host.docker-compose.yml:

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)

You might also like
KEDA blogScaling Applications to Zero with Kubernetes and KEDA
prometheus monitoring atix blogDocker Swarm: A herd of containers
devopscon 2023 berlin, atix blogATIX at DevOpsCon 2023: Berlin
Kubernetes_TrainingGitOps – Kubernetes The Easy Way
DevOps Engineers: Between expectations and reality
prometheus monitoring atix blogPrometheus Monitoring—Fix It before It Breaks

ATIX-Crew
+ postsBio

Der ATIX-Crew besteht aus Leuten, die in unterschiedlichen Bereichen tätig sind: Consulting, Development/Engineering, Support, Vertrieb und Marketing.

  • ATIX-Crew
    https://atix.de/en/blog/author/atix-crew/
    Foreman Birthday Party 2024
  • ATIX-Crew
    https://atix.de/en/blog/author/atix-crew/
    CrewDay 2024
  • ATIX-Crew
    https://atix.de/en/blog/author/atix-crew/
    Navigating the XZ Security Vulnerability: A Comprehensive Guide
  • ATIX-Crew
    https://atix.de/en/blog/author/atix-crew/
    Automating Kafka with Ansible
Expertise that Drives your IT Forward

🎓 Webinars – Live & On-Demand
Knowledge on your schedule. Practical insights on DevOps, Open Source & IT automation.
👉 Explore now »

💡 Tackling complex IT challenges?
We consult — strategically and hands-on. Future-proof your IT with expert consulting.
👉 Learn more »

ISO Certified Certificate
Newsletter
Never miss anything again. Sign up for the ATIX newsletter!
Sign up now
Blog
  • Blog Start Page
  • ATIX Insights
  • Cloud Native
  • Container Plattformen und Cloud
  • DevOps
  • Infrastructure Automation
  • Linux Platform Operations
  • orcharhino
Privacy & Legal

Privacy Policy

Imprint

Terms and Conditions

B2B

Twitter     Facebook    LinkedIn    Xing     Youtube     mastodon=

© Copyright – ATIX AG

Scroll to top