Why would there be a war? Large parts of the country seem very resentful towards California. Seems like both sides would be happier without each other.
Edit: I obviously don't think a Calexit will happen but I'm just curious why you think it would result in a war.
There'd be a war because of ports, military facilities, oil, and, because, politically California may on average be more slightly liberal than the rest of the US, but overall it looks a lot like the US as a whole, with very liberal coastal enclaves and an ultraconservative inland agricultural heartland, and much of the latter would revolt from California to stay in the US in the event of an attempted Calexit.
Even if there wouldn't be a physical war, there would be no reason to expect free trade, free movement, shared currency or a stable replacement currency.
Edit: I obviously don't think a Calexit will happen but I'm just curious why you think it would result in a war.