MicroK8s Keyboard Layout changes when I am under 'Exec' on a pod on Dashboard. How can I fix this?

I have a problem that is driving me crazy.

I have a pt-PT (Portuguese) keyboard layout, when I access my MicroK8s Kubernetes Dashboard and go to Pod > Exec and try to execute commands the keyboard layout changes to en_US (I am not sure if it’s this layout but 100% it changes).

This basically cuts my workflow because I need to write at the side and copy past for things basic as : or “”.

Does someone know what causes this and how to fix it?

It may have something to do with the environment Locale of the image you are connected to.
Perhaps try setting the environment variables when you’re inside the container.

Btw, changing contents inside a running container is going to go away when the pod dies or exited. I suggest that you think of a different way to navigate around your need without having to exec into the pod.

This is just the nature of how containers are. When you download a container, you are downloading a pre-configured environment and most are built to be as slim as possible. So when you execute /bin/bash or /bin/sh in the container, you are in that environment.

You can always just execute the commands you need instead of bash or sh like this:

$ kubectl exec -it some-pod-name -c container -- cmd-in-container --and --flags

Alternatively you can build and pull your own images in which you have set your own system locales, but this seems more inconvenient that just pushing through the locale problem itself.