- Initialize the master with Metallb Clusters
- Copy the metallb Configuration to master
- Kube apply the configuration on master.
Friday, January 21, 2022
Setting up MetalLB Load Balancer with Kubernetes k8s.
Thursday, January 20, 2022
Kubernetes(k8s) With Ansible Over Ubuntu Machines with Docker
Kubernetes(k8s) is a popular container orchestration system that provides a powerful platform for managing containerized applications. Docker is a lightweight, yet powerful container runtime that provides the underlying infrastructure for many Kubernetes deployments. In this, we can see how to set up Kubernetes with Docker using Ansible over Ubuntu machines.
Environment
- Ubuntu VM's running on Vmware
- K8s with Docker Runtime
User Creation
- Asks for the User Name which has to be created
- Create's the user
- Adds a dedicated Sudo entry
- Setting up Password less sudo for user
- Copy the local uses ssh key to server for password less auth
- Print the details
- Updates the System
Package Installation in Master and Worker Nodes
- Copy the local host files to all the server for name resolution
- update the hostnames of the machines based on the names in host file
- Temporary Swap off
- Swap off in fstab
- Installing Kubernetes Pre-requisites packages
- Adding Docker Packages Keys
- Adding Docker Respository
- Install Docker packages
- Enables Docker Services
- Add Google repositories keys
- Create Directory for Docker deamon file
- Create the docker deamon file with Overlay details
- Restart Docker Services
- Install Kubernetes Packages
- Enabled K8s Services
- Reboot the Servers
Master Configuration
- Pulls all needed images
- Reset Kubeadm if its already configured
- Initialize K8s cluster
- Create Directory for Kube config file in master
- Create a local kube config file in master
- Copy the kube config file to ansible local server
- Genarates the Kube toke for workers and stores it
- Copy the token to master's tmp directory
- Copy the toke to ansible local tmp direcotry
- Initialize the pod network with fannel
- Copy the output to mater file
- Copy the output to ansible local server
Worker Configuration
- Copy the token from ansible local file to worker nodes
- Reset the kubeadm
- Join the Worker node to Master by running the command
K8s should be up with the worker nodes now.
Wednesday, January 19, 2022
Manage Vmware Machines With Ansible
Here we are looking on how to use Ansible to connect to vCenters and manage VMs. The focus will be on using quick playbooks for cloning and deleting a current template VM.
We can see the playbook for the creation process for cloning and deleting VMs. The playbook creation process will involve setting up variables, tasks, and handlers, and will be broken down into simple, easy-to-follow steps. Sample playbooks will be provided as a starting point for managing VMs in vCenter using Ansible.
Clone a VM in Vcenter with Ansible Playbook
Shutdown a VM in Vcenter with Ansible Playbook
Delete a VM in Vcenter with Ansible Playbook
Friday, March 12, 2021
Ansible for Vcenter Module not found error
When working with vCenter and Ansible, you may encounter an error that says "vmware_guest Module not found." This error occurs when the vmware_guest module is not installed on your system.
To resolve this error, you need to install the community.vmware collection, which contains the vmware_guest module. You can do this by running the following command:
ansible-galaxy collection install community.vmware
.This command will download and install the community.vmware collection, which contains the vmware_guest module. Once installed, you should be able to use the module in your Ansible playbooks without encountering any errors.
Tuesday, March 9, 2021
Test WinRm connection to Windows Env
To check if WinRM (Windows Remote Management) is enabled in a Windows Server, you can use the following commands:
Test-NetConnection -ComputerName XX -Port 5986
This command tests the connection to port 5986, which is the default port used by WinRM over HTTPS.
Test-NetConnection -ComputerName XX -Port 5985
This command tests the connection to port 5985, which is the default port used by WinRM over HTTP.
If the above commands return successful results, it means that WinRM is enabled and running on the specified server.
Additionally, you can also use the following command to check if WinRM is configured properly on a remote server:
Test-WSMan -ComputerName XX
This command tests the Windows Remote Management (WinRM) service on a remote server and returns the current configuration status of WinRM.
Sed Command in MAC
Method to use Sed in Macsudo sed -i "/kube/d" /etc/hostsgive error sed: 1: "/etc/hosts": extra characters at the end of h command
Following Syntax Worked.sudo sed -i '' '/kube/d' /etc/hosts
Sunday, August 16, 2020
Converting Text Case in Linux: Exploring Powerful Command-Line Tools
Converting Text to Lowercase
Using dd
The dd command, renowned for its data manipulation capabilities, can also be employed to convert text to lowercase.$ dd if=input.txt of=output.txt conv=lcase
Leveraging awk
awk, a versatile text processing tool, offers a succinct way to convert text to lowercase.$ awk '{ print tolower($0) }' input.txt > output.txt
The Magic of perl
Perl enthusiasts can harness the power of this scripting language to achieve case conversion.$ perl -pe '$_= lc($_)' input.txt > output.txt
Transforming with sed
For those who appreciate the elegance of sed, this command can seamlessly convert text to lowercase.$ sed -e 's/\(.*\)/\L\1/' input.txt > output.txt
Converting Text to Uppercase
dd for Uppercase Conversion
Using dd to convert text to uppercase is equally achievable.$ dd if=input.txt of=output.txt conv=ucase
awk for Uppercase Transformation
awk enthusiasts can employ its capabilities for converting text to uppercase.$ awk '{ print toupper($0) }' input.txt > output.txt
Uppercase Conversion with perl
Perl's power shines again in transforming text to uppercase.$ perl -pe '$_= uc($_)' input.txt > output.txt
sed for Uppercase Conversion
Converting text to uppercase using sed is both efficient and effective.$ sed -e 's/\(.*\)/\U\1/' input.txt > output.txt