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

Fixes to bring up the stack using docker-compose #26

Closed
wants to merge 6 commits into from
Closed
Changes from 5 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
89 changes: 79 additions & 10 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -10,8 +10,8 @@ services:
environment:
FACILITY: ${FACILITY:-lab1}
PACKET_ENV: ${PACKET_ENV:-testing}
PACKET_VERSION: ${PACKET_VERSION:-5efab5ef3a42cb88f2d54f4ed3201c2dd6797b7d}
ROLLBAR_TOKEN: ${ROLLBAR_TOKEN:-9b78d0ad01d1467aa92c49c3a349b79d}
PACKET_VERSION: ${PACKET_VERSION:-ignored}
ROLLBAR_TOKEN: ${ROLLBAR_TOKEN:-ignored}
ROLLBAR_DISABLE: ${ROLLBAR_DISABLE:-0}
MAX_WORKFLOW_DATA_VERSIONS: 5
PGDATABASE: tinkerbell
@@ -21,8 +21,7 @@ services:
PGSSLMODE: disable
PGUSER: tinkerbell
depends_on:
- "certs"
- "db"
- db
healthcheck:
test: ["CMD-SHELL", "wget -qO- 127.0.0.1:42114/cert"]
interval: 5s
@@ -69,6 +68,9 @@ services:
driver: fluentd
options:
tag: tinkerbell-cli
depends_on:
- db
- tinkerbell
network_mode: host

registry:
@@ -86,24 +88,75 @@ services:
REGISTRY_AUTH_HTPASSWD_PATH: /auth/htpasswd
volumes:
- ./certs:/certs
depends_on:
- fluentbit
logging:
driver: fluentd
options:
tag: registry
network_mode: host

cacher:
build: ../cacher
environment:
FACILITY: ${FACILITY:-lab1}
PACKET_API_AUTH_TOKEN: ${PACKET_API_AUTH_TOKEN}
PACKET_API_URL: ${PACKET_API_URL}
PACKET_CONSUMER_TOKEN: ${PACKET_CONSUMER_TOKEN:-ignored}
PACKET_ENV: testing
PACKET_VERSION: ${PACKET_VERSION:-ignored}
PGDATABASE: tinkerbell
PGHOST: db
PGPASSWORD: tinkerbell
PGPORT: 5432
PGSSLMODE: disable
PGUSER: tinkerbell
ROLLBAR_TOKEN: ${ROLLBAR_TOKEN:-ignored}
depends_on:
- db
logging:
driver: fluentd
options:
tag: cacher
volumes:
- ./certs:/certs/${FACILITY}
ports:
- 42111:42111/tcp
- 42112:42112/tcp

hegel:
build: ../hegel
network_mode: host
environment:
ROLLBAR_TOKEN: ${ROLLBAR_TOKEN:-ignored}
ROLLBAR_DISABLE: 1
PACKET_ENV: testing
PACKET_VERSION: ${PACKET_VERSION:-ignored}
GRPC_PORT: 42115
HEGEL_FACILITY: ${FACILITY:-lab1}
HEGEL_USE_TLS: 0
CACHER_CERT_URL: http://127.0.0.1:42112/cert
CACHER_GRPC_AUTHORITY: 127.0.0.1:42111
depends_on:
- cacher
- fluentbit
logging:
driver: fluentd
options:
tag: hegel

