Merge pull request #1293 from mattymo/kubelet_host_mode
Add host-based kubelet deployment
This commit is contained in:
commit
9e64267867
4 changed files with 47 additions and 3 deletions
|
@ -1,3 +1,6 @@
|
||||||
|
# Valid options: docker (default), rkt, or host
|
||||||
|
kubelet_deployment_type: docker
|
||||||
|
|
||||||
# change to 0.0.0.0 to enable insecure access from anywhere (not recommended)
|
# change to 0.0.0.0 to enable insecure access from anywhere (not recommended)
|
||||||
kube_apiserver_insecure_bind_address: 127.0.0.1
|
kube_apiserver_insecure_bind_address: 127.0.0.1
|
||||||
|
|
||||||
|
@ -47,4 +50,4 @@ kube_apiserver_node_port_range: "30000-32767"
|
||||||
kubelet_load_modules: false
|
kubelet_load_modules: false
|
||||||
|
|
||||||
##Support custom flags to be passed to kubelet
|
##Support custom flags to be passed to kubelet
|
||||||
kubelet_custom_flags: []
|
kubelet_custom_flags: []
|
||||||
|
|
10
roles/kubernetes/node/tasks/install_host.yml
Normal file
10
roles/kubernetes/node/tasks/install_host.yml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
---
|
||||||
|
- name: install | Copy kubelet from hyperkube container
|
||||||
|
command: "{{ docker_bin_dir }}/docker run --rm -v {{ bin_dir }}:/systembindir {{ hyperkube_image_repo }}:{{ hyperkube_image_tag }} /bin/cp -f /hyperkube /systembindir/kubelet"
|
||||||
|
register: kubelet_task_result
|
||||||
|
until: kubelet_task_result.rc == 0
|
||||||
|
retries: 4
|
||||||
|
delay: "{{ retry_stagger | random + 3 }}"
|
||||||
|
changed_when: false
|
||||||
|
tags: [hyperkube, upgrade]
|
||||||
|
notify: restart kubelet
|
|
@ -23,10 +23,11 @@ ExecStart={{ bin_dir }}/kubelet \
|
||||||
$DOCKER_SOCKET \
|
$DOCKER_SOCKET \
|
||||||
$KUBELET_NETWORK_PLUGIN \
|
$KUBELET_NETWORK_PLUGIN \
|
||||||
$KUBELET_CLOUDPROVIDER
|
$KUBELET_CLOUDPROVIDER
|
||||||
ExecStartPre=-{{ docker_bin_dir }}/docker rm -f kubelet
|
|
||||||
ExecReload={{ docker_bin_dir }}/docker restart kubelet
|
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=10s
|
RestartSec=10s
|
||||||
|
ExecStartPre=-{{ docker_bin_dir }}/docker rm -f kubelet
|
||||||
|
ExecReload={{ docker_bin_dir }}/docker restart kubelet
|
||||||
|
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
30
roles/kubernetes/node/templates/kubelet.host.service.j2
Normal file
30
roles/kubernetes/node/templates/kubelet.host.service.j2
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Kubernetes Kubelet Server
|
||||||
|
Documentation=https://github.com/GoogleCloudPlatform/kubernetes
|
||||||
|
{% if kube_network_plugin is defined and kube_network_plugin == "calico" %}
|
||||||
|
After=docker.service docker.socket calico-node.service
|
||||||
|
Wants=docker.socket calico-node.service
|
||||||
|
{% else %}
|
||||||
|
After=docker.service
|
||||||
|
Wants=docker.socket
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
EnvironmentFile={{kube_config_dir}}/kubelet.env
|
||||||
|
ExecStart={{ bin_dir }}/kubelet \
|
||||||
|
$KUBE_LOGTOSTDERR \
|
||||||
|
$KUBE_LOG_LEVEL \
|
||||||
|
$KUBELET_API_SERVER \
|
||||||
|
$KUBELET_ADDRESS \
|
||||||
|
$KUBELET_PORT \
|
||||||
|
$KUBELET_HOSTNAME \
|
||||||
|
$KUBE_ALLOW_PRIV \
|
||||||
|
$KUBELET_ARGS \
|
||||||
|
$DOCKER_SOCKET \
|
||||||
|
$KUBELET_NETWORK_PLUGIN \
|
||||||
|
$KUBELET_CLOUDPROVIDER
|
||||||
|
Restart=always
|
||||||
|
RestartSec=10s
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
Loading…
Reference in a new issue