diff --git a/README.md b/README.md index ae613c8..be09b59 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ - [Gotchas](#gotchas) - [sshpass error](#sshpass-error) - [SSH Key Missing](#ssh-key-missing) + - [Fixing Broken GlusterFS Repo](#fixing-broken-glusterfs-repo) - [Managing WI-FI On First Node](#managing-wi-fi-on-first-node) - [Routing](#routing) - [Adding Static Route On macOS](#adding-static-route-on-macos) @@ -424,6 +425,12 @@ The key's randomart image is: +----[SHA256]-----+ ``` +##### Fixing Broken GlusterFS Repo +If you experience the following [issue](https://github.com/mrlesmithjr/ansible-rpi-k8s-cluster/issues/7) you can +run the playbook [fix_glusterfs_repo.yml](playbooks/fix_glusterfs_repo.yml) which +will remove the broken `3.10` repo. Once that is done you should be good to go +and be able to run [deploy.yml](playbooks/deploy.yml) once again. + ### Managing WI-FI On First Node To manage the WI-FI connection on your first node. You can create a `wifi.yml` diff --git a/inventory/group_vars/all/k8s.yml b/inventory/group_vars/all/k8s.yml index a721f64..43f5df6 100644 --- a/inventory/group_vars/all/k8s.yml +++ b/inventory/group_vars/all/k8s.yml @@ -14,6 +14,9 @@ k8s_helm_install: true k8s_helm_version: 2.8.1 k8s_pod_network_config: "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')" +# k8s_pod_network_config: https://gist.githubusercontent.com/mrlesmithjr/eab451b45641db6c108ca3f362563621/raw/93569a17d4085975fc2305ae117ce720766174ec/weave-daemonset-2.2.0.yaml k8s_users: - user: pi + +k8s_version: 1.11.2 diff --git a/inventory/group_vars/rpi_k8s/glusterfs.yml b/inventory/group_vars/rpi_k8s/glusterfs.yml index ac7bcb1..a19ebf4 100644 --- a/inventory/group_vars/rpi_k8s/glusterfs.yml +++ b/inventory/group_vars/rpi_k8s/glusterfs.yml @@ -13,4 +13,11 @@ glusterfs_create_bricks: owner: root group: root +# defines Debian repo for GlusterFS +glusterfs_debian_repo_info: + key_url: "https://download.gluster.org/pub/gluster/glusterfs/{{ glusterfs_version }}/rsa.pub" + repo: "deb [arch=arm64] http://download.gluster.org/pub/gluster/glusterfs/{{ glusterfs_version }}/LATEST/Debian/{{ ansible_distribution_release|lower }}/arm64/apt {{ ansible_distribution_release|lower }} main" + +glusterfs_version: 3.13 + glusterfs_volume_force_create: true diff --git a/playbooks/bootstrap.yml b/playbooks/bootstrap.yml index 624d188..cd72693 100644 --- a/playbooks/bootstrap.yml +++ b/playbooks/bootstrap.yml @@ -236,7 +236,7 @@ # delay: 2 # with_items: "{{ groups['rpi_k8s_slaves'] }}" -- hosts: rpi_k8s_slaves +- hosts: rpi_k8s any_errors_fatal: true tasks: - name: Updating /etc/hosts diff --git a/playbooks/fix_glusterfs_repo.yml b/playbooks/fix_glusterfs_repo.yml new file mode 100644 index 0000000..5d640ab --- /dev/null +++ b/playbooks/fix_glusterfs_repo.yml @@ -0,0 +1,15 @@ +--- +- hosts: rpi_k8s + vars: + glusterfs_versions_to_remove: + - "3.8" + - "3.9" + - "3.10" + tasks: + - name: debian | removing glusterfs apt repo + apt_repository: + repo: "deb http://download.gluster.org/pub/gluster/glusterfs/{{ item }}/LATEST/Debian/stretch/apt stretch main" + state: absent + become: true + with_items: "{{ glusterfs_versions_to_remove }}" + when: ansible_distribution == "Debian" diff --git a/requirements.yml b/requirements.yml index 3b9322b..4959ad2 100644 --- a/requirements.yml +++ b/requirements.yml @@ -7,6 +7,7 @@ - src: https://github.com/mrlesmithjr/ansible-glusterfs.git - src: https://github.com/mrlesmithjr/ansible-isc-dhcp.git - src: https://github.com/mrlesmithjr/ansible-k8s.git + version: v1.1.0 - src: https://github.com/mrlesmithjr/ansible-ntp.git - src: https://github.com/mrlesmithjr/ansible-sshd.git - src: https://github.com/mrlesmithjr/ansible-timezone.git diff --git a/roles/ansible-k8s/defaults/main.yml b/roles/ansible-k8s/defaults/main.yml index 19b0ae3..2ab0e31 100644 --- a/roles/ansible-k8s/defaults/main.yml +++ b/roles/ansible-k8s/defaults/main.yml @@ -58,3 +58,5 @@ k8s_token_file: /etc/kubernetes/.k8s_token k8s_users: - user: vagrant + +k8s_version: 1.10.2 diff --git a/roles/ansible-k8s/meta/.galaxy_install_info b/roles/ansible-k8s/meta/.galaxy_install_info index 806d14c..2a6272f 100644 --- a/roles/ansible-k8s/meta/.galaxy_install_info +++ b/roles/ansible-k8s/meta/.galaxy_install_info @@ -1 +1 @@ -{install_date: 'Fri Feb 16 02:20:37 2018', version: ''} +{install_date: 'Thu May 3 12:16:46 2018', version: v1.1.0} diff --git a/roles/ansible-k8s/tasks/debian.yml b/roles/ansible-k8s/tasks/debian.yml index 6b8687a..63ca7fd 100644 --- a/roles/ansible-k8s/tasks/debian.yml +++ b/roles/ansible-k8s/tasks/debian.yml @@ -20,6 +20,19 @@ state: present become: true +- name: debian | Pinning K8s Version + template: + src: etc/apt/preferences.d/k8s.pref.j2 + dest: /etc/apt/preferences.d/k8s.pref + become: true + register: _k8s_pinned_version + +- name: debian | Updating Apt Cache + apt: + update_cache: true + become: true + when: _k8s_pinned_version['changed'] + - name: debian | Installing K8s Packages apt: name: "{{ item }}" diff --git a/roles/ansible-k8s/templates/etc/apt/preferences.d/k8s.pref.j2 b/roles/ansible-k8s/templates/etc/apt/preferences.d/k8s.pref.j2 new file mode 100644 index 0000000..2ca34ed --- /dev/null +++ b/roles/ansible-k8s/templates/etc/apt/preferences.d/k8s.pref.j2 @@ -0,0 +1,11 @@ +Package: kubeadm +Pin: version {{ k8s_version }}* +Pin-Priority: 900 + +Package: kubectl +Pin: version {{ k8s_version }}* +Pin-Priority: 900 + +Package: kubelet +Pin: version {{ k8s_version }}* +Pin-Priority: 900