Yes, you should leave headspace when packing kimchi. A headspace of about 1-2 inches (2.5-5 cm) is recommended to allow for fermentation and expansion.
Kimchi is a fermented food, and during fermentation, it produces gases. If you don't leave enough headspace in the jar, the pressure from these gases can build up and cause the jar to leak, or even explode in extreme cases. Leaving 1-2 inches of space between the top of the kimchi and the lid allows these gases to accumulate without causing a dangerous buildup of pressure. This also provides room for the kimchi to expand slightly as it ferments. Make sure the kimchi is submerged in its brine to prevent mold growth. You can use a clean weight, like a small glass jar or a fermentation weight, to keep the kimchi submerged. After packing, gently press down on the kimchi to release any trapped air bubbles.
When packing kimchi, use a clean utensil to avoid introducing unwanted bacteria that could spoil the fermentation process. Always sanitize your jars and equipment thoroughly before starting.