container_manager variable to specify runtime.

This commit is contained in:
Takashi Okamoto 2018-08-28 06:23:38 +00:00
parent 5eb805f098
commit d407a590a6
11 changed files with 20 additions and 29 deletions

View file

@ -33,8 +33,8 @@
roles:
- { role: kubespray-defaults}
- { role: kubernetes/preinstall, tags: preinstall }
- { role: docker, tags: docker, when: manage_docker|default(true) }
- { role: cri-o, tags: crio, when: manage_crio }
- { role: docker, tags: docker, when: container_manager == 'docker' }
- { role: cri-o, tags: crio, when: container_manager == 'crio' }
- role: rkt
tags: rkt
when: "'rkt' in [etcd_deployment_type, kubelet_deployment_type, vault_deployment_type]"

View file

@ -26,7 +26,6 @@ skip_downloads: false
```
etcd_deployment_type: host
kubelet_deployment_type: host
manage_docker: false
manage_crio: true
container_manager: crio
```

View file

@ -135,13 +135,9 @@ skydns_server_secondary: "{{ kube_service_addresses|ipaddr('net')|ipaddr(4)|ipad
dnsmasq_dns_server: "{{ kube_service_addresses|ipaddr('net')|ipaddr(2)|ipaddr('address') }}"
dns_domain: "{{ cluster_name }}"
# Use docker as container runtime
# If you set manage_crio true, set manage_docker false.
manage_docker: true
# Use cri-o as container runtime
# If you set manage_docker true, set manage_crio false.
manage_crio: false
# Container runtime
# docker for docker and crio for cri-o.
container_manager: docker
# Path used to store Docker data
docker_daemon_graph: "/var/lib/docker"

View file

@ -15,6 +15,6 @@ discoveryTokenAPIServers:
discoveryTokenUnsafeSkipCAVerification: true
nodeRegistration:
name: {{ inventory_hostname }}
{% if manage_crio %}
{% if container_manager == 'crio' %}
criSocket: /var/run/crio/crio.sock
{% endif %}

View file

@ -138,6 +138,6 @@ nodeRegistration:
taints:
- effect: NoSchedule
key: node-role.kubernetes.io/master
{% if manage_crio %}
{% if container_manager == 'crio' %}
criSocket: /var/run/crio/crio.sock
{% endif %}

View file

@ -34,10 +34,10 @@ KUBELET_HOSTNAME="--hostname-override={{ kube_override_hostname }}"
--node-status-update-frequency={{ kubelet_status_update_frequency }} \
--cgroup-driver={{ kubelet_cgroup_driver|default(kubelet_cgroup_driver_detected) }} \
--max-pods={{ kubelet_max_pods }} \
{% if manage_docker %}
{% if container_manager == 'docker' %}
--docker-disable-shared-pid={{ kubelet_disable_shared_pid }} \
{% endif %}
{% if manage_crio %}
{% if container_manager == 'crio' %}
--container-runtime=remote \
--container-runtime-endpoint=/var/run/crio/crio.sock \
{% endif %}

View file

@ -15,7 +15,7 @@ KUBELET_HOSTNAME="--hostname-override={{ kube_override_hostname }}"
--cadvisor-port={{ kube_cadvisor_port }} \
--pod-infra-container-image={{ pod_infra_image_repo }}:{{ pod_infra_image_tag }} \
--node-status-update-frequency={{ kubelet_status_update_frequency }} \
{% if manage_docker %}
{% if container_manager == 'docker' %}
--docker-disable-shared-pid={{ kubelet_disable_shared_pid }} \
{% endif %}
--client-ca-file={{ kube_cert_dir }}/ca.pem \
@ -28,7 +28,7 @@ KUBELET_HOSTNAME="--hostname-override={{ kube_override_hostname }}"
{% if kube_version | version_compare('v1.7', '<') %}
--enable-cri={{ kubelet_enable_cri }} \
{% endif %}
{% if manage_crio %}
{% if container_manager == 'crio' %}
--container-runtime=remote \
--container-runtime-endpoint=/var/run/crio/crio.sock \
{% endif %}

View file

@ -131,13 +131,8 @@ kube_apiserver_insecure_port: 8080
# Aggregator
kube_api_aggregator_routing: false
# Docker options
# Optionally do not run docker role
manage_docker: true
# cri-o options
# Optionally run cri-o role
manage_crio: false
# Container for runtime
container_manager: docker
# Path used to store Docker data
docker_daemon_graph: "/var/lib/docker"

View file

@ -68,7 +68,7 @@
delay: 5
tags:
- crio
when: manage_crio
when: container_manager == 'crio'
- name: reset | gather mounted kubelet dirs
shell: mount | grep /var/lib/kubelet/ | awk '{print $3}' | tac

View file

@ -35,8 +35,9 @@
roles:
- { role: kubespray-defaults}
- { role: kubernetes/preinstall, tags: preinstall }
- { role: docker, tags: docker, when: manage_docker|default(true) }
- { role: cri-o, tags: crio, when: manage_crio }
- { role: docker, tags: docker, when: container_manager == 'docker' }
- { role: cri-o, tags: crio, when: container_manager == 'crio' }
- role: rkt
tags: rkt
when: "'rkt' in [etcd_deployment_type, kubelet_deployment_type, vault_deployment_type]"

View file

@ -34,8 +34,8 @@
roles:
- { role: kubespray-defaults}
- { role: kubernetes/preinstall, tags: preinstall }
- { role: docker, tags: docker, when: manage_docker|default(true) }
- { role: cri-o, tags: crio, when: manage_crio }
- { role: docker, tags: docker, when: container_manager == 'docker' }
- { role: cri-o, tags: crio, when: container_manager == 'crio' }
- role: rkt
tags: rkt
when: "'rkt' in [etcd_deployment_type, kubelet_deployment_type, vault_deployment_type]"