Skip to content

Commit

Permalink
remove dockerize in favor of Dockerfile, pid 1 fix
Browse files Browse the repository at this point in the history
also change default prometheus port from 9090 to 9191 to not conflict
with marathon-lb
  • Loading branch information
siggy committed Jan 19, 2017
1 parent ebf0370 commit 71138df
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 59 deletions.
27 changes: 23 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,31 @@
FROM grafana/grafana:3.1.1
MAINTAINER Buoyant, Inc. <hello@buoyant.io>

EXPOSE 3000 9191

RUN apt-get update && \
apt-get -y --no-install-recommends install curl
apt-get -y --no-install-recommends install curl wget

RUN mkdir -p /etc/grafana/dashboards
RUN mkdir -p /etc/prometheus

# prometheus setup

RUN wget https://github.com/prometheus/prometheus/releases/download/v1.4.1/prometheus-1.4.1.linux-amd64.tar.gz
RUN tar -xf /prometheus-1.4.1.linux-amd64.tar.gz

RUN cp /prometheus-1.4.1.linux-amd64/prometheus /bin/
RUN cp /prometheus-1.4.1.linux-amd64/promtool /bin/
RUN cp -a /prometheus-1.4.1.linux-amd64/console_libraries /etc/prometheus/
RUN cp -a /prometheus-1.4.1.linux-amd64/consoles /etc/prometheus/

RUN rm -rf /prometheus-1.4.1.linux-amd64*

COPY . /
COPY etc/grafana/dashboards/linkerd-viz-dashboard.json /usr/share/grafana/public/dashboards/home.json
# linkerd-viz setup

EXPOSE 3000 9090
COPY linkerd-viz /linkerd-viz
COPY */prometheus-*.yml /etc/prometheus/
COPY linkerd-viz-dashboard.json /etc/grafana/dashboards/linkerd-viz-dashboard.json
COPY linkerd-viz-dashboard.json /usr/share/grafana/public/dashboards/home.json

ENTRYPOINT [ "/linkerd-viz" ]
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,16 @@ your applications have been configured to route via linkerd. For more
information on getting started with linkerd have a look at our [Getting Started
guides](https://linkerd.io/getting-started/).

## Build and push Docker image
## Build Docker image

```bash
./dockerize [docker-tag]
docker build -t buoyantio/linkerd-viz:latest .
```

Default `docker-tag` is `buoyantio/linkerd-viz:latest`

## Local boot

```bash
docker run -p 3000:3000 -p 9090:9090 buoyantio/linkerd-viz
docker run -p 3000:3000 -p 9191:9191 buoyantio/linkerd-viz
```

## DC/OS Deploy
Expand Down
4 changes: 2 additions & 2 deletions dcos/linkerd-viz.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
],
"portDefinitions": [
{
"port": 9090,
"port": 9191,
"protocol": "tcp",
"name": "stats"
},
Expand All @@ -37,6 +37,6 @@
"requirePorts": true,
"env": {
"PUBLIC_PORT": "3000",
"STATS_PORT": "9090"
"STATS_PORT": "9191"
}
}
41 changes: 0 additions & 41 deletions dockerize

This file was deleted.

8 changes: 4 additions & 4 deletions k8s/linkerd-viz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ spec:
- name: PUBLIC_PORT
value: "3000"
- name: STATS_PORT
value: "9090"
value: "9191"
ports:
- name: grafana
containerPort: 3000
- name: prometheus
containerPort: 9090
containerPort: 9191

- name: kubectl
image: buoyantio/kubectl:v1.4.0
Expand All @@ -50,7 +50,7 @@ spec:
port: 80
targetPort: 3000
- name: prometheus
port: 9090
targetPort: 9090
port: 9191
targetPort: 9191
selector:
name: linkerd-viz
6 changes: 3 additions & 3 deletions linkerd-viz
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

PLATFORM="${1:-dcos}"
PUBLIC_PORT="${PUBLIC_PORT:-3000}"
STATS_PORT="${STATS_PORT:-9090}"
STATS_PORT="${STATS_PORT:-9191}"

#
# init grafana
Expand Down Expand Up @@ -53,10 +53,10 @@ curl -vX POST -d "${prometheus_data_source}" -H "Content-Type: application/json"
curl -vX PUT -d"{\"theme\": \"dark\"}" -H "Content-Type: application/json" http://localhost:$PUBLIC_PORT/api/org/preferences

#
# init prometheus
# init prometheus, exec as pid 1
#

/bin/prometheus \
exec /bin/prometheus \
-config.file=/etc/prometheus/prometheus-$PLATFORM.yml \
-storage.local.path=/prometheus \
-web.console.libraries=/etc/prometheus/console_libraries \
Expand Down

0 comments on commit 71138df

Please sign in to comment.