Image for post
Image for post

Problem Statement

Solution

Prerequisites

  • Ansible installed in OS.
  • Dynamic Inventory configured.
  • AWS CLI configured.

Image for post
Image for post

Problem Statement:

  • Create your own Chat Servers, and establish a network to transfer data using Socket Programing by creating both Server and Client machine as Sender and Receiver both. Do this program using UDP data transfer protocol.
  • Use multi-threading concept to get and receive data parallelly from both the Server Sides. Observe the challenges that you face to achieve this using UDP.

Python Code:


Image for post
Image for post

Prerequisites:

  • Ansible Installed
  • Inventory Configured
  • AWS CLIv2 installed and Configured

Step-1)Configuring Dynamic inventory

  • Here I am using dynamic inventory because we have to configure minikube in ec2 instance.
  • For the dynamic inventory, download ec2.py and ec2.ini from this given URL, and paste in the inventory folder:
https://github.com/ansible/ansible/tree/stable-2.9/contrib/inventory
  • Now add this path in ansible.cfg
  • After that, you also need to copy the key.pem for the ec2 instance launch.
  • After copying your key, make it executable by the following command:
chmod 600 Key_Name.pem


Image for post
Image for post

Prerequisite:

  • 3 VM(Virtual Machine).

Solution:

Step-1)Delete all the rules from all the Systems:

route del -net 192.168.0.0(IP_ADDRESS) gw 192.168.0.1(GATEWAY) netmask 255.255.255.0(NETMASK) enp0s3(NIC Card)


Image for post
Image for post

Prerequisite :

  • Ansible installed.
  • Inventory configured.

Step-1)Retreive the distro.

  • First, we need to retrieve the distribution from ansible facts after use it.
  • After we retrieve the distro, now we need to make the files respective to the distro, like — RedHat-8.yml, Ubuntu-16.yml, etc.

Step-2)Writing Playbook

  • First, we need to make the playbook for the distro.

Image for post
Image for post

What is Kubernetes(k8s)?

Why K8s?

✅ Automated rollouts and rollbacks

✅ Self-healing

✅Horizontal scaling

✅ Service discovery and load balancing


Prerequisite :

Step-1)Launch ec2 instance

  • First, select your region.
  • Goto Service > EC2 > launch Ec2 instance.
Image for post
Image for post
  • Select Amazon Linux 2 AMI.

Image for post
Image for post

Prerequisite :

Solution:

Step-1)Make one Docker image, add user, configure the password, and enable ssh

  • To make it simple I am using Dockerfile.
FROM ubuntu:latest
RUN apt update && apt install openssh-server sudo -y
RUN useradd -rm -d /home/ubuntu -s /bin/bash -g root -G sudo -u 1000 test
RUN echo "test:test"| chpasswd
RUN service ssh start
RUN echo "test ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
EXPOSE 22
CMD ["/usr/sbin/sshd","-D"]
  • Here I am using ubuntu:latest
  • For changing the pass of the user use…


Image for post
Image for post

Prerequisite 😩

Solution 🔥

Step-1)Check how many Rules are there

route -n

Prerequisite 🔥

  • Docker installed.

Step-1)Create one Dockerfile

  • Install python and some basic tools.
FROM centos
RUN dnf install python36 -y
RUN dnf install net-tools vim which -y
  • Build Dockerfile
docker build -t IMAGE_NAME .

Step-2)Run above the docker container.

docker run -it --name NAME_OF_CONTAINER IMAGE_NAME

Output

  • Running the python code.
Image for post
Image for post
Python Code
python3 FILENAME.py

Ritesh Singh

Tech Enthusiast, zeal for learning, and explore the new technologies, loves to do automation in today’s Agile world.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store