Added the consul UI to the proxy service. Consul is now available at
http://localhost/consul on the docker host.
Also tweaked the startup options for portainer to ensure that the logo
is visible, the logo wasn't using one of the standard endpoints in
portainer.
Change-Id: I0633ff4184b4e61df37fbcdeff1094c8f8dea7a3
diff --git a/compose/docker-compose-system-test.yml b/compose/docker-compose-system-test.yml
index 7f12258..fb6385f 100644
--- a/compose/docker-compose-system-test.yml
+++ b/compose/docker-compose-system-test.yml
@@ -277,6 +277,8 @@
depends_on:
- consul
- grafana
+ - chameleon
+ - portainer
restart: unless-stopped
volumes:
- "/cord/incubator/voltha/nginx_config:/nginx_config"
@@ -290,9 +292,8 @@
- "9000:9000"
environment:
CONSUL_ADDR: "${DOCKER_HOST_IP}:8500"
- depends_on:
- - nginx
restart: unless-stopped
+ entrypoint: ["/portainer", "--logo", "/docker/images/logo_alt.png"]
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
diff --git a/nginx_config/includes/consul.conf b/nginx_config/includes/consul.conf
new file mode 100644
index 0000000..d8d0d7a
--- /dev/null
+++ b/nginx_config/includes/consul.conf
@@ -0,0 +1,27 @@
+location /ui {
+ proxy_pass http://api-consul/;
+ rewrite /ui/(.*) /ui/$1 break;
+ proxy_next_upstream error timeout invalid_header http_500;
+}
+
+location /v1 {
+ proxy_pass http://api-consul/;
+ rewrite /v1/(.*) /v1/$1 break;
+ proxy_next_upstream error timeout invalid_header http_500;
+}
+
+location /consul {
+ proxy_pass http://api-consul/;
+ rewrite /consul/(.*) /$1 break;
+ sub_filter "/ui" "/consul/ui";
+ sub_filter "/v1" "/consul/v1";
+ #sub_filter "//" "/";
+ #sub_filter "href='" "href='swagger/";
+ #sub_filter 'href="' 'href="swagger/';
+ #sub_filter "src='" "src='swagger/";
+ #sub_filter 'src="' 'src="swagger/';
+ #sub_filter "/api/v1" "/swagger/api/v1";
+ sub_filter_once off;
+ proxy_next_upstream error timeout invalid_header http_500;
+}
+
diff --git a/nginx_config/nginx-upstreams.ctmpl b/nginx_config/nginx-upstreams.ctmpl
index ec2ce12..0bd9f95 100644
--- a/nginx_config/nginx-upstreams.ctmpl
+++ b/nginx_config/nginx-upstreams.ctmpl
@@ -8,6 +8,11 @@
server {{.Address}}:{{.Port}};
{{end}}
}
+upstream api-consul {
+ {{range service "consul-rest" "any"}}
+ server {{.Address}}:{{.Port}};
+ {{end}}
+}
upstream api-docker {
{{range service "portainer" "any"}}
server {{.Address}}:{{.Port}};