Preheat the oven to 200C.
Peel the potatoes and cut into 1cm thick slices. Place them into a pan of cold water and season with salt. Bring to the boil and cook until tender.
Drain the cooked potatoes and leave to steam dry.
Heat some oil in a large pan then add the butter. Once it melts add the onion and cook for about 5 minutes, or until it softens.
Chuck in the garlic and cook for a further minute, then add in the plain flour. Stir well and cook for 2 more minutes.
Pour in the milk and add the grated cheese. Stir well and cook over a medium heat until the cheese has melted, and you have a smooth, thick sauce.
Add the Dijon mustard, chopped up ham, and chopped parsley. Stir well and taste for seasoning.
Lay half of the potatoes along the bottom of a pie dish, then spoon over half of the cheesy sauce. Repeat for another layer.
Brush water around the edge of the pie dish, then lay over the puff pastry. Press down the edges and cut away and excess. (Leave a little bit of overhang as the pastry will shrink as it cooks)
Brush the egg yolk over, then cut two slits in the top. Bake it for 35 minutes, or until golden and crisp. Dish it up, and enjoy.