Fixes #15: Add kubelet extra args to the correct file for 1.11 and beyond.

This commit is contained in:
Jeff Geerling 2018-09-06 23:52:02 -05:00
parent 0141762b92
commit dcea1bfe57
3 changed files with 6 additions and 5 deletions

View File

@ -27,8 +27,9 @@ Kubernetes packages to be installed on the server. You can either provide a list
Whether the particular server will serve as a Kubernetes `master` (default) or `node`. The master will have `kubeadm init` run on it to intialize the entire K8s control plane, while `node`s will have `kubeadm join` run on them to join them to the `master`. Whether the particular server will serve as a Kubernetes `master` (default) or `node`. The master will have `kubeadm init` run on it to intialize the entire K8s control plane, while `node`s will have `kubeadm join` run on them to join them to the `master`.
kubernetes_kubelet_extra_args: "" kubernetes_kubelet_extra_args: ""
kubernetes_kubelet_extra_args_config_file: /etc/default/kubelet
Extra args to pass to `kubelet` during startup. E.g. to allow `kubelet` to start up even if there is swap is enabled on your server, set this to: `"--fail-swap-on=false"`. Extra args to pass to `kubelet` during startup. E.g. to allow `kubelet` to start up even if there is swap is enabled on your server, set this to: `"--fail-swap-on=false"`. Or to specify the node-ip advertised by `kubelet`, set this to `"--node-ip={{ ansible_host }}"`.
kubernetes_allow_pods_on_master: True kubernetes_allow_pods_on_master: True

View File

@ -11,6 +11,7 @@ kubernetes_packages:
kubernetes_role: master kubernetes_role: master
kubernetes_kubelet_extra_args_config_file: /etc/default/kubelet
kubernetes_kubelet_extra_args: "" kubernetes_kubelet_extra_args: ""
kubernetes_allow_pods_on_master: True kubernetes_allow_pods_on_master: True

View File

@ -17,10 +17,9 @@
- name: Configure KUBELET_EXTRA_ARGS. - name: Configure KUBELET_EXTRA_ARGS.
lineinfile: lineinfile:
path: /etc/systemd/system/kubelet.service.d/10-kubeadm.conf path: '{{ kubernetes_kubelet_extra_args_config_file }}'
line: 'Environment="KUBELET_EXTRA_ARGS={{ kubernetes_kubelet_extra_args }}"' line: 'KUBELET_EXTRA_ARGS={{ kubernetes_kubelet_extra_args }}'
regexp: 'Environment="KUBELET_EXTRA_ARGS=' regexp: 'KUBELET_EXTRA_ARGS='
insertafter: '^Environment='
state: present state: present
register: kubelet_unit_file register: kubelet_unit_file