Sunday 25 December 2022

Add Swap Space on CentOS 9 Stream


To Add 1GB Swap Space 


#create swap file

 sudo dd if=/dev/zero of=/swapfile bs=1024 count=1048576

1048576+0 records in

1048576+0 records out

1073741824 bytes (1.1 GB, 1.0 GiB) copied, 19.8022 s, 54.2 MB/s


#set permission

sudo chmod 600 /swapfile


#set up swap area file

sudo mkswap /swapfile

Setting up swapspace version 1, size = 1024 MiB (1073737728 bytes)

no label, UUID=53c7c8d2-ed2d-4f61-b263-79a4dcd94304


#activate swap

 sudo swapon /swapfile


sudo swapon --show

NAME      TYPE       SIZE USED PRIO

/dev/dm-1 partition  2.1G   4M   -2

/swapfile file      1024M   0B   -3


sudo free -h

               total        used        free      shared  buff/cache   available

Mem:           1.7Gi       898Mi        69Mi        12Mi       970Mi       852Mi

Swap:          3.1Gi       4.0Mi       3.1Gi


#make permenant entry

sudo vim /etc/fstab

/swapfile swap swap defaults 0 0



Monday 19 December 2022

How Kube-Proxy handles the traffic between the containers and the virtual machine by creating IP table rules in Kubernetes.


Demonstration


kubectl get svc





#to view any traffic sent to the IP sent to the following Rule

sudo iptables -S -t nat | grep IP





#inspect the rule





#the above rule diverts the traffic to the VM IP





#find the container using kube-apiserver

docker ps











#monitor kube-apiserver container

docker top container_id









#inspect the container to confirm IP used

docker inspect fcec33b58cbb | grep "address="

 





Tuesday 13 December 2022

Configuring Jenkins ThinBackup and Restore


Create a backup directory 









Install Thinbackup Plugin










Navigate to ThinBackup and configure









Configure the settings


















Full backup happens every 5mins and Incremental backup every 2mins






Restore backup from the dropdown.








Backup any location

mkdir -p /opt/backup

chown -R jenkins:jenkins /opt/backup

ls -lsrt /opt/backup/

total 8

4 drwxr-xr-x 6 jenkins jenkins 4096 Dec 13 10:05 FULL-2022-12-13_10-05

4 drwxr-xr-x 3 jenkins jenkins 4096 Dec 13 10:06 DIFF-2022-12-13_10-06