  We study one-dimensional spin-1/2 models in which strict confinement of Ising
domain walls leads to the fragmentation of Hilbert space into exponentially
many disconnected subspaces. Whereas most previous works emphasize dipole
moment conservation as an essential ingredient for such fragmentation, we
instead require two commuting U(1) conserved quantities associated with the
total domain-wall number and the total magnetization. The latter arises
naturally from the confinement of domain walls. Remarkably, while some
connected components of the Hilbert space thermalize, others are integrable by
Bethe ansatz. We further demonstrate how this Hilbert-space fragmentation
pattern arises perturbatively in the confining limit of $\mathbb{Z}_2$ gauge
theory coupled to fermionic matter, leading to a hierarchy of time scales for
motion of the fermions. This model can be realized experimentally in two
complementary settings.
