Kubespray ansible extra args for pods specifications are not deployed on the target k8s cluster

606 Views Asked by At

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?

1

There are 1 best solutions below

4
zigarn On

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.yml and inventory/<mycluster>/group_vars/k8s-cluster/k8s-cluster.yml for the configuration of your cluster.

Where inventory/<mycluster> is a copy of the kubespray provided inventory/sample folder with adaptations of the inventory.ini file and files inside group_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/-i option or defaults.inventory config.

For example, if your inventory is the file config/inventory, you need to copy the sample inventory group_vars in config/group_vars.