Skip to content
Snippets Groups Projects
Commit 23d6460a authored by benjamin.gliech@etu.unistra.fr's avatar benjamin.gliech@etu.unistra.fr
Browse files

Added configs

parent 7281821e
No related merge requests found
# Group name
datacenter = "lune"
# Save the persistent data to /opt/consul. This directory is owned by the `consul` user.
data_dir = "/opt/consul"
node_name = "tiplouf"
# Allow clients to connect from any interface
client_addr = "0.0.0.0"
# Advertise the address of the VXLAN interface
advertise_addr = "172.16.19.100"
# Enable the web interface
ui_config {
enabled = true
}
# Whether it is running in server mode or not
server = true
# This server expects to be the only one in the cluster.
# Comment this line if this is not a server.
bootstrap_expect = 3
addresses {
# Bind the DNS service to the VXLAN interface
# We can't bind on 0.0.0.0, because systemd-resolved already listens on 127.0.0.53
dns = "172.16.19.100"
}
ports {
# Make the DNS service listen on port 53, instead of the default 8600
dns = 53
}
# List of upstream DNS servers to forward queries to
recursors = ["1.1.1.1", "1.0.0.1"]
\ No newline at end of file
job "HAProxy" {
type = "system"
group "loadbalancer" {
count = 1
network {
port "web" {
static = 8080
host_network = "vlan"
}
port "stats" {
static = 8081
host_network = "vlan"
}
}
service {
name = "HAProxy"
provider = "consul"
}
task "proxy" {
driver = "docker"
config {
image = "docker.io/library/haproxy:2.7"
ports = ["web", "stats"]
network_mode = "host"
mount {
type = "bind"
source = "local/config"
target = "/usr/local/etc/haproxy/haproxy.cfg"
}
}
template {
data =<<EOF
global
daemon
maxconn 1024
defaults
mode http
balance roundrobin
timeout client 60s
timeout connect 60s
timeout server 60s
frontend stats
bind *:8081
stats enable
stats uri /stats
stats refresh 10s
stats admin if TRUE
frontend http
bind *:8080
use_backend back if { req.hdr(host) -i "api-lune.100do.se" }
default_backend front
backend back
balance roundrobin
server-template back 1-10 _backend._tcp.service.consul resolvers consul check
backend front
balance roundrobin
server-template front 1-10 _frontend._tcp.service.consul resolvers consul check
resolvers consul
parse-resolv-conf
accepted_payload_size 8192
hold valid 5s
EOF
destination = "local/config/haproxy.cfg"
change_mode = "signal"
change_signal = "SIGHUP"
}
}
}
}
\ No newline at end of file
job "imgr" {
datacenters = ["lune"]
group "frontend" {
count = 1
scaling {
enabled = false
min = 1
max = 10
}
network {
port "front" {
to = 3000
host_network = "vlan"
}
}
task "web-front" {
driver = "docker"
config {
image = "docker.io/pinguee/cloud-frontend:1"
ports = ["front"]
mount {
type = "bind"
source = "local/config/config.json"
target = "/app/web/public/config.json"
}
}
template {
destination = "local/config/config.json"
data =<<EOF
{
"endpoint": "https://api-lune.100do.se"
}
EOF
}
resources {
cpu = 100
memory = 128
}
service {
name = "frontend"
provider = "consul"
port = "front"
check {
type = "http"
name = "health"
path = "/"
interval = "20s"
timeout = "5s"
}
}
}
}
group "backend" {
count = 1
scaling {
enabled = true
min = 1
max = 10
}
network {
port "back" {
to = 8080
host_network = "vlan"
}
}
task "web-back" {
driver = "docker"
config {
image = "docker.io/pinguee/cloud-web:1"
ports = ["back"]
}
env = {
CELERY_BROKER_URL = "amqp://lune:bHMQXYXRBuRopDkrd3X3@queue.internal.100do.se:5672/lune",
S3_ENDPOINT_URL = "https://s3.100do.se/",
AWS_ACCESS_KEY_ID = "rT6dyoko6qjAyQuHxtpm",
AWS_SECRET_ACCESS_KEY = "A0UTHyAo6oFqE0YWISDtTMlUMs7MXKPd9XdySKdn",
S3_BUCKET_NAME = "lune"
}
resources {
cpu = 200
memory = 512
}
service {
name = "backend"
provider = "consul"
port = "back"
check {
type = "http"
name = "health"
path = "/health"
interval = "20s"
timeout = "5s"
}
}
}
}
group "worker" {
count = 1
scaling {
enabled = true
min = 1
max = 10
}
task "worker" {
driver = "docker"
config {
image = "docker.io/pinguee/cloud-worker:1"
}
env = {
CELERY_BROKER_URL = "amqp://lune:bHMQXYXRBuRopDkrd3X3@queue.internal.100do.se:5672/lune",
S3_ENDPOINT_URL = "https://s3.100do.se/",
AWS_ACCESS_KEY_ID = "rT6dyoko6qjAyQuHxtpm",
AWS_SECRET_ACCESS_KEY = "A0UTHyAo6oFqE0YWISDtTMlUMs7MXKPd9XdySKdn",
S3_BUCKET_NAME = "lune"
}
resources {
cpu = 200
memory = 256
}
}
}
}
\ No newline at end of file
vrrp_instance VI_1 {
state MASTER
interface vxlan19
virtual_router_id 3
priority 255
advert_int 1
virtual_ipaddress {
172.16.19.110/24
}
}
\ No newline at end of file
# Group name
datacenter = "lune"
# Save the persistent data to /opt/nomad
data_dir = "/opt/nomad"
# Allow clients to connect from any interface
bind_addr = "0.0.0.0"
advertise {
# We explicitely advertise the IP on the vxlan interface
http = "172.16.19.100"
rpc = "172.16.19.100"
serf = "172.16.19.100"
}
# This node is a server, and expects to be the only server in the cluster
server {
enabled = true
bootstrap_expect = 3
}
client {
enabled = true
host_network "vlan"{
interface = "vxlan19"
}
}
# Connect to the local Consul agent
consul {
address = "127.0.0.1:8500"
}
# Show the UI and link to the Consul UI
ui {
enabled = true
consul {
ui_url = "https://lune.consul.100do.se/ui"
}
}
\ No newline at end of file
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