Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

task: enable connect proxy for JVB to autoscaler #524

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ job [[ template "job_name" . ]] {
count = 1

network {
mode = "bridge"
# This requests a dynamic port named "http". This will
# be something like "46283", but we refer to it via the
# label "http".
Expand All @@ -43,6 +44,9 @@ job [[ template "job_name" . ]] {
port "colibri" {
to = 9090
}
port "metrics_envoy" {
to = 9102
}
}

service {
Expand All @@ -62,10 +66,26 @@ job [[ template "job_name" . ]] {
public_ip = "${meta.public_ip}"
group = "${NOMAD_META_group}"
jvb_pool_mode = "[[ or (env "CONFIG_jvb_pool_mode") "shard" ]]"
metrics_port_envoy = "${NOMAD_HOST_PORT_metrics_envoy}"
}

port = "http"

connect {
sidecar_service {
proxy {
config {
# Expose metrics for prometheus (envoy)
envoy_prometheus_bind_addr = "0.0.0.0:9102"
}
upstreams {
destination_name = "autoscaler"
local_bind_port = 2223
}
}
}
}

check {
name = "health"
type = "http"
Expand Down Expand Up @@ -201,7 +221,8 @@ EOF
JVB_INSTANCE_ID = "${NOMAD_SHORT_ALLOC_ID}"
LOCAL_ADDRESS = "${attr.unique.network.ip-address}"
AUTOSCALER_SIDECAR_PORT = "6000"
AUTOSCALER_URL = "https://${meta.cloud_name}-autoscaler.jitsi.net"
AUTOSCALER_URL = "http://localhost:2223"
# AUTOSCALER_URL = "https://${meta.cloud_name}-autoscaler.jitsi.net"
AUTOSCALER_SIDECAR_KEY_FILE = "/secrets/asap.key"
AUTOSCALER_SIDECAR_REGION = "${meta.cloud_region}"
AUTOSCALER_SIDECAR_GROUP_NAME = "${NOMAD_META_group}"
Expand Down
10 changes: 10 additions & 0 deletions nomad/telegraf.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,16 @@ EOF
host = "{{"{{"}}.Node}}"
shard-role = "docker-dhmirror"
role = "docker-dhmirror"
# uncomment for consul connect envoy sidecar metrics (~1700 per sidecar)
# [[inputs.prometheus.consul.query]]
# name = "jvb-sidecar-proxy"
# tag = "ip-{{ env "attr.unique.network.ip-address" }}"
# url = 'http://{{"{{"}}if ne .ServiceAddress ""}}{{"{{"}}.ServiceAddress}}{{"{{"}}else}}{{"{{"}}.Address}}{{"{{"}}end}}:{{"{{"}}with .ServiceMeta.metrics_port_envoy}}{{"{{"}}.}}{{"{{"}}else}}{{"{{"}}.ServicePort}}{{"{{"}}end}}/metrics'
# [inputs.prometheus.consul.query.tags]
# host = "{{"{{"}}.Node}}"
# shard-role = "jvb-envoy"
# role = "jvb-envoy"


[[inputs.prometheus]]
namepass = [
Expand Down