Merge pull request #3320 from riverzhang/kubelet
Support dynamic kubelet config
This commit is contained in:
commit
2730c90dcd
6 changed files with 31 additions and 0 deletions
|
@ -154,6 +154,14 @@ k8s_image_pull_policy: IfNotPresent
|
||||||
# audit log for kubernetes
|
# audit log for kubernetes
|
||||||
kubernetes_audit: false
|
kubernetes_audit: false
|
||||||
|
|
||||||
|
# dynamic kubelet configuration
|
||||||
|
dynamic_kubelet_configuration: false
|
||||||
|
|
||||||
|
# define kubelet config dir for dynamic kubelet
|
||||||
|
#kubelet_config_dir:
|
||||||
|
default_kubelet_config_dir: "{{ kube_config_dir }}/dynamic_kubelet_dir"
|
||||||
|
dynamic_kubelet_configuration_dir: "{{ kubelet_config_dir | default(default_kubelet_config_dir) }}"
|
||||||
|
|
||||||
# pod security policy (RBAC must be enabled either by having 'RBAC' in authorization_modes or kubeadm enabled)
|
# pod security policy (RBAC must be enabled either by having 'RBAC' in authorization_modes or kubeadm enabled)
|
||||||
podsecuritypolicy_enabled: false
|
podsecuritypolicy_enabled: false
|
||||||
|
|
||||||
|
|
|
@ -150,3 +150,7 @@ nodeRegistration:
|
||||||
{% if container_manager == 'crio' %}
|
{% if container_manager == 'crio' %}
|
||||||
criSocket: /var/run/crio/crio.sock
|
criSocket: /var/run/crio/crio.sock
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if dynamic_kubelet_configuration %}
|
||||||
|
featureGates:
|
||||||
|
DynamicKubeletConfig: true
|
||||||
|
{% endif %}
|
||||||
|
|
|
@ -32,6 +32,13 @@
|
||||||
tags:
|
tags:
|
||||||
- kubelet
|
- kubelet
|
||||||
|
|
||||||
|
- name: Make sure dynamic kubelet configuration directory is writeable
|
||||||
|
file:
|
||||||
|
path: "{{ dynamic_kubelet_configuration_dir }}"
|
||||||
|
mode: 0600
|
||||||
|
state: directory
|
||||||
|
when: dynamic_kubelet_configuration
|
||||||
|
|
||||||
- name: Write kubelet config file (kubeadm)
|
- name: Write kubelet config file (kubeadm)
|
||||||
template:
|
template:
|
||||||
src: kubelet.kubeadm.env.j2
|
src: kubelet.kubeadm.env.j2
|
||||||
|
|
|
@ -48,6 +48,9 @@ KUBELET_HOSTNAME="--hostname-override={{ kube_override_hostname }}"
|
||||||
{% else %}
|
{% else %}
|
||||||
--fail-swap-on={{ kubelet_fail_swap_on|default(true)}} \
|
--fail-swap-on={{ kubelet_fail_swap_on|default(true)}} \
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if dynamic_kubelet_configuration %}
|
||||||
|
--dynamic-config-dir={{ dynamic_kubelet_configuration_dir }} \
|
||||||
|
{% endif %}
|
||||||
--runtime-cgroups={{ kubelet_runtime_cgroups }} --kubelet-cgroups={{ kubelet_kubelet_cgroups }} \
|
--runtime-cgroups={{ kubelet_runtime_cgroups }} --kubelet-cgroups={{ kubelet_kubelet_cgroups }} \
|
||||||
{% endset %}
|
{% endset %}
|
||||||
|
|
||||||
|
|
|
@ -136,6 +136,14 @@ kube_apiserver_port: 6443
|
||||||
kube_apiserver_insecure_bind_address: 127.0.0.1
|
kube_apiserver_insecure_bind_address: 127.0.0.1
|
||||||
kube_apiserver_insecure_port: 8080
|
kube_apiserver_insecure_port: 8080
|
||||||
|
|
||||||
|
# dynamic kubelet configuration
|
||||||
|
dynamic_kubelet_configuration: false
|
||||||
|
|
||||||
|
# define kubelet config dir for dynamic kubelet
|
||||||
|
#kubelet_config_dir:
|
||||||
|
default_kubelet_config_dir: "{{ kube_config_dir }}/dynamic_kubelet_dir"
|
||||||
|
dynamic_kubelet_configuration_dir: "{{ kubelet_config_dir | default(default_kubelet_config_dir) }}"
|
||||||
|
|
||||||
# Aggregator
|
# Aggregator
|
||||||
kube_api_aggregator_routing: false
|
kube_api_aggregator_routing: false
|
||||||
|
|
||||||
|
|
|
@ -10,5 +10,6 @@ kube_network_plugin: weave
|
||||||
kubeadm_enabled: true
|
kubeadm_enabled: true
|
||||||
deploy_netchecker: true
|
deploy_netchecker: true
|
||||||
kubernetes_audit: true
|
kubernetes_audit: true
|
||||||
|
dynamic_kubelet_configuration: true
|
||||||
kubedns_min_replicas: 1
|
kubedns_min_replicas: 1
|
||||||
cloud_provider: gce
|
cloud_provider: gce
|
||||||
|
|
Loading…
Reference in a new issue