boots:
build:
context: ../boots
network_mode: host
command: -dhcp-addr 0.0.0.0:67 -tftp-addr 127.0.0.1:69 -http-addr 127.0.0.1:80 -log-level DEBUG
environment:
API_AUTH_TOKEN: ${PACKET_API_AUTH_TOKEN:-PcyR6MvHb7wMmyYf9p8dJ2Dvnb9HxX8E}
API_CONSUMER_TOKEN: ${PACKET_CONSUMER_TOKEN:-djR2TAvbnkY92i8Ea2KFMZW6MusW1fk7qzeCUHgtnQRSsXnqxoCr6V2vhSxpqASf}
API_CONSUMER_TOKEN: ${PACKET_CONSUMER_TOKEN:-ignored}
FACILITY_CODE: ${FACILITY:-lab1}
PACKET_ENV: ${PACKET_ENV:-testing}
PACKET_VERSION: ${PACKET_VERSION:-5efab5ef3a42cb88f2d54f4ed3201c2dd6797b7d}
ROLLBAR_TOKEN: ${ROLLBAR_TOKEN:-9b78d0ad01d1467aa92c49c3a349b79d}
PACKET_VERSION: ${PACKET_VERSION:-ignored}
ROLLBAR_TOKEN: ${ROLLBAR_TOKEN:-ignored}
ROLLBAR_DISABLE: ${ROLLBAR_DISABLE:-0}
MIRROR_HOST: ${MIRROR_HOST:-127.0.0.1}
DNS_SERVERS: 8.8.8.8
@@ -115,15 +168,18 @@ services:
DOCKER_REGISTRY: 127.0.0.1
REGISTRY_USERNAME: username
REGISTRY_PASSWORD: password
CACHER_GRPC_AUTHORITY: 127.0.0.1:42111
CACHER_CERT_URL: http://127.0.0.1:42112/cert
TINKERBELL_GRPC_AUTHORITY: 127.0.0.1:42113
TINKERBELL_CERT_URL: http://127.0.0.1:42114/cert
ELASTIC_SEARCH_URL: 127.0.0.1:9200
depends_on:
- tinkerbell
- cacher
- fluentbit
logging:
driver: fluentd
options:
tag: tinkerbell
tag: boots
ports:
- 127.0.0.1:80:80/tcp
- 67:67/udp
@@ -144,7 +200,7 @@ services:
- elasticsearch
restart: always
environment:
ELASTICSEARCH_URL: http://elasticsearch:9200
ELASTICSEARCH_HOSTS: http://elasticsearch:9200
ports:
- 5601:5601

@@ -158,3 +214,16 @@ services:
volumes:
- ./fluent-bit.conf:/fluent-bit/etc/fluent-bit.conf

nginx:
image: nginx:alpine
restart: unless-stopped
tty: true
ports:
- $NGINX_IP:80:80/tcp
volumes:
- /packet/nginx/:/usr/share/nginx/html/
logging:
driver: fluentd
options:
tag: nginx

41 changes: 33 additions & 8 deletions fluent-bit.conf
Original file line number Diff line number Diff line change
@@ -9,39 +9,64 @@
[OUTPUT]
Name es
Match db
Host 0.0.0.0
Host elasticsearch
Port 9200
Index db
Type db

[OUTPUT]
Name es
Match registry
Host 0.0.0.0
Host elasticsearch
Port 9200
Index registry
Type registry

[OUTPUT]
Name es
Match tinkerbell
Host 0.0.0.0
Match cacher
Host elasticsearch
Port 9200
Index tinkerbell
Type tinkerbell
Index cacher
Type cacher

[OUTPUT]
Name es
Match hegel
Host elasticsearch
Port 9200
Index hegel
Type hegel


[OUTPUT]
Name es
Match boots
Host elasticsearch
Port 9200
Index boots
Type boots

[OUTPUT]
Name es
Match tinkerbell-cli
Host 0.0.0.0
Host elasticsearch
Port 9200
Index tinkerbell-cli
Type tinkerbell-cli

[OUTPUT]
Name es
Match nginx
Host elasticsearch
Port 9200
Index nginx
Type nginx

[OUTPUT]
Name es
Match tinkerbell-server
Host 0.0.0.0
Host elasticsearch
Port 9200
Index tinkerbell-server
Type tinkerbell-server
13 changes: 4 additions & 9 deletions registry/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
FROM registry:2 AS auth
FROM registry:2
ARG REGISTRY_USERNAME
ARG REGISTRY_PASSWORD
RUN mkdir /auth \
&& htpasswd -Bbn ${REGISTRY_USERNAME} ${REGISTRY_PASSWORD} > /auth/htpasswd

FROM registry:2
RUN mkdir -p /certs /auth
COPY --from=auth /auth/htpasswd /auth
EXPOSE 443

RUN mkdir -p /certs /auth
RUN htpasswd -Bbn ${REGISTRY_USERNAME} ${REGISTRY_PASSWORD} > /auth/htpasswd
EXPOSE 443