Your light in the linux world

Author: user

My Home Setup

So this started in my head “I want to learn kubernetes…” Well… I learned it… But the learning didn’t stop with kubernetes…

Then the learning started with a course of Udemy (https://www.udemy.com/course/learn-devops-the-complete-kubernetes-course/learn/lecture/11278680?start=0#overview ) Excellent course. Learned me the ins and outs of kubernetes. But then of course… To put learning to practice I needed a kubernetes cluster. Yes, I could use minikube… But where is the fun in that… šŸ˜€

I started with creating a k3s rancher cluster. Because of it’s low system footprint and a awesome GUI to see whats is happening to your cluster.
I used this guide https://rancher.com/docs/rancher/v2.x/en/installation/k8s-install/create-nodes-lb/ and started with “Setup Infrastructure”… Very important… Read EVERYTHING.

After some cursing and reinstalling servers to make sure I had a clean slate to start, I managed to get it up and running… Happy me šŸ™‚

So, now it was time to deploy something on the cluster… And I started with the nice low footprint gitea app for storing my ansible playbooks, kubernetes apps,… I could have used helm, the easy way… But I was here to learn, so I created the manifest on my own (with help of my good friend Google…). But I did it. It deployed. I could reach it with my external Nginx LoadBalancer. Happy me… šŸ™‚

So… Then came helm… Let’s see how that works… I learned the true value of the values.yml… really… If you starting with pre-created helm charts… Take your time to go through the values.yml to edit it to your environment… It safes some headache…

So, I learned how Helm works, so I was thinking more and more to a fully home CI/CD setup. So what do I need… Keeping in mind that if it was possible I needed low footprint applications…

  • Docker repository: I went for Harbor. Great tool. Nice GUI. And scans your images on security flaws. https://goharbor.io/
  • Jenkins (widely used, so…)
  • Awx… To automatically run my playbooks in conjunction with jenkins . Yes, less low footprint, but hey… Sometimes you need to sacrifice to get want you want…

So, after all that was I installed on my kubernetes cluster… I was ready to start learning Jenkins, Kubernetes and of course some wordpress… And with deploying wordpress I learned the auto scaling functionality of kubernetes… :-D. So… Happy me… Again šŸ˜€

The final setup (for now…) looks like this:

And currently following applications are installed:

Founding TuxITo

In the middle of the global pandemic, where my work for my previous company (where I was an intern) was at a VERY low pace… I’ve decided that I had enough of it… I wanted to move forward…
I was already thinking of starting my own company and working as a freelancer for a long time, but there was always something. New Projects, too much work, …

But now… There was no work… At least not much… And I don’t like that… I need some pressure in my life. (Not to much… šŸ˜‰ )

So I left my ā€œgolden cageā€ where I had all the job security I could wish for in this strange time and quit my job… Under the motto: ā€œLife is to those who dareā€
I had 8 weeks to find a job as a new founded freelancer. Otherwise I wouldn’t have a car anymore, no job, no money…

Life is to those who dare

Following was a VERY STRESSFUL period, where my wife and friends where supporting me. Because you get A LOT of phone calls, but after 3 weeks I still didn’t have anything. So you really start doubting yourself…

But during that 3th week I had an interview with a company for a job that I really wanted. It was perfect for me. Linux System Engineer. The thing that I had the most experience in… And yes… After 2 days stressing about it… I received a phone call… And YES, I got the job!!! I was happy as a kid in a candy store :-D.

Life is a bitch sometimes, but in the end… Everything will be just fine… One way or the other…

Grow XFS FileSystem Without LVM

When you have a NON-LVM xfs filesystem that you need to expand without rebooting on VMWare… Follow this guide… Bumped into this one day… So…

  • First of all expand your disk image to your desired size. In my example I went from 250GB –> 300GB
  • SSH into your VM. As you can see now the disk still remains at the 250GB
# Current partition size
[root@portainer02prod ~]# fdisk -l
 
Disk /dev/sda: 17.2 GB, 17179869184 bytes, 33554432 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000d1b93
 
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     2099199     1048576   83  Linux
/dev/sda2         2099200    31467519    14684160   8e  Linux LVM
 
Disk /dev/sdb: 268.4 GB, 268435456000 bytes, 524288000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
  • Run following command to rescan your partition. (Here it is /dev/sdb that needs a resize)
[root@portainer02prod ~]# echo 1 > /sys/block/sdb/device/rescan
  • Confirm that this worked
[root@portainer02prod ~]# fdisk -l
 
Disk /dev/sda: 17.2 GB, 17179869184 bytes, 33554432 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000d1b93
 
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     2099199     1048576   83  Linux
/dev/sda2         2099200    31467519    14684160   8e  Linux LVM
 
Disk /dev/sdb: 322.1 GB, 322122547200 bytes, 629145600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
  • Whoop Whoop (You should say now…). Now we can grow the XFS filesystem to the desired size and have some space on the disk again šŸ™‚
[root@portainer02prod ~]# xfs_growfs /dev/sdb
meta-data=/dev/sdb               isize=512    agcount=4, agsize=16384000 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=0 spinodes=0
data     =                       bsize=4096   blocks=65536000, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal               bsize=4096   blocks=32000, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
data blocks changed from 65536000 to 78643200 --> Resized

Installing docker swarm

This guide will show you how to setup a docker swarm. Assuming you already have docker installed.

Setting up docker swarm

For setting up a swarm, you need at least 3 vm’s which will contain:

  • A manager Node (or more)
  • And worker nodes

Setting up a manager node

Log in to your Manager vm and run following command:

docker swarm init –advertise-addr <MANAGER-IP>

The other nodes in the swarm must be able to access the manager at the IP address. So be aware of Firewall restrictions, iptables,…

You will get a output like this:

Swarm initialized: current node (dxn1zf6l61qsb1josjja83ngz) is now a manager. To add a worker to this swarm, run the following command: docker swarm join \ --token SWMTKN-1-49nj1cmql0jkz5s954yi3oex3nedyz0fb0xx14ie39trti4wxv-8vxv8rssmk743ojnwacrr2e7c \ 192.168.99.100:2377 To add a manager to this swarm, run 'docker swarm join-token manager' and follow the instructions.

You can add multiple Manager nodes this way:

[me@portainermgr01prod ~]$ docker swarm join-token manager To add a manager to this swarm, run the following command: docker swarm join --token SWMTKN-1-2vqxciwl7q5nmtv7vy6jbeh8ilo29u7bs1eko24ztazn8n87a7-d201wmooe8hd8ll19klmhyt0v 10.136.23.11:2377

Run the “docker swarm join –token SWMTKN-1-2vqxciwl7q5nmtv7vy6jbeh8ilo29u7bs1eko24ztazn8n87a7-d201wmooe8hd8ll19klmhyt0v 10.136.23.11:2377” on the other nodes you want to join as a manager.

Setting up the worker nodes

Log in to your worker nodes and run the command you got from the output of the manager node:

docker swarm join \ --token SWMTKN-1-49nj1cmql0jkz5s954yi3oex3nedyz0fb0xx14ie39trti4wxv-8vxv8rssmk743ojnwacrr2e7c \ 192.168.99.100:2377

If you don’t have the command available, you can run the following command on a manager node to retrieve the join command for a worker:

docker swarm join-token worker

After you have run the commands on your workers, you can check the status of your workers using following command on the MANAGER node:

[me@portainermgr01prod ~]$ docker node ls ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS ENGINE VERSION onh1rgb37cbgsl2sx6zwlcrlh portainer01prod Ready Active 18.09.7 tyw38g3pl9q2km1kwi4mk0brd portainer02prod Ready Active 18.09.7 uu6sh1gk87bxkughvrwdezber portainer03prod Ready Active 18.09.7 vaq6nqm92vv1raq6pfdzl7y1s * portainermgr01prod Ready Active Leader 18.09.7 7d9g9cx5ce0wn5x114o1m0qz3 portainermgr02prod Ready Active Reachable 18.09.7 scpw73v2ei49udcg36oy2ltrf portainermgr03prod Ready Active Reachable 18.09.7 [me@portainermgr01prod ~]$

© 2025 TuxITo

Theme by Anders NorenUp ↑