Posts

Showing posts from December, 2019

qcow2 image disk os used size is very less how to reduce its size for disk.

In case of KVM virtualization in your LAB, You may experience space crunch though you are not using much space actually inside VM. But VM disk on your host storage will take much space as per allocated. Here i am telling you process to how reduce it and fit to actuall disk usage. This is kind of thin provisioning . in my case let see- [root@nuc1 images]# qemu-img info toweramx.qcow2 image: toweramx.qcow2 file format: qcow2 virtual size: 30G (32212254720 bytes) disk size: 30G cluster_size: 65536 Format specific information:     compat: 1.1     lazy refcounts: true Her you can see virtual size is 30 Gb means i have allocated this to VM. but disksize is 1.4 GB only which is actually i used on VM. But you can see both size shows as 30GB . Now run qemu-img command to get it fix $ qemu-img convert -O qcow2 toweramx.qcow2 test1.qcow2 $ rm -rf toweramx.qcow2 $ mv test1.qcow2 toweramx.qcow2 [root@nuc1 images]# qemu-img info toweramx.qcow2 image: tower...

Easy way to setup apache and php7.3-fpm, mysql server on ubuntu 18.04

        When it comes to installation and configuration of a LAMP stack on ubuntu, We normally use $ sudo apt install lamp-server^  -y In which above will install php 7.2 along with apache 2.4 and mysql server  5.7 on ubuntu 18.04 platform . And above stack runs by default with apache handler whcih is not recommended to run for a high traffic website, as it eats memory a lot and gives slowness while on multiple huge connection. So the best solution is to use apache with php-fpm . In my bellow setup i will use only few commands to install apache and php7.3 on ubuntu 18.04 . You may search and find many article on this topic but most of them says to setup fcgid conf file in virtualhost config file. and in case you missed to copy those php-fpm lines in any of virtual host config file, site will not run php. In my setup i am using only few commands to setup the stack and you do not need to modify anything in any file, All your sites ( vi...

Create NFS dynamic provisioner for Openshift. Use nfs for dynamic provisioning with OCP 3.11

I will explain how to install NFS server on Centos 7.X and and configure openshift to use this NFS share as Persistent Volume nfs-client from kubernetes-incubator project is an automatic provisioner that use your existing and already configured NFS server to support dynamic provisioning of Kubernetes/OpenShift Persistent Volumes via Persistent Volume Claims. Install NFS Server Create a Centos/RHEL 7 based instance and run the following commands as root yum install -y nfs-utils systemctl enable rpcbind systemctl enable nfs-server systemctl start rpcbind systemctl start nfs-servermkdir /var/nfsshare chmod -R 755 /var/nfssharefirewall-cmd --permanent --zone=public --add-service=nfs firewall-cmd --permanent --zone=public --add-service=rpc-bind firewall-cmd --reload To allow all clients put * # vi /etc/exports /var/nfsshare *(rw,sync,no_root_squash) or you can limit to a subnet/IP /var/nfsshare 172.16.2.0/24(rw,sync,no_root_squash) # systemctl restart nfs-server ...

How to modify openshift heketi gluster block hosting volume default size from 100 to 10

This is by design that if you have not defined default size of gluster block hosting volume size during openshift cluster setup in ansible inventry file then it may further give you a lot trouble. You may experiance error during heketi block volume provisioning in your PV claim as no space left or may be heketi server is busy. Bellow are steps to modify the default value even if you set this in ansible during your Openshift cluster deployment. The value actually stores as secret encoded in base64 form json file. example gluster is 3 node and gluster project/namespace name is app-storage # oc project app-storage # oc get secret heketi-storage-config-secret -o yaml --export > heketi-storage-config-secret.yaml # vi heketi-storage-config-secret.yaml copy the encoded part in a separate file and encode it content:- apiVersion: v1 data:   heketi.json: ewoJIl9wb3J0X2NvbW1lbnQiOiAiSGVrZXRpIFNlcnZlciBQb3J0IE51bWJlciIsCgkicG9ydCIgOiAiODA4MCIsCgoJIl91c2VfYXV0aCI6ICJFbmFibGU...

Install and setup Kubernetes 1.16 LAb on Ubuntu 18.04 1 master 2 node cluster

#### Kubernetes cluster lab with ubuntu 18.04 ##### ----- Step to follow on all nodes  ------------ $ sudo apt-get update $ sudo apt-get install docker.io -y $ sudo systemctl enable docker $ sudo systemctl start docker $ curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add $ sudo apt-add-repository "deb http://apt.kubernetes.io/ kubernetes-xenial main" $ sudo apt install kubeadm -y ------  step on master node  ------- $ sudo kubeadm init --pod-network-cidr=10.244.0.0/16 $ mkdir -p $HOME/.kube $ sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config $ sudo chown $(id -u):$(id -g) $HOME/.kube/config ------- join worker node ( step on worker node ) ------------ $ kubeadm join 192.168.122.220:6443 --token gefqt9.oj3kcgubehofxbz8 \      --discovery-token-ca-cert-hash sha256:a79789ade9c95182522f55b1ab17e93cd6eac9c7eaf8b7b67a6c125bbb5f50ce ------- deploy a pod network plugin ( on master node ) --------- $ sudo kubectl apply -f ht...