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

SERVICE_CHECK_HTTP not passing in Headers environment variable #659

Open
smarshal-Quest opened this issue Apr 22, 2019 · 0 comments
Open

Comments

@smarshal-Quest
Copy link

  • What version of docker are you running?
    Docker version 17.03.2-ce, build f5ec1e2
    docker-compose version 1.6.2, build 4d72027
  • What version of registrator are you running?
    v7
  • Did you build a custom version of registrator? If so, what is that image?
    no (gliderlabs/registrator:v7)
  • What is the exact command you are running registrator with?
    registrator:
    image: gliderlabs/registrator:v7
    command: -ip="${BIND_ADDRESS}" consul://localhost:8500
    network_mode: host
    restart: always
    depends_on:
    - consul
    volumes:
    - /var/run/docker.sock:/tmp/docker.sock
  • What is the exact command you are running your container with?
  • A log capture of all the docker events before, during, and after the issue.
  • If relevant, Dockerfile for application that is having issues.

Description of the problem:
SERVICE_CHECK_HTTP with
SERVICE_CHECK_HEADER .

registrator is ignoring the header env when bringing up the container. the service check is being registered, but with headers null,
(https://www.consul.io/api/agent/check.html)

How reproducible:

running with docker compose
environment:
"SERVICE_9200_NAME=es-http"
- 'SERVICE_9200_CHECK_HEADER={"Authorization": ["Basic "]}'
- "SERVICE_9200_CHECK_HTTP=/_cluster/health"
- "SERVICE_9200_CHECK_INTERVAL=15s"
- "SERVICE_9200_CHECK_TIMEOUT=3s"
- 'SERVICE_9200_TAGS=LISTEN=9200/http'

Steps to Reproduce:

Actual Results:
cat consul/data/checks/3f365d12ffa259886d19020ee38f94f8 | jq -c
{"Check":{"Node":"swarm-agentpool-sm01sboxwestus2000003","CheckID":"service:swarm-agentpool-sm01sboxwestus2000003:es-master:9200","Name":"Service 'es-http' check","Status":"critical","Notes":"","Output":"","ServiceID":"swarm-agentpool-sm01sboxwestus2000003:es-master:9200","ServiceName":"es-http","ServiceTags":["LISTEN=9200/http"],"Definition":{},"CreateIndex":0,"ModifyIndex":0},"ChkType":{"CheckID":"","Name":"","Status":"","Notes":"","ScriptArgs":null,"HTTP":"http://10.0.0.7:32782/_cluster/health","Header":null,"Method":"","TCP":"","Interval":15000000000,"AliasNode":"","AliasService":"","DockerContainerID":"","Shell":"","GRPC":"","GRPCUseTLS":false,"TLSSkipVerify":false,"Timeout":3000000000,"TTL":0,"DeregisterCriticalServiceAfter":0},"Token":""}

Expected Results:
cat consul/data/checks/3f365d12ffa259886d19020ee38f94f8 | jq -c
{"Check":{"Node":"swarm-agentpool-sm01sboxwestus2000003","CheckID":"service:swarm-agentpool-sm01sboxwestus2000003:es-master:9200","Name":"Service 'es-http' check","Status":"critical","Notes":"","Output":"","ServiceID":"swarm-agentpool-sm01sboxwestus2000003:es-master:9200","ServiceName":"es-http","ServiceTags":["LISTEN=9200/http"],"Definition":{},"CreateIndex":0,"ModifyIndex":0},"ChkType":{"CheckID":"","Name":"","Status":"","Notes":"","ScriptArgs":null,"HTTP":"http://10.0.0.7:32782/_cluster/health","Header":{"Authorization": ["Basic "]},"Method":"","TCP":"","Interval":15000000000,"AliasNode":"","AliasService":"","DockerContainerID":"","Shell":"","GRPC":"","GRPCUseTLS":false,"TLSSkipVerify":false,"Timeout":3000000000,"TTL":0,"DeregisterCriticalServiceAfter":0},"Token":""}

Additional info:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant