-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lens: adds zipkin-uiproxy image and fixes ZIPKIN_UI_BASEPATH (#3751)
Signed-off-by: Adrian Cole <adrian@tetrate.io>
- Loading branch information
1 parent
e16d38e
commit 2bbc4bb
Showing
23 changed files
with
278 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# | ||
# Copyright The OpenZipkin Authors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
# uses 2.4 so we can use condition: service_healthy | ||
version: "2.4" | ||
|
||
services: | ||
zipkin: | ||
# Use last build of Zipkin instead of adding a matrix build dependency | ||
image: ghcr.io/openzipkin/zipkin-slim:master | ||
container_name: zipkin | ||
environment: | ||
ZIPKIN_UI_BASEPATH: /admin/zipkin | ||
# Use fixed service and container name 'sut; so our test script can copy/pasta | ||
sut: | ||
# This is the image just built. It is not in a remote repository. | ||
image: openzipkin/zipkin-ui:test | ||
container_name: sut | ||
environment: | ||
ZIPKIN_UI_BASEPATH: /admin/zipkin | ||
depends_on: | ||
zipkin: | ||
condition: service_healthy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# | ||
# Copyright The OpenZipkin Authors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
# This file uses the version 2 docker-compose file format, described here: | ||
# https://docs.docker.com/compose/compose-file/#version-2 | ||
# | ||
# It extends the default configuration from docker-compose.yml, hosting the | ||
# ui on port 80 using NGINX | ||
|
||
version: '2.4' | ||
|
||
services: | ||
zipkin-uiproxy: | ||
image: ghcr.io/openzipkin/zipkin-uiproxy:${TAG:-latest} | ||
container_name: zipkin-uiproxy | ||
environment: | ||
# This allows hitting the UI on the host by http://localhost/admin/zipkin | ||
- ZIPKIN_UI_BASEPATH=/admin/zipkin | ||
ports: | ||
- 80:80 | ||
depends_on: | ||
zipkin: | ||
condition: service_healthy | ||
|
||
zipkin: | ||
extends: | ||
file: docker-compose.yml | ||
service: zipkin | ||
environment: | ||
# This must match what's set in zipkin-uiproxy | ||
- ZIPKIN_UI_BASEPATH=/admin/zipkin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# | ||
# Copyright The OpenZipkin Authors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
# Use latest version here: https://github.com/orgs/openzipkin/packages/container/package/alpine | ||
# This is defined in many places because Docker has no "env" script functionality unless you use | ||
# docker-compose: When updating, update everywhere. | ||
ARG alpine_version=3.19.1 | ||
|
||
# java_version is used during the installation process to build or download the zipkin-lens jar. | ||
# | ||
# Use latest version here: https://github.com/orgs/openzipkin/packages/container/package/java | ||
# This is defined in many places because Docker has no "env" script functionality unless you use | ||
# docker-compose: When updating, update everywhere. | ||
ARG java_version=21.0.2_p13 | ||
|
||
# We copy files from the context into a scratch container first to avoid a problem where docker and | ||
# docker-compose don't share layer hashes https://github.com/docker/compose/issues/883 normally. | ||
# COPY --from= works around the issue. | ||
FROM scratch as scratch | ||
|
||
COPY build-bin/ /build-bin/ | ||
COPY build-bin/docker/docker-healthcheck /docker-bin/ | ||
COPY docker/test-images/zipkin-uiproxy/start-nginx /docker-bin/ | ||
COPY docker/test-images/zipkin-uiproxy/nginx.conf /conf.d/zipkin.conf.template | ||
|
||
FROM ghcr.io/openzipkin/alpine:$alpine_version as zipkin-uiproxy | ||
LABEL org.opencontainers.image.description="NGINX on Alpine Linux proxying the Zipkin UI with proxy_pass" | ||
# Use latest from https://pkgs.alpinelinux.org/packages?name=nginx | ||
ARG nginx_version=1.24.0 | ||
LABEL nginx-version=$nginx_version | ||
|
||
ENV ZIPKIN_UI_BASEPATH=/zipkin | ||
ENV ZIPKIN_BASE_URL=http://zipkin:9411 | ||
|
||
# Add HEALTHCHECK and ENTRYPOINT scripts into the default search path | ||
COPY --from=scratch /docker-bin/* /usr/local/bin/ | ||
# We use start period of 30s to avoid marking the container unhealthy on slow or contended CI hosts | ||
HEALTHCHECK --interval=1s --start-period=30s --timeout=5s CMD ["docker-healthcheck"] | ||
ENTRYPOINT ["start-nginx"] | ||
|
||
# Setup NGINX | ||
COPY --from=scratch /conf.d/ /etc/nginx/conf.d/ | ||
RUN apk add --update --no-cache nginx=~${nginx_version} && \ | ||
mkdir -p /var/tmp/nginx && chown -R nginx:nginx /var/tmp/nginx | ||
|
||
# Usually, we read env set from pid 1 to get docker-healthcheck parameters. However, NGINX wipes the | ||
# env, so we need to expose it in the Dockerfile instead. | ||
ENV HEALTHCHECK_PORT=80 | ||
EXPOSE 80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
## zipkin-uiproxy Docker image | ||
|
||
The `zipkin-uiproxy` testing image proxies the Zipkin UI with NGINX. | ||
|
||
Besides norms defined in [docker-alpine](https://github.com/openzipkin/docker-alpine), this accepts the | ||
following environment variables: | ||
|
||
* `ZIPKIN_UI_BASEPATH`: The path this proxy serves the UI under. Defaults to /zipkin | ||
* `ZIPKIN_BASE_URL`: The proxied zipkin base URL. Defaults to http://zipkin:9411 | ||
|
||
To build `openzipkin/zipkin-ui:test`, from the top-level of the repository, run: | ||
```bash | ||
$ DOCKER_FILE=docker/test-images/zipkin-uiproxy/Dockerfile build-bin/docker/docker_build openzipkin/zipkin-uiproxy:test | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
user nginx nginx; | ||
worker_processes 2; | ||
|
||
error_log /dev/stdout warn; | ||
pid /var/run/nginx.pid; | ||
|
||
daemon off; | ||
|
||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
|
||
http { | ||
include /etc/nginx/mime.types; | ||
default_type application/octet-stream; | ||
|
||
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' | ||
'$status $body_bytes_sent "$http_referer" ' | ||
'"$http_user_agent" "$http_x_forwarded_for"'; | ||
|
||
access_log /dev/stdout main; | ||
|
||
sendfile on; | ||
|
||
keepalive_timeout 65; | ||
|
||
gzip on; | ||
gzip_types application/javascript application/json text/css; | ||
|
||
server_tokens off; | ||
|
||
server { | ||
listen 80; | ||
|
||
root /var/www/html; | ||
|
||
index index.html; | ||
|
||
# Make site accessible from http://set-ip-address.xip.io | ||
server_name localhost; | ||
|
||
charset utf-8; | ||
|
||
# start-nginx overrides /zipkin to $ZIPKIN_UI_BASEPATH | ||
location /zipkin { | ||
# start-nginx overrides the base url to $ZIPKIN_BASE_URL | ||
proxy_pass http://localhost:9411/zipkin; | ||
proxy_redirect default; | ||
} | ||
|
||
# Pass through health check to the proxy for our docker HEALTHCHECK | ||
location /health { | ||
expires 1s; | ||
access_log off; | ||
error_log off; | ||
# start-nginx overrides the base url to $ZIPKIN_BASE_URL | ||
proxy_pass http://localhost:9411; | ||
} | ||
|
||
|
||
location = /favicon.ico { log_not_found off; access_log off; } | ||
location = /robots.txt { access_log off; log_not_found off; } | ||
|
||
# Deny .htaccess file access | ||
location ~ /\.ht { | ||
deny all; | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/sh | ||
# | ||
# Copyright The OpenZipkin Authors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
sed -e "s~proxy_pass http://localhost:9411~proxy_pass ${ZIPKIN_BASE_URL}~g" \ | ||
-e "s~location /zipkin~location ${ZIPKIN_UI_BASEPATH}~g" \ | ||
/etc/nginx/conf.d/zipkin.conf.template > /etc/nginx/nginx.conf | ||
|
||
echo Starting NGINX | ||
exec nginx "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
Oops, something went wrong.