Skip to content

Commit

Permalink
fix: add debugging tools to ftl-controller image (#475)
Browse files Browse the repository at this point in the history
Fixes #441
  • Loading branch information
alecthomas authored Oct 11, 2023
1 parent e238a52 commit 42ecbaf
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 9 deletions.
7 changes: 5 additions & 2 deletions Dockerfile.controller
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ RUN make build/release/ftl
# Finally create the runtime image.
FROM ubuntu:22.04

RUN apt update
RUN apt install -y curl postgresql-client iputils-ping vim

WORKDIR /root/

COPY --from=builder /src/build/release/ftl-controller .
Expand All @@ -34,8 +37,8 @@ RUN mkdir deployments

EXPOSE 8892

ENV FTL_CONTROLLER_BIND="http://0.0.0.0:8899"
ENV FTL_CONTROLLER_ADVERTISE="http://127.0.0.1:8899"
ENV FTL_CONTROLLER_BIND="http://0.0.0.0:8892"
ENV FTL_CONTROLLER_ADVERTISE="http://127.0.0.1:8892"
ENV FTL_CONTROLLER_ALLOW_ORIGIN="*"
ENV FTL_CONTROLLER_DSN="postgres://host.docker.internal/ftl?sslmode=disable&user=postgres&password=secret"

Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.runner
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ RUN mkdir deployments
EXPOSE 8894

ENV FTL_ENDPOINT="http://host.docker.internal:8892"
ENV FTL_RUNNER_BIND="http://0.0.0.0:8899"
ENV FTL_RUNNER_ADVERTISE="http://127.0.0.1:8899"
ENV FTL_RUNNER_BIND="http://0.0.0.0:8893"
ENV FTL_RUNNER_ADVERTISE="http://127.0.0.1:8893"

CMD ["/root/ftl-runner", "--language=kotlin", "--language=go", "--template-dir=template", "--deployment-dir=deployments"]
File renamed without changes.
2 changes: 1 addition & 1 deletion bin/go
2 changes: 1 addition & 1 deletion bin/gofmt
9 changes: 6 additions & 3 deletions deployment/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Create a k3d cluster with a local Docker registry

```
#
#
k3d registry create registry.localhost --port 5000
k3d cluster create --api-port 6550 -p "8892:80@loadbalancer" --agents 2 \
--registry-use k3d-registry.localhost:5000 \
Expand Down Expand Up @@ -42,7 +42,7 @@ If the controller is not up, check the logs:
```
$ kubectl logs -f deployment/ftl-controller
info: Starting FTL controller
info: Listening on http://0.0.0.0:8899
info: Listening on http://0.0.0.0:8892
info: Starting DB listener
```

Expand All @@ -55,18 +55,21 @@ make docker-controller
```

Tag the image for the local registry:

```
docker tag ghcr.io/tbd54566975/ftl-controller:latest localhost:5000/ftl-controller
```

Push the image to the local registry:

```
docker push localhost:5000/ftl-controller
```

## Debugging

To exec into the k3d node:

```
docker exec -it k3d-k3s-default-server-0 sh
```
Expand All @@ -87,4 +90,4 @@ List all the things:

```
kubectl get deployment,pod,statefulset,svc,configmap,pv,pvc,ingress -o wide
```
```

0 comments on commit 42ecbaf

Please sign in to comment.