Preheat oven to 350
Place a layer of potatoes in an overlapping pattern and season with salt, pepper, 1/3 of the pesto, 1/3 of the chopped garlic and 1/3 of the fresh thyme and 1/3 of the Parmesan cheese.
Repeat this until you have at least 3 layers of potatoes.
Sprinkle the top with a little more salt and pepper sprinkle the Gruyere cheese on top.
Pour the kefir and heavy cream on top of the potatoes. The liquid should reach come up to the bottom part of the top layer.
Bake, covered with a piece of foil, for 30 minutes. Remove the foil and continue to bake for 30 minutes more until the top is golden brown and then potatoes are fully cooked. Serve immediately.