Computer Inquisitive
http://www.chinmayadehury.in
Friday, May 13, 2022
Thursday, October 7, 2021
Installing python3 and pip3 on Centos7
Here I have no python3 installed
The most simplest way to install python3
=================
sudo yum install python3
Make python 3.6 as default one
=================
sudo alternatives --install /usr/bin/python python /usr/bin/python3.6 60
sudo alternatives --config python
Check the python version
==================
Check the pip version
==================
Check the pip3 version
==================
Upgrade pip3
=================
pip3 install --upgrade pip --user

Check the pip version
==================
Bonus: Fixing yum package manager
Now lets try to install a random package to check the yum package manager
Install nano
=============
sudo yum install nano
you will get following error
To fix this, Open the /usr/bin/yum file and in the first line, change python to python2
OLD:
NEW:
If again you got similar issue with different file, for example:
Open this file (sudo vi /usr/libexec/urlgrabber-ext-down ) and in the first line change "python" to "python2"
Here is the Youtube demo:
-That's all for now
Monday, September 20, 2021
Managing Kubernetes clusters using Rancher [20Sept2021]
Created Tuesday 07 September 2021
Rancher node: Centos 7 (better to keep this separate from cluster nodes), flavor: m3.xsmall
Master Node: Centos 7, m3.xsmall
Worker Node-1: Centos 7, m3.xsmall
Worker Node-2: Centos 7, m3.xsmall
Both Master and Work Node have allow-all security group attached
Minimal ports required are 80/TCP, 443/TCP
[src: https://rancher.com/docs/rancher/v2.x/en/quick-start-guide/deployment/quickstart-manual-setup/
Common installation
- Install Docker
- Create the daemon file manually. This is also because of some conflict in University's Openstack Environment.
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<EOF { "exec-opts": ["native.cgroupdriver=systemd"], "log-driver": "json-file", "log-opts": { "max-size": "100m" }, "storage-driver": "overlay2", "storage-opts": [ "overlay2.override_kernel_check=true" ],
"default-address-pools": [{"base":"172.80.0.0/16","size":24}]
} EOF
- Now run this command. It will add the official Docker repository, download the latest version of Docker, and install it:
- After installation has completed, start the Docker daemon:
- Verify that it’s running:
- enable docker to start on boot:
- To run docker commands with non-root privileges
sudo groupadd docker sudo usermod -aG docker $USER newgrp docker
Rancher node
- Enter the following command to run rancher container
- Go to the web browser and hit https://<SERVER_IP_Rancher_Node>
- Follow the wizard for initial setup
Create a new cluster
src: https://rancher.com/docs/rancher/v2.5/en/quick-start-guide/deployment/quickstart-manual-setup/
- Go to the browser and access Rancher Dashboard
- From the dashboard, click on Create
- Click on Custom
- Give Cluster Name as cluster-1 and skipp other infos
- Click on Next
- Select etcd , Control Plane , Worker
- Select the Registration command
- The registration command should look like:
- Go to master node terminal and execute the registration command
- After this, you will see in the browser that 1 New node has registered.
- Now click on Done
- Repeat Step 6 to get the registration command for worker node. For worker node you just need to select Worker
Deleting a node
[src: https://rancher.com/docs/rancher/v2.5/en/cluster-admin/cleaning-cluster-nodes/]
Deleting Docker Containers, Images, and Volumes
Based on what role you assigned to the node, there are Kubernetes components in containers, containers belonging to overlay networking, DNS, ingress controller and Rancher agent. (and pods you created that have been scheduled to this node)
To clean all Docker containers, images and volumes:
docker rm -f $(docker ps -qa) docker rmi -f $(docker images -q) docker volume rm $(docker volume ls -q)
Clean the related directories
sudo rm -rf /etc/ceph \ /etc/cni \ /etc/kubernetes \ /opt/cni \ /opt/rke \ /run/secrets/kubernetes.io \ /run/calico \ /run/flannel \ /var/lib/calico \ /var/lib/etcd \ /var/lib/cni \ /var/lib/kubelet \ /var/lib/rancher/rke/log \ /var/log/containers \ /var/log/kube-audit \ /var/log/pods \ /var/run/calico
It is now good to reboot the VM with following command:
-That's all
Thursday, September 16, 2021
Installation of Kubernetes cluster using "kubeadm"- Final verison [16Sept2021]
Following steps are tested on 16 Sept 2021
Saturday, April 3, 2021
Cloud Cost Comparison : 1vm/mo
In this post, we will explore and compare the cost of hosting a small VM for 1 month in different clouds.
1. Serverspace
https://serverspace.us/services/cloud-servers/Pricing Ref: https://serverspace.us/pricing/
Configuration: Ubuntu 18.04, 1GB, 1core, 50Mbps, 25GB SSD
Cost/mo: USD 4.55
Cost/hr: USD 0.006
2. Kamatera Cloud
https://www.kamatera.com/express/compute/Configuration: Ubuntu 18.04, 1GB, 1core, 50Mbps, 20GB SSD
Cost/mo: USD 4.00
Cost/hr: USD 0.005
Pricing Ref: https://www.kamatera.com/express/compute/?tcampaign=35187_368194&bta=35187&nci=5344
3. Linode
https://www.linode.comConfiguration: 1GB, 1core, 25GB SSD, 1TB, 40GB NW In, 1000Mbps NW Out
Cost/mo: USD 5.00
Cost/mo: USD 0.0075
Pricing Ref: https://www.linode.com/pricing/
4. ScalaHosting
https://www.scalahosting.com/cloud-serversConfiguration: Ubuntu 20.04, 2GB, 1core, 50GB SSD, 3000GB bandwidth
Cost/mo: USD 10.00
Cost/hr: USD 0.015
Pricing Ref: https://my.scalahosting.com/order.php?a=configure&i=0
5. Cloudways
https://www.cloudways.com/Using there interface you only can create VMs in other cloud provideres, such as DigitalOcean, Linode, VULTR, AWS, Google Cloud
Pricing Ref: https://www.cloudways.com/en/pricing.php
6. LiquidWeb
https://www.liquidweb.com/products/cloud-dedicated/Configuration: Linux, 2GB, 2 vCPU, 40GB SSD, 10TB bandwidth
Cost/mo: USD 15 (if you go for 24months plan)
Other Addon: InterWorx, Plesk Web Pro, or cPanel Admin
Ref: https://www.liquidweb.com/products/vps/
7. SiteGround
https://www.siteground.com/cloud-hosting.htmConfiguration: 8GB, 4cores, 40GB SSD, 5TB data transfer
Cost/mo: USD 80.00
Pricing Ref: https://www.siteground.com/cloud-hosting.htm?afcode=b0dbbe40d137d9fab687993c2f1ce093&campaign=Cloud+Hosting
8. DigtialOcean
https://www.digitalocean.com/Configuration: 1GB, 1CPU, 25GB SSD, 1TB data transfer
Cost/mo: USD 5.00
Cost/hr: USD 0.00744
Pricing Ref: https://www.digitalocean.com/pricing/
9. Vultr
https://www.vultr.com/Configuration: 512MB, 1CPU, 10GB SSD, 0.5TB data transfer
Cost/mo: USD 3.5 (can be 2.5USD if you choose IPv6 version only )
Cost/hr: USD 0.005
Pricing Ref: https://www.vultr.com/products/cloud-compute/#pricing
10. Amazon Web Services
https://aws.amazon.com/Configuration: 1GB, 2vCPU, 10GB HDD, 0.5TB data transfer
Cost/mo: USD 4.02
Cost/hr: USD 0.005
Pricing Ref: https://calculator.aws/#/createCalculator/EC2