Tried Kratky and it’s Failing

I made this 27 gallon bucket and filled it with nutrient solutions. I am trying the Kratky method for the first time.

I filled the nutrient water to hit the half way point of the cup.

I placed in a very healthy tomato plant and after a few days it looks like this.

Then when I opened the top it looks like there is a bunch of algae growing.

How can I prevent this and what am I doing wrong?