Browse Source

Minor updates from adding io as a node

Fred Damstra (k8s1) 2 years ago
parent
commit
ee73d451ca

+ 2 - 2
Ansible/README.md

@@ -66,7 +66,7 @@ ansible-playbook -u ubuntu tasks/initial_users.yml --limit=k8s3
 
 Start with the first control node:
 ```
-ansible-playbook k8s.yml --limit=k8s1 --extra-vars="skip_git=True" # Leave off skip_git if github is up
+ansible-playbook microk8s.yml --limit=k8s1 --extra-vars="skip_git=True" # Leave off skip_git if github is up
 ```
 
 It will pause at the bootstrap step, but you can go ahead and hit enter.
@@ -90,7 +90,7 @@ k8s1:   kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master
 
 Rerun the playbook:
 ```
-ansible-playbook k8s.yml --limit=k8s1 --extra-vars="skip_git=True" # Leave off skip_git if github is up
+ansible-playbook microk8s.yml --limit=k8s1 --extra-vars="skip_git=True" # Leave off skip_git if github is up
 ```
 
 From here, you may proceed to "other nodes" or "deploying workloads"

+ 5 - 4
Ansible/inventory.ini

@@ -1,10 +1,11 @@
 [targets]
-io   ansible_host=io.home.monkeybox.org ansible_python_interpreter=/usr/bin/python3 board=pine64
-k8s1 ansible_host=k8s1.home.monkeybox.org board=pi4
-k8s2 ansible_host=k8s2.home.monkeybox.org board=pi4
-k8s3 ansible_host=k8s3.home.monkeybox.org board=pi4
+io   ansible_host=io.monkeybox.home board=pine64
+k8s1 ansible_host=k8s1.monkeybox.home board=pi4
+k8s2 ansible_host=k8s2.monkeybox.home board=pi4
+k8s3 ansible_host=k8s3.monkeybox.home board=pi4
 
 [microk8s]
+io
 k8s1
 k8s2
 k8s3

+ 2 - 1
Ansible/roles/common/tasks/system.yml

@@ -1,11 +1,12 @@
 ---
-# Disable uart
+## Disable uart
 - name: Disable uart
   ansible.builtin.lineinfile:
     path: /boot/firmware/config.txt
     regexp: '^enable_uart='
     line: enable_uart=0
   notify: "Reboot Server"
+  when: board == "pi4"
 
 # Always Fix fsck
 - name: Fix FSCK

+ 8 - 0
Ansible/roles/microk8s/tasks/cmdline.yml

@@ -15,41 +15,49 @@
   shell: cat /boot/firmware/cmdline.txt | grep -c 'usb-storage.quirks=152d:1561:u' || true
   register: pi_ssd_quirk
   changed_when: false # Do not mark as 'changed'
+  when: board == "pi4"
 
 - name: Add SSD Quirk
   replace: dest=/boot/firmware/cmdline.txt regexp='(\s*)$' replace=' usb-storage.quirks=152d:1561:u'
   when: pi_ssd_quirk.stdout == "0"
   notify: "Reboot Server"
+  when: board == "pi4"
 
 # CPUSet
 - name: Check cpuset cgroup
   shell: cat /boot/firmware/cmdline.txt | grep -c 'cgroup_enable=cpuset' || true
   register: pi_cgroup_cpuset
   changed_when: false # Do not mark as 'changed'
+  when: board == "pi4"
 
 - name: Add cpuset cgroup
   replace: dest=/boot/firmware/cmdline.txt regexp='(\s*)$' replace=' cgroup_enable=cpuset'
   when: pi_cgroup_cpuset.stdout == "0"
   notify: "Reboot Server"
+  when: board == "pi4"
 
 # Memory
 - name: Check memory cgroup enabled
   shell: cat /boot/firmware/cmdline.txt | grep -c 'cgroup_enable=memory' || true
   register: pi_cgroup_memory_enable
   changed_when: false # Do not mark as 'changed'
+  when: board == "pi4"
 
 - name: Add memory cgroup enabled
   replace: dest=/boot/firmware/cmdline.txt regexp='(\s*)$' replace=' cgroup_enable=memory'
   when: pi_cgroup_memory_enable.stdout == "0"
   notify: "Reboot Server"
+  when: board == "pi4"
 
 # Memory Group
 - name: Check memory cgroup
   shell: cat /boot/firmware/cmdline.txt | grep -c 'cgroup_memory' || true
   register: pi_cgroup_memory
   changed_when: false # Do not mark as 'changed'
+  when: board == "pi4"
 
 - name: Add memory cgroup
   replace: dest=/boot/firmware/cmdline.txt regexp='(\s*)$' replace=' cgroup_memory=1'
   when: pi_cgroup_memory.stdout == "0"
   notify: "Reboot Server"
+  when: board == "pi4"

+ 13 - 0
Ansible/roles/microk8s/tasks/system.yml

@@ -32,6 +32,19 @@
     owner: root
     group: root
   notify: "Reboot Server"
+  when: board == "pi4"
+
+- name: /etc/network/if-up.d/50-ifup-promisc
+  copy:
+    dest: /etc/network/if-up.d/50-ifup-promisc
+    content: |
+      #!/bin/sh
+      ip link set eth0 promisc on
+    mode: 0755
+    owner: root
+    group: root
+  notify: "Reboot Server"
+  when: board == "pine64"
 
 - name: Shared mount point
   file:

+ 2 - 1
microk8s_notes.md

@@ -1,10 +1,11 @@
 # Installation
 
 ```
-sudo snap install microk8s --classic --channel=latest/stable
+sudo snap install microk8s --classic --channel=1.25/stable
 sudo usermod -a -G microk8s fdamstra
 sudo chown -f -R fdamstra ~/.kube
 
+# Logout and back in to get new group, then
 # Wait for ready
 microk8s status --wait-ready