Tiernan's Comms Closet

Geek, Programmer, Photographer, network egineer…

Day 1 of #100daysofhomelab

I have decided to start my #100daysofhomelab journey again, so today is day 1. I have been working on a K3s cluster in the house, and so far, I have to start again… going to rebuild it again tomorrow at some stage…

Lots of Links

some notes for myself:

Service Account for Dashboard

to create the Service account, create a file, ca.yml, and enter the following:

apiVersion: v1
kind: ServiceAccount
metadata:
  name: <username>
  namespace: kube-system

next, create a file called cluster-role-binding.yml with the following:

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: <username>
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: cluster-admin
subjects:
- kind: ServiceAccount
  name: <username>
  namespace: kube-system

make sure username matches!

run the following commands:

kubectl apply -f sa.yml
kubectl apply -f cluster-role-binding.yml
kubectl -n kube-system create token <username>

Installing OpenSCSI and NFS (required for Longhorn) with Ansible

Ansible Script

---
- hosts: k3s
  become: true
  
  tasks:
  - name: Update and upgrade apt packages
    become: true
    apt:
      upgrade: yes
      update_cache: yes
      cache_valid_time: 600 
  - name: install packages
    become: true
    apt: 
      pkg:
      - nfs-common
      - open-iscsi

  - name: Make sure open-iscsi is enabled and running
    ansible.builtin.systemd:
      enabled: true
      state: started
      name: open-iscsi

---

This site is hosted on my own ASN on AS204994. More details about that over there. I also use Vultr for transit services and HostUs for LIR Services. Check them out. You can also check some of the gear I use on a daily basis over on kit.co/tiernano. Looking for a Backup Option? Check out Backblaze and get a month free.


Leave a Reply

Your email address will not be published. Required fields are marked *