Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

Invadium UI is blank #25

Open
agardnerIT opened this issue Oct 14, 2022 · 5 comments
Open

Invadium UI is blank #25

agardnerIT opened this issue Oct 14, 2022 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@agardnerIT
Copy link

image

To Reproduce

# Ubuntu box
# update docker compose otherwise it moans about version
sudo apt update  < "/dev/null"
sudo apt install -y ca-certificates curl gnupg lsb-release  < "/dev/null"
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update  < "/dev/null"
sudo apt install -y docker-compose-plugin  < "/dev/null"

# Clone Repo
git clone https://github.com/dynatrace-oss/invadium

# Start
cd invadium
docker compose up --no-build -d

Env details

$ whoami
root
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.3 LTS
Release:        20.04
Codename:       focal
@agardnerIT agardnerIT added the bug Something isn't working label Oct 14, 2022
@blu3r4y
Copy link
Member

blu3r4y commented Oct 14, 2022

Hi Adam, thanks for reporting this! :)

Since I am travelling right now, it might take a few more days until I will have time to take a look at this one.

@blu3r4y blu3r4y self-assigned this Oct 14, 2022
@blu3r4y
Copy link
Member

blu3r4y commented Oct 24, 2022

Deploying with the default docker-compose.yaml currently only supports a local deployment, meaning, it assumes that you host Invadium on 127.0.0.1 and not some other hostname.

I suppose you are exposing Invadium on a different hostname and trying to access it there?

Here is a docker-compose.yaml that works in this scenario, however, you need to know your hostname in advance.
Replace your-invadium-hostname with the hostname where you are running Invadium.
We add the following two environment variables:

  1. INVADIUM_CORS_ORIGINS in the backend to allow the frontend to access it
  2. NEXT_BACKEND_API_URL to tell the frontend where it can reach the backend
version: '3.8'

services:
  invadium-backend:
    container_name: invadium-backend
    image: ghcr.io/dynatrace-oss/invadium-backend:latest
    build: backend
    env_file: ./backend/.env
    environment:
      - INVADIUM_CONFIG_PATH=/config
      - INVADIUM_DOCKER_NETWORK=host
      - INVADIUM_CORS_ORIGINS=["http://your-invadium-hostname:3000"]
    ports:
      - 3001:3001
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - ./exploits/config:/config
  invadium-frontend:
    container_name: invadium-frontend
    image: ghcr.io/dynatrace-oss/invadium-frontend:latest
    build: frontend
    environment:
      - NEXT_BACKEND_API_URL=http://your-invadium-hostname:3001
    ports:
      - 3000:3000

I understand that this isn't the most user-friendly way to deploy Invadium, partly because Invadium is best used within a Kubernetes cluster. I will look at possible ways to fix this or at least improve the docs.

@agardnerIT
Copy link
Author

agardnerIT commented Nov 2, 2022

Actually a k8s cluster is better for me. Still struggling...

K3D_VERSION=v5.3.0
KUBECTL_VERSION=v1.22.6

# Start with a plain ubuntu box

# 1. Install kubectl and k3d
curl -LO https://dl.k8s.io/release/$KUBECTL_VERSION/bin/linux/amd64/kubectl
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl

curl -s https://raw.githubusercontent.com/rancher/k3d/main/install.sh | TAG=$K3D_VERSION bash
k3d cluster create myinvadium -p "3000:3000@loadbalancer" --k3s-arg "--no-deploy=traefik@server:*"

# 3. clone invadium
git clone https://github.com/dynatrace-oss/invadium
cd invadium

# Skaffold run...
skaffold run -p localdev

Output

Generating tags...
 - invadium-backend -> invadium-backend:v1.0.0-4-ga1948d8
 - invadium-frontend -> invadium-frontend:v1.0.0-4-ga1948d8
Checking cache...
 - invadium-backend: Found Locally
 - invadium-frontend: Found Locally
Starting test...
Tags used in deployment:
 - invadium-backend -> invadium-backend:8884620ef6e7436bbde547a81224d63d8c2dcb3cf07e301d7be9e9fcacf45ff3
 - invadium-frontend -> invadium-frontend:f6f5b4013bd1450a6991839f0de06c9bc7e31df1a76749a1668407f99b581413
Starting deploy...
Loading images into k3d cluster nodes...
Images loaded in 105ns
 - namespace/invadium unchanged
 - configmap/invadium-config created
 - serviceaccount/invadium-backend-sa created
 - role.rbac.authorization.k8s.io/invadium-backend-sa created
 - rolebinding.rbac.authorization.k8s.io/invadium-backend-sa created
 - persistentvolumeclaim/invadium-pvc created
 - service/invadium-backend created
 - deployment.apps/invadium-backend created
 - service/invadium-frontend created
 - deployment.apps/invadium-frontend created
 - ingress.networking.k8s.io/invadium-ingress created
Waiting for deployments to stabilize...
 - invadium:deployment/invadium-frontend: container invadium is waiting to start: invadium-frontend:f6f5b4013bd1450a6991839f0de06c9bc7e31df1a76749a1668407f99b581413 can't be pulled
    - invadium:pod/invadium-frontend-fb4469c69-whgfv: container invadium is waiting to start: invadium-frontend:f6f5b4013bd1450a6991839f0de06c9bc7e31df1a76749a1668407f99b581413 can't be pulled
 - invadium:deployment/invadium-frontend failed. Error: container invadium is waiting to start: invadium-frontend:f6f5b4013bd1450a6991839f0de06c9bc7e31df1a76749a1668407f99b581413 can't be pulled.
1/2 deployment(s) failed

docker images output

$ docker images
REPOSITORY          TAG                                                                IMAGE ID       CREATED          SIZE
invadium-backend    8884620ef6e7436bbde547a81224d63d8c2dcb3cf07e301d7be9e9fcacf45ff3   8884620ef6e7   11 minutes ago   227MB
invadium-backend    v1.0.0-4-ga1948d8                                                  8884620ef6e7   11 minutes ago   227MB
invadium-frontend   f6f5b4013bd1450a6991839f0de06c9bc7e31df1a76749a1668407f99b581413   f6f5b4013bd1   11 minutes ago   178MB
invadium-frontend   v1.0.0-4-ga1948d8                                                  f6f5b4013bd1   11 minutes ago   178MB
rancher/k3d-tools   5.3.0                                                              d0192770fd1c   9 months ago     18.7MB
rancher/k3d-proxy   5.3.0                                                              f40280353248   9 months ago     42.4MB
rancher/k3s         v1.22.6-k3s1                                                       a4d87cf1b1e3   9 months ago     167MB

So invadium-frontend:f6f........413 is available...

@agardnerIT
Copy link
Author

Please ignore above, I have a working k8s in-browser demo here...

https://killercoda.com/agardnerit/scenario/invadium

@blu3r4y
Copy link
Member

blu3r4y commented Nov 2, 2022

So you managed to resolve the issue?

Furthermore, I am curious about your use cases with Invadium, open to chat some day ;)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants