Formation of collisionless shocks in magnetized plasma interaction with kinetic-scale obstacles