Adding initial rkt support
This commit is contained in:
parent
98ae1ee393
commit
18715b2116
9 changed files with 63 additions and 1 deletions
|
@ -28,6 +28,7 @@
|
||||||
roles:
|
roles:
|
||||||
- { role: kubernetes/preinstall, tags: preinstall }
|
- { role: kubernetes/preinstall, tags: preinstall }
|
||||||
- { role: docker, tags: docker }
|
- { role: docker, tags: docker }
|
||||||
|
- { role: rkt, tags: rkt }
|
||||||
|
|
||||||
- hosts: etcd:!k8s-cluster
|
- hosts: etcd:!k8s-cluster
|
||||||
any_errors_fatal: true
|
any_errors_fatal: true
|
||||||
|
|
|
@ -197,3 +197,7 @@ k8s_image_pull_policy: IfNotPresent
|
||||||
# default packages to install within the cluster
|
# default packages to install within the cluster
|
||||||
kpm_packages: []
|
kpm_packages: []
|
||||||
# - name: kube-system/grafana
|
# - name: kube-system/grafana
|
||||||
|
|
||||||
|
rkt_version: 1.21.0
|
||||||
|
etcd_deployment_type: rkt
|
||||||
|
kubelet_deployment_type: docker
|
||||||
|
|
|
@ -121,7 +121,7 @@ downloads:
|
||||||
unarchive: true
|
unarchive: true
|
||||||
owner: "etcd"
|
owner: "etcd"
|
||||||
mode: "0755"
|
mode: "0755"
|
||||||
container: "{{ etcd_deployment_type == 'docker' }}"
|
container: "{{ etcd_deployment_type }} in [ 'docker', 'rkt' ]"
|
||||||
repo: "{{ etcd_image_repo }}"
|
repo: "{{ etcd_image_repo }}"
|
||||||
tag: "{{ etcd_image_tag }}"
|
tag: "{{ etcd_image_tag }}"
|
||||||
hyperkube:
|
hyperkube:
|
||||||
|
|
6
roles/rkt/defaults/main.yml
Normal file
6
roles/rkt/defaults/main.yml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
---
|
||||||
|
|
||||||
|
rkt_version: 1.12.0
|
||||||
|
rkt_pkg_version: "{{ rkt_version }}-1"
|
||||||
|
rkt_download_src: https://github.com/coreos/rkt
|
||||||
|
rkt_download_url: "{{ rkt_download_src }}/releases/download/v{{ rkt_version }}"
|
41
roles/rkt/tasks/install.yml
Normal file
41
roles/rkt/tasks/install.yml
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
---
|
||||||
|
- name: gather os specific variables for rkt
|
||||||
|
include_vars: "{{ item }}"
|
||||||
|
with_first_found:
|
||||||
|
- files:
|
||||||
|
- "{{ ansible_distribution|lower }}-{{ ansible_distribution_version|lower|replace('/', '_') }}.yml"
|
||||||
|
- "{{ ansible_distribution|lower }}-{{ ansible_distribution_release }}.yml"
|
||||||
|
- "{{ ansible_distribution|lower }}-{{ ansible_distribution_major_version|lower|replace('/', '_') }}.yml"
|
||||||
|
- "{{ ansible_distribution|lower }}.yml"
|
||||||
|
- "{{ ansible_os_family|lower }}.yml"
|
||||||
|
- defaults.yml
|
||||||
|
paths:
|
||||||
|
- ../vars
|
||||||
|
skip: true
|
||||||
|
tags: facts
|
||||||
|
|
||||||
|
#- name: download rkt pkg
|
||||||
|
# get_url:
|
||||||
|
# url: "{{ rkt_download_url }}/{{rkt_pkg_name}}"
|
||||||
|
# dest: "{{ local_release_dir }}"
|
||||||
|
# when: (ansible_os_family != "CoreOS") and "rkt" in [ etcd_deployment_type, kubelet_deployment_type ]
|
||||||
|
|
||||||
|
- name: install rkt pkg on ubuntu
|
||||||
|
apt:
|
||||||
|
deb: "{{ rkt_download_url }}/{{ rkt_pkg_name }}"
|
||||||
|
state: present
|
||||||
|
register: rkt_task_result
|
||||||
|
until: rkt_task_result|success
|
||||||
|
retries: 4
|
||||||
|
delay: "{{ retry_stagger | random + 3 }}"
|
||||||
|
when: ansible_os_family == "Debian" and "rkt" in [ etcd_deployment_type, kubelet_deployment_type ]
|
||||||
|
|
||||||
|
- name: "install rkt pkg on centos"
|
||||||
|
yum:
|
||||||
|
pkg: "{{ rkt_download_url }}/{{ rkt_pkg_name }}"
|
||||||
|
state: present
|
||||||
|
register: rkt_task_result
|
||||||
|
until: rkt_task_result|success
|
||||||
|
retries: 4
|
||||||
|
delay: "{{ retry_stagger | random + 3 }}"
|
||||||
|
when: ansible_os_family == "RedHat" and "rkt" in [ etcd_deployment_type, kubelet_deployment_type ]
|
4
roles/rkt/tasks/main.yml
Normal file
4
roles/rkt/tasks/main.yml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
|
||||||
|
- name: Install rkt
|
||||||
|
include: install.yml
|
2
roles/rkt/vars/debian.yml
Normal file
2
roles/rkt/vars/debian.yml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
---
|
||||||
|
rkt_pkg_name: "rkt_{{ rkt_pkg_version }}_amd64.deb"
|
2
roles/rkt/vars/fedora.yml
Normal file
2
roles/rkt/vars/fedora.yml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
---
|
||||||
|
rkt_pkg_name: "rkt-{{ rkt_pkg_version }}.x86_64.rpm"
|
2
roles/rkt/vars/redhat.yml
Normal file
2
roles/rkt/vars/redhat.yml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
---
|
||||||
|
rkt_pkg_name: "rkt-{{ rkt_pkg_version }}.x86_64.rpm"
|
Loading…
Reference in a new issue