The main issue is with sodium. The normal rate of sodium excretion is slowed by high carbohydrate intake, both because the resulting glucose attracts water, which needs to be balanced with sodium, and because the resulting high insulin level affects the kidneys and stimulates them to excrete sodium more slowly. In the absence of carbohydrate, the kidneys return to the normal faster rate of excreting sodium.
The other issue with sodium is that government recommendations for salt intake are too low, according to recent research. The U.S. recommendation is particularly inadequate. A healthy person is healthiest when consuming 4-6 grams a day of sodium, according to several studies that have come out in the past few years. This translates to 10-15 g/day of table salt (sodium chloride), including the salt already present in food. The lower we go below that range, the more steeply the health risk rises; as we increase intake above that range, the risk rises, but not as steeply (they call this a J-shaped curve).
Interestingly, the healthy range for people with salt-sensitive hypertension appears to be the same, but above the range, the risk rises just as steeply for such people as it does when they go below (a U-shaped curve).
The point of all this is that in most people on a ketogenic diet, keeping salt intake up will eliminate most of the symptoms you report, because the bodily mechanisms that control the level of salt in blood and cells work in conjunction with the mechanisms that control the levels of potassium, magnesium, and calcium. Most people can get enough of these latter minerals in their diet if they are eating enough salt.
Populations that consume a fair amount of blood get enough salt in their diet that they do not need to salt their food (as Stefansson reported about the Inuit), but other cultures have had to make a point of getting salt (the word “salary” derives from the salt allowance given to Roman soldiers as part of their pay).