A 20L would be cramped but doable for an adult male king, females get too long. It would work for a baby/juvie for quite a while.
Remember that king snakes are pretty active so if you give them a larger enclosure with lots of stuff to climb on, they will use it.