Skip to content

Commit

Permalink
Use host network for compose, document service account setup
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Edgar <[email protected]>
  • Loading branch information
MikeEdgar committed May 16, 2024
1 parent 637a4a4 commit 0960bc8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 17 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,15 @@ file and credentials to connect to the Kubernetes cluster where Strimzi and Kafk
CONSOLE_API_SERVICE_ACCOUNT_TOKEN=<TOKEN>
CONSOLE_API_KUBERNETES_API_SERVER_URL=https://my-kubernetes-api.example.com:6443
```
The service account token may be obtain using the `kubectl create token` command. For example, to create a token
that expires in 1 year:
The service account token may be obtain using the `kubectl create token` command. For example, to create a service account
named "console-server" (from [console-server.serviceaccount.yaml](./install/resources/console/console-server.serviceaccount.yaml)
with the correct permissions and a token that expires in 1 year ([yq](https://github.com/mikefarah/yq/releases) required):
```shell
kubectl create token <service account name> -n <service account namespace> --duration=$((365*24))h
export NAMESPACE=<service account namespace>
kubectl apply -n ${NAMESPACE} -f ./install/resources/console/console-server.clusterrole.yaml
kubectl apply -n ${NAMESPACE} -f ./install/resources/console/console-server.serviceaccount.yaml
yq '.subjects[0].namespace = strenv(NAMESPACE)' ./install/resources/console/console-server.clusterrolebinding.yaml | kubectl apply -n ${NAMESPACE} -f -
kubectl create token console-server -n ${NAMESPACE} --duration=$((365*24))h
```

3. By default, the provided configuration will use the latest console release container images. If you would like to
Expand Down
21 changes: 7 additions & 14 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -1,34 +1,27 @@
---
version: '3.9'

networks:
streams-console:
driver: bridge

services:
console-api:
image: ${CONSOLE_API_IMAGE}
hostname: api
container_name: console-api
network_mode: host
volumes:
- ${PWD}/console-config.yaml:/deployments/console-config.yaml:z
environment:
CONSOLE_CONFIG_PATH: /deployments/console-config.yaml
QUARKUS_KUBERNETES_CLIENT_API_SERVER_URL: ${CONSOLE_API_KUBERNETES_API_SERVER_URL}
QUARKUS_KUBERNETES_CLIENT_TRUST_CERTS: "true"
QUARKUS_KUBERNETES_CLIENT_TOKEN: ${CONSOLE_API_SERVICE_ACCOUNT_TOKEN}
networks:
- streams-console

console-ui:
image: ${CONSOLE_UI_IMAGE}
hostname: ui
container_name: console-ui
ports:
- "3000:3000"
network_mode: host
environment:
HOSTNAME: localhost
PORT: 3005
CONSOLE_METRICS_PROMETHEUS_URL: ${CONSOLE_METRICS_PROMETHEUS_URL}
NEXTAUTH_SECRET: ${CONSOLE_UI_NEXTAUTH_SECRET}
NEXTAUTH_URL: http://localhost:3000
BACKEND_URL: http://api:8080/
networks:
- streams-console
NEXTAUTH_URL: http://localhost:3005
BACKEND_URL: http://localhost:8080/

0 comments on commit 0960bc8

Please sign in to comment.