How use x-functions of swarm in kubernetes

Asking for help? Comment out what you need so we can get more information to help you!

Cluster information:

Kubernetes version: v1.15.11
Cloud being used: IBM CLOUD
Installation method:
Host OS: Ubuntu 18.06
CNI and version:
CRI and version:

Hi people!

I am migrating my environment from docker swarm to kuberentes, however I am having a difficulty in relation to the function I had in the swarm called x-functions that created a variable to which I could repeat the msm code snippet in other services just declaring this variable, I I managed to make some parts with configmaps but the specs of the containers in the deployment I can’t, has anyone been there? the kubernetes yml code was 10 times larger than the same yml code of the docker swarm.