chore(elk): drop load balancer and use static ports
This commit is contained in:
parent
5f78d52eca
commit
eacdd1550a
1 changed files with 9 additions and 92 deletions
|
@ -14,13 +14,10 @@ job "elk" {
|
||||||
|
|
||||||
network {
|
network {
|
||||||
port "http" {
|
port "http" {
|
||||||
to = 9200
|
static = 9200
|
||||||
}
|
}
|
||||||
port "transport" {
|
port "transport" {
|
||||||
to = 9300
|
static = 9300
|
||||||
}
|
|
||||||
port "envoy_metrics" {
|
|
||||||
to = 9102
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,12 +42,6 @@ job "elk" {
|
||||||
memlock = "-1:-1"
|
memlock = "-1:-1"
|
||||||
}
|
}
|
||||||
|
|
||||||
mount {
|
|
||||||
type = "bind"
|
|
||||||
source = "local/unicast_hosts.txt"
|
|
||||||
target = "/usr/share/elasticsearch/config/unicast_hosts.txt"
|
|
||||||
}
|
|
||||||
|
|
||||||
mount {
|
mount {
|
||||||
type = "bind"
|
type = "bind"
|
||||||
source = "local/elasticsearch.yml"
|
source = "local/elasticsearch.yml"
|
||||||
|
@ -83,7 +74,10 @@ job "elk" {
|
||||||
publish_host: {{ env "NOMAD_HOST_IP_transport" }}
|
publish_host: {{ env "NOMAD_HOST_IP_transport" }}
|
||||||
publish_port: {{ env "NOMAD_HOST_PORT_transport" }}
|
publish_port: {{ env "NOMAD_HOST_PORT_transport" }}
|
||||||
discovery:
|
discovery:
|
||||||
seed_providers: file
|
seed_hosts:
|
||||||
|
- hestia.lan:9300
|
||||||
|
- neto.lan:9300
|
||||||
|
- nyx.lan:9300
|
||||||
path:
|
path:
|
||||||
data: {{ env "NOMAD_ALLOC_DIR" }}/data
|
data: {{ env "NOMAD_ALLOC_DIR" }}/data
|
||||||
repo:
|
repo:
|
||||||
|
@ -113,16 +107,6 @@ job "elk" {
|
||||||
destination = "local/elasticsearch.yml"
|
destination = "local/elasticsearch.yml"
|
||||||
}
|
}
|
||||||
|
|
||||||
template {
|
|
||||||
data = <<-EOF
|
|
||||||
{{ range service "elk-node-transport|any" }}
|
|
||||||
{{ .Address }}:{{ .Port }}{{ end }}
|
|
||||||
EOF
|
|
||||||
|
|
||||||
destination = "local/unicast_hosts.txt"
|
|
||||||
change_mode = "noop"
|
|
||||||
}
|
|
||||||
|
|
||||||
service {
|
service {
|
||||||
name = "elk-node-http"
|
name = "elk-node-http"
|
||||||
provider = "consul"
|
provider = "consul"
|
||||||
|
@ -180,9 +164,6 @@ job "elk" {
|
||||||
port "web" {
|
port "web" {
|
||||||
to = 5601
|
to = 5601
|
||||||
}
|
}
|
||||||
port "envoy_metrics" {
|
|
||||||
to = 9102
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
task "kibana" {
|
task "kibana" {
|
||||||
|
@ -214,8 +195,9 @@ job "elk" {
|
||||||
data = <<-EOF
|
data = <<-EOF
|
||||||
elasticsearch:
|
elasticsearch:
|
||||||
hosts:
|
hosts:
|
||||||
{{ range service "elk-node-http|any" }}
|
- https://hestia.lan:9200
|
||||||
- https://{{ .Address }}:{{ .Port }}{{ end }}
|
- https://neto.lan:9200
|
||||||
|
- https://nyx.lan:9200
|
||||||
publicBaseUrl: https://es.brmartin.co.uk
|
publicBaseUrl: https://es.brmartin.co.uk
|
||||||
username: ${ELASTICSEARCH_USERNAME}
|
username: ${ELASTICSEARCH_USERNAME}
|
||||||
password: ${ELASTICSEARCH_PASSWORD}
|
password: ${ELASTICSEARCH_PASSWORD}
|
||||||
|
@ -281,69 +263,4 @@ job "elk" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
group "lb" {
|
|
||||||
network {
|
|
||||||
port "web" {
|
|
||||||
static = 9200
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
task "nginx" {
|
|
||||||
driver = "docker"
|
|
||||||
|
|
||||||
config {
|
|
||||||
image = "nginx:1.27.4-alpine"
|
|
||||||
|
|
||||||
ports = ["web"]
|
|
||||||
|
|
||||||
mount {
|
|
||||||
type = "bind"
|
|
||||||
source = "local/nginx.conf"
|
|
||||||
target = "/etc/nginx/nginx.conf"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
resources {
|
|
||||||
cpu = 10
|
|
||||||
memory = 16
|
|
||||||
}
|
|
||||||
|
|
||||||
template {
|
|
||||||
data = <<-EOF
|
|
||||||
user nobody;
|
|
||||||
worker_processes auto;
|
|
||||||
pid /var/run/nginx.pid;
|
|
||||||
|
|
||||||
events {
|
|
||||||
worker_connections 1024;
|
|
||||||
}
|
|
||||||
|
|
||||||
stream {
|
|
||||||
upstream es {
|
|
||||||
{{- range service "elk-node-http" }}
|
|
||||||
server {{ .Address }}:{{ .Port }};{{- end }}
|
|
||||||
}
|
|
||||||
|
|
||||||
server {
|
|
||||||
listen {{ env "NOMAD_PORT_web" }};
|
|
||||||
proxy_pass es;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
|
|
||||||
destination = "local/nginx.conf"
|
|
||||||
# change_mode = "script"
|
|
||||||
# change_script {
|
|
||||||
# command = "/usr/sbin/nginx"
|
|
||||||
# args = ["-s", "reload"]
|
|
||||||
# }
|
|
||||||
}
|
|
||||||
|
|
||||||
service {
|
|
||||||
port = "web"
|
|
||||||
provider = "consul"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue