Skip to content

Commit

Permalink
Merge pull request #12 from mrlesmithjr/issue#8
Browse files Browse the repository at this point in the history
Issue#8
  • Loading branch information
mrlesmithjr authored Aug 23, 2018
2 parents b9e81a3 + e65bed4 commit a717894
Show file tree
Hide file tree
Showing 10 changed files with 61 additions and 2 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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`
Expand Down
3 changes: 3 additions & 0 deletions inventory/group_vars/all/k8s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 7 additions & 0 deletions inventory/group_vars/rpi_k8s/glusterfs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion playbooks/bootstrap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 15 additions & 0 deletions playbooks/fix_glusterfs_repo.yml
Original file line number Diff line number Diff line change
@@ -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"
1 change: 1 addition & 0 deletions requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions roles/ansible-k8s/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,5 @@ k8s_token_file: /etc/kubernetes/.k8s_token

k8s_users:
- user: vagrant

k8s_version: 1.10.2
2 changes: 1 addition & 1 deletion roles/ansible-k8s/meta/.galaxy_install_info
Original file line number Diff line number Diff line change
@@ -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}
13 changes: 13 additions & 0 deletions roles/ansible-k8s/tasks/debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand Down
11 changes: 11 additions & 0 deletions roles/ansible-k8s/templates/etc/apt/preferences.d/k8s.pref.j2
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit a717894

Please sign in to comment.