The Ward identity states that in a QED process with amplitude $\mathcal{M}(k)$ with one external photon with momentum $k$, given that we can write $\mathcal{M}(k)=\epsilon_\mu(k)\mathcal{M}^\mu(k)$ in terms of the photon polarization $\epsilon^\mu$, if we replace $\epsilon_\mu$ by $k_\mu$ we get $$k_\mu\mathcal{M}^{\mu}=0.$$
Now, in Peskin's book he says:
The identity is generally not true for individual Feynman diagrams; we must sum over the diagrams for $\mathcal{M}(k)$ at any given order.
So as I understand, given a specific process, if we pick all diagrams at a given specific order $a$ and compute the total amplitude $\mathcal{M}(k)$ then the Ward identity is satisfied.
One example is the vacuum polarization at second order. We have just one diagram which gives $\Pi_2^{\mu\nu}(k)$ not counting the external photons. Then since there's just this diagram at order two, we have $k_\mu \Pi^{\mu\nu}_2(k)=0$.
That much is clear. Now, in Peskin's book he does something else. He considers all 1PI insertions into the vacuum polarization diagram. In other words, he considers all one-particle irreducible diagrams with two external legs, and sum them all up.
The resulting diagram has a value which he calls $i\Pi^{\mu\nu}(k)$, being $k$ the external photon momentum.
Now, he claims that the Ward identity holds here in the sense that $k_\mu \Pi^{\mu\nu}(k)=0$. But now wait a minute: the Ward identity holds for amplitudes for processes, when we sum all diagrams to a given order.
In this case we are not summing all diagrams to a given order. Actually in this sum of 1PIs we have several orders mixed up, and furthermore, not all diagrams of all orders are there.
What justifies saying that the Ward identity applies in the sense that $k_\mu \Pi^{\mu\nu}(k)=0$ where $\Pi^{\mu\nu}$ is the sum of all one-particle irreducible diagrams with two external photon legs?