Showing posts with label Docker. Show all posts
Showing posts with label Docker. Show all posts

Wednesday, January 04, 2023

Azure Series : RabbitMQ - Setup and Use - Install RabbitMQ

Install RabbitMQ

If you plan on to host RabbitMQ locally, you can either install RabbitMQ in your local workspace or run a RabbitMQ Docker container in your local workspace.

To install RabbitMQ in your local workspace:

  1. Make sure you have already installed Chocolatey Package Manager
  2. RunAsAdministrator - Windows Powershell
  3. From the powershell prompt run the following command to install RabbitMQ:
    choco install rabbitmq
  4. Follow the installation prompts
  5. After the installation completes if you have no critical errors, RabbitMQ should now be installed in your local workspace.
  6. To verify RabbitMQ is now running in your local workspace, open a browser window and go to the following URL:
    http://localhost:15672/ 
  7. You should see a login screen for the RabbitMQ web interface. The default RabbitMQ username and password is as follows:


To install RabbitMQ in your docker:

  1. Make sure you have installed Docker. 
  2. RunAsAdministrator - Windows Powershell
  3. First, let’s pull the RabbitMQ docker image. We’ll use the 3-management version, so we get the Management plugin pre-installed.

    docker pull rabbitmq:3.12-management
  4. Now let’s stand it up. We’ll map port 15672 for the management web app and port 5672 for the message broker.

    docker run -it --rm --name rabbitmq -p 5672:5672 -p 15672:15672 rabbitmq:3.12-management

  5. Assuming that ran successfully, you’ve got an instance of RabbitMQ running! Bounce over to http://localhost:15672 to check out the management web app.

You should see a login screen for the RabbitMQ web interface. The default RabbitMQ user name and password is as follows:


username: guest
password: guest


Here you can see an overview of your RabbitMQ instance and the message broker’s basic components: Connections, Channels, Exchanges, and Queues.

Tuesday, March 02, 2021

Azure Series - Understanding Kubernetes Environment Components and Setting Up with Docker high level steps

Kubernetes, often abbreviated as K8s, has become the de facto standard for managing containerized applications in modern software development. Its ability to automate deployment, scaling, and management of containerized workloads makes it a crucial tool for developers and operations teams alike. In this article, we'll explore the main components of a Kubernetes environment and guide you on how to set up Kubernetes using Docker high-level steps. I will publish another article soon with actual commands to set up Kubernetes using Docker. 

Main Components of a Kubernetes Environment:

1. Master Node:
The Master Node is the control plane of the Kubernetes cluster. It manages and coordinates all the cluster's activities, including scheduling and monitoring containers, maintaining the desired state, and handling API requests. The primary components within the Master Node are:

  • kube-apiserver: Exposes the Kubernetes API and acts as the front-end for the control plane.
  • etcd: A distributed key-value store that stores the cluster's configuration data.
  • kube-scheduler: Responsible for distributing workloads across worker nodes based on resource availability and constraints.
  • kube-controller-manager: Manages various controllers that handle different aspects of the cluster, such as replication, endpoints, and nodes.

2. Worker Nodes:
Worker Nodes are the machines where containers are scheduled and run. Each node must have the following components installed:

  • kubelet: Communicates with the Master Node and ensures containers are running as expected.
  • kube-proxy: Manages network communication between services and pods.
  • Container Runtime: Responsible for running containers, e.g., Docker, containerd, or CRI-O.

3. Pods:
Pods are the smallest deployable units in Kubernetes and encapsulate one or more containers. Containers within a pod share the same network namespace and can communicate with each other using localhost. Pods enable colocation of tightly coupled application components and ensure that they run on the same node.

4. Services:
Services provide a stable endpoint to access a set of pods. They act as an abstraction layer, enabling communication between pods using labels. There are different types of services, such as ClusterIP, NodePort, and LoadBalancer, each serving a specific purpose in managing network traffic.

Setting Up Kubernetes Environment with Docker:

To get started with Kubernetes on Docker, follow these steps:

Step 1: Install Docker:
Make sure you have Docker installed on your machine. Docker allows you to run containers and acts as the container runtime for Kubernetes.

Step 2: Install kubeadm, kubelet, and kubectl:
On your machine, install kubeadm, kubelet, and kubectl - these are the command-line tools to set up and interact with Kubernetes.

Step 3: Initialize Kubernetes Cluster:
Run kubeadm init to initialize the Kubernetes cluster on the Master Node. This command generates a unique token to allow worker nodes to join the cluster.

Step 4: Join Worker Nodes:
On each worker node, run the kubeadm join command with the token obtained from Step 3. This will connect the worker node to the cluster.

Step 5: Deploy Network Plugin:
Choose a network plugin like Flannel, Calico, or Weave, and deploy it to enable networking between pods across different nodes.

Step 6: Deploy Dashboard (Optional):
If you wish to have a graphical user interface for managing the Kubernetes cluster, you can deploy the Kubernetes Dashboard using kubectl.

Conclusion:
Kubernetes provides a powerful platform for managing containerized applications, but setting up a Kubernetes environment from scratch can be a complex task. Using Docker to run Kubernetes on your local machine allows for easier experimentation and development. By understanding the key components of a Kubernetes environment and following the steps outlined in this article, you can start exploring the potential of container orchestration and streamline your application deployment process. Happy Kuberneting!