According to this documentation, Extra flags for the API server, controller, and scheduler components can be specified using the variables below, in the form of dicts of key-value pairs of configuration parameters that will be inserted into the kubeadm YAML config file:
- kube_kubeadm_apiserver_extra_args
- kube_kubeadm_controller_extra_args
- kube_kubeadm_scheduler_extra_args
But I can't really figure out where to add them in ansible playbooks so that they can be rendered on the master node during the cluster deloyment.
I tried using this file kubespray/roles/kubernetes/master/defaults/main/main.yml and this file kubespray/roles/kubespray-defaults/defaults/main.yaml but it doesn't work for none of the two files, ansible doesn't deploy them, like if ansible doesn't read them.
Where the kubeadm YAML config file is located?
Can someone here help with these parameters management?
As documented on https://kubespray.io/#/docs/ansible?id=group-vars-and-overriding-variables-precedence, you should take a look at
inventory/<mycluster>/group_vars/all/all.ymlandinventory/<mycluster>/group_vars/k8s-cluster/k8s-cluster.ymlfor the configuration of your cluster.Where
inventory/<mycluster>is a copy of the kubespray providedinventory/samplefolder with adaptations of theinventory.inifile and files insidegroup_vars.Kubespray use the inventory layout proposed in https://docs.ansible.com/ansible/latest/user_guide/sample_setup.html#alternative-directory-layout
Whatever your layout, for group_vars to be loaded, the have to be in the same folder as the file referenced by the
--inventory-file/--inventory/-ioption ordefaults.inventoryconfig.For example, if your inventory is the file
config/inventory, you need to copy the sample inventory group_vars inconfig/group_vars.