juice-shop / multi-juicer

Host and manage multiple Juice Shop instances for security trainings and Capture The Flags
Apache License 2.0
268 stars 121 forks source link

Cannot create Team on OpenShift 4.11.59 #223

Open bastien-reinhardt opened 3 months ago

bastien-reinhardt commented 3 months ago

Expected Behavior

Follow installation guide for Openshift and Multi-Juicer should work.

Current Behavior

Follow installation guide. "Step: Creating a Team" does not work.

JuiceBalancer Pod Logs: time="2024-05-31T07:47:47.425Z" level="info" msg="JuiceBalancer listening on port 3000!" time="2024-05-31T07:50:20.649Z" level="info" msg="Team test doesn't have a JuiceShop deployment yet" time="2024-05-31T07:50:20.741Z" level="info" msg="Reached 0/10 instances" time="2024-05-31T07:50:23.533Z" level="info" msg="Creating JuiceShop Deployment for team 'test'" time="2024-05-31T07:50:23.723Z" level="error" msg="Error while creating deployment or service for team test" time="2024-05-31T07:50:23.723Z" level="error" msg="deployments.apps "t-test-juiceshop" is forbidden: cannot set blockOwnerDeletion if an ownerReference refers to a resource you can't set finalizers on: , "

Possible Solution

This solution works for me. As per RedHat Solution add the "update" verb to the "deployments/finalizers" ressources on the "juice-balancer" namespace role. The role should look like this:

rules:
  - verbs:
      - get
      - create
      - list
      - delete
      - patch
      - update
    apiGroups:
      - apps
    resources:
      - deployments
      - deployments/finalizers
  - verbs:
      - get
      - create
      - delete
    apiGroups:
      - ''
    resources:
      - services
  - verbs:
      - get
      - list
      - delete
    apiGroups:
      - ''
    resources:
      - pods

I hope this helps others :)

Cheers

J12934 commented 3 months ago

Hi @bastien-reinhardt

Thanks for the pointer. Could you maybe open a or adding this role to the chart?

This should not impact normal Kubernetes users and would make it easier for openshift users to install MJ 👍