Browse Source

Adding initial rkt support

pull/784/head
Brad Beam 8 years ago
parent
commit
a8f2af0503
9 changed files with 63 additions and 1 deletions
  1. 1
      cluster.yml
  2. 4
      inventory/group_vars/all.yml
  3. 2
      roles/download/defaults/main.yml
  4. 6
      roles/rkt/defaults/main.yml
  5. 41
      roles/rkt/tasks/install.yml
  6. 4
      roles/rkt/tasks/main.yml
  7. 2
      roles/rkt/vars/debian.yml
  8. 2
      roles/rkt/vars/fedora.yml
  9. 2
      roles/rkt/vars/redhat.yml

1
cluster.yml

@ -28,6 +28,7 @@
roles:
- { role: kubernetes/preinstall, tags: preinstall }
- { role: docker, tags: docker }
- { role: rkt, tags: rkt }
- hosts: etcd:!k8s-cluster
any_errors_fatal: true

4
inventory/group_vars/all.yml

@ -197,3 +197,7 @@ k8s_image_pull_policy: IfNotPresent
# default packages to install within the cluster
kpm_packages: []
# - name: kube-system/grafana
rkt_version: 1.21.0
etcd_deployment_type: rkt
kubelet_deployment_type: docker

2
roles/download/defaults/main.yml

@ -121,7 +121,7 @@ downloads:
unarchive: true
owner: "etcd"
mode: "0755"
container: "{{ etcd_deployment_type == 'docker' }}"
container: "{{ etcd_deployment_type }} in [ 'docker', 'rkt' ]"
repo: "{{ etcd_image_repo }}"
tag: "{{ etcd_image_tag }}"
hyperkube:

6
roles/rkt/defaults/main.yml

@ -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

@ -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

@ -0,0 +1,4 @@
---
- name: Install rkt
include: install.yml

2
roles/rkt/vars/debian.yml

@ -0,0 +1,2 @@
---
rkt_pkg_name: "rkt_{{ rkt_pkg_version }}_amd64.deb"

2
roles/rkt/vars/fedora.yml

@ -0,0 +1,2 @@
---
rkt_pkg_name: "rkt-{{ rkt_pkg_version }}.x86_64.rpm"

2
roles/rkt/vars/redhat.yml

@ -0,0 +1,2 @@
---
rkt_pkg_name: "rkt-{{ rkt_pkg_version }}.x86_64.rpm"
Loading…
Cancel
Save