It's an ionic bond because potassium is a metal and chlorine is a non-metal so the potassium donates an electron to the chlorine and so the potassium becomes a positive ion and the chlorine becomes a negative chloride ion. Opposite ion charges attract so an ionic lattice is formed.