Kozak resigned his post on his own free accord, and this was subsequently accepted by Putin — as ultimately confirmed in the presidential decree issued later in the day.
Kozak was most likely pushed out for being the sole voice that was willing to challenge Putin's increasingly hardline on Ukraine, as well as other domestic matters.