Add Consul Template

This commit is contained in:
galal-hussein 2016-02-18 02:04:51 +02:00
parent bc07f1db46
commit 8d40e8253c
5 changed files with 105 additions and 0 deletions

View File

@ -0,0 +1,29 @@
# Consul Cluster
### Info:
This template creates 3 Consul nodes that uses RPC encryption with TLS and gossip encryption to secure connection between consul cluster nodes, configuration is generated with confd from Rancher metadata.
TLS is used to verify the authenticity of the servers and the clients using the verify_incoming and verify_outgoing options.
The variables used in this template include:
- Certificates and keys for Consul nodes.
- CA certificate.
- 16-bytes, Base64 encoded gossip encryption key.
The templates uses two Docker images one as the main image and the other one is the sidekick:
- [consul](https://github.com/galal-hussein/consul-rancher).
- [consul-config](https://github.com/galal-hussein/consul-config).
### Usage:
Select Consul from catalog.
Enter the certificates and keys for consul nodes, ca certificates, and the encryption key.
Click deploy.
The consul nodes will be bound to the Rancher managed network IPs.

View File

@ -0,0 +1,15 @@
consul-conf:
image: husseingalal/consul-config
labels:
io.rancher.container.hostname_override: container_name
volumes_from:
- consul
net: "container:consul"
consul:
image: husseingalal/consul
labels:
io.rancher.sidekicks: consul-conf
volumes:
- /opt/rancher/ssl
- /opt/rancher/config
- /var/consul

View File

@ -0,0 +1,56 @@
.catalog:
name: "Consul"
description: "Secure Consul cluster"
version: "0.6-rancher1"
uuid: consul-0
questions:
- variable: ca_crt
label: "CA certificate"
type: "multiline"
required: true
- variable: consul1_key
label: "First consul key"
type: "multiline"
required: true
- variable: consul1_crt
label: "First consul certificate"
type: "multiline"
required: true
- variable: consul2_key
label: "Second consul key"
type: "multiline"
required: true
- variable: consul2_crt
label: "Second consul certificate"
type: "multiline"
required: true
- variable: consul3_key
label: "Third consul key"
type: "multiline"
required: true
- variable: consul3_crt
label: "Third consul certificate"
type: "multiline"
required: true
- variable: gossip_key
label: "Communication gossip key"
type: "multiline"
required: true
consul:
scale: 3
metadata:
ca.crt: |
${ca_crt}
consul1.crt: |
${consul1_crt}
consul1.key: |
${consul1_key}
consul2.crt: |
${consul2_crt}
consul2.key: |
${consul2_key}
consul3.crt: |
${consul3_crt}
consul3.key: |
${consul3_key}
enc.key: "${gossip_key}"

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

View File

@ -0,0 +1,5 @@
name: Consul Cluster
description: |
Consul cluster
version: 0.6-rancher1
category: Clustering