Posts

Kubernetes DaemonSet (ds)

Image
 Overview of DaemonSets Kubernetes DaemonSet is one of the controllers which are at the Kubernetes Master node. A DaemonSet ensures that all or some nodes run a Pod As nodes are added to the Kubernetes cluster, Pods have added accordingly for each node as per the DaemonSet defined. As nodes are removed or drained from the Kubernetes cluster, they are GC. Deleting a DaemonSet will clean up those Pods it created on each node The DaemonSet Controller creating pods on each nodes Where we can use this DaemonSet? When a Kubernetes cluster running many microservices with multi-nodes there will be a need for Monitoring the system resources with collecting metrics and Logging should be enabled for the application level or database level to collect respective access and server-specific logs. Some example daemon pods can be: Collectd, Node exporter -- Monitoring daemon on nodes for Prometheus Fluentd, logstash – log collection daemon for ELK, EFK stacks Ceph, glusterd – Storage daemon for Clo...

Helm chart installation and Deploy on Linux

Image
What is a helm chart?  It is a package manager for your Kubernetes cluster. It used to install, upgrade, rollback release, and also uninstall on the Kubernetes cluster.  Helm Charts Kubernetes Deployment What do these charts for?  You have seen Kubernetes pods, ReplicaSet, Deployments, services, and other objects each one required a YAML file in defining in the declarative method. Charts will have all these yaml files for all objects together as a package. Charts will have :  a. NAME  b. DESCRIPTION  c. VERSION   Templates will have placeholders for each Kubernetes kind object YAML file, that can be rendered using values.yaml file. Which will have parameters. It is greater flexibility and replaces and reuses the parameters required for your microservices project that need to deploy on the Kubernetes. You can use as many apps need to deploy you can have different values files helm install --values value-app1.yaml Installation methods for Linux Op...

Kubernetes ReplicaSets - ReplicationController

Image
We have seen the word 'replicas' in the Docker Swarm services definition time. How to work with ReplicaSet?   What does ReplicaSet do? ReplicaSet will define the group of pods. You can tell how many replicas of pods for your application. The template section will define how many pods and their specification will be defined. Defining ReplicaSet allows you to deploy podand keep it alive as per configuration. How to create ReplicaSet? ReplicaSet relationship with Pod apiVersion: apps/v1 kind: ReplicaSet metadata: name: my-tcat-rs labels: version: "3.0" spec: replicas: 2 selector: matchLabels: project: MyWeb role: frontend template: metadata: labels: project: MyWeb role: frontend env: dev spec: conta...

Docker Service Stack deployment

Image
To work with Docker service stack deployment we should have an orchestrator either Swarm or Kubernetes. Here, in this post, I will be experimenting with the Docker swarm cluster. Prerequisites Docker installed machine Docker swarm initialized and active Create the manifestation file that describes the task, which will be available in the service definition. We can use the declarative definitions for each service in a YAML file.  Docker Swarm Service Stack Deployment I read the book: Learn Docker - Fundamentals of Docker 19.x , where I found the nice explanation given in the    Let's run the docker swarm visualizer container, which will show the Swarm cluster node status, container service status it will be very clear to understand how the orchestrator capabilities work for Docker containers. docker run -it –d \ -p 8080:8080 \ -v /var/run/docker.sock:/var/run/docker.sock \ dockersamples/visualizer Alternatively, you can use the docker-compose file a...

Creating your Custom Image using Dockerfile

Image
How do you create docker image? There are multiple ways to create new docker images docker commit: creates a new layer (and a new image) from a running container. docker build: performs a repeatable build sequence using dockerfile. docker import: loads a tarball into Docker engine, as a standalone base layer. We don't prefer to use docker import, because the import option can be used for various hacks, but its main purpose is to bootstrap the creation of base images. Working on Docker Custom Image Docker images can be pulled from Docker registries. Docker owns Docker Hub and Docker cloud public repositories where you could find the free images. Docker store is a place where Docker images could be on sale. You can create an image and sell it who need it. Docker client is CLI which allows us to deal with the Docker objects. Docker objects are Docker images, Containers, Network, volumes and services. An image is a read-only template that allows us to create instances in ru...

Python Web Framework Flask App on Docker Container

Image
 Namaste this post is an extension of the Docker image management. In this post, I would like to talk about how the Dockerfile content will work to build the Python web framework using the Flask app. Let's consider a web platform we have multiple choices to use as a web application to run on docker container: Python web app using Flask Node.JS app Web app run with Go For all these program execution structures is similar you must have 'app' folder. Where you can write your web application code. FROM python:3.9.4-alpine COPY requirements.txt / RUN pip3 install -r /requirements.txt COPY . /app WORKDIR /app ENTRYPOINT ["./gunicorn.sh"] Here the base image used as Python3 version with apline which is thinner image. As pip installer will use requirement.txt file to install the dependencies libraries and packages required for running Flask. COPY instruciton used to copy the files from docker host machine to container image. WORKDIR is like cd command. ENTRYPOI...

Docker Private Registry with Frontend UI

Image
Hey! In this DevOps learning post, I've done my experiment on Docker Registry-Server connecting with the docker registry UI as a frontend. To support this Frontend service, we have an Apache HTTP server container used as a docker-registry-frontend image. Docker Registry Server connect with Frontend UI Step 1: Go to the docker hub search for 'docker-registry-frontend' given version Pull the image to your local system. docker pull registry docker pull konkardkleine/docker-registry-frontend:v2 docker images docker network create registry docker network ls Step 2: Create the registry server using a docker container run command which expose the port as 5000 and the network that we have created in the step1. This separate network creation will be easy to isolate with other containers running on the same host. docker run --rm -d -p 5000:5000 --name registry-server \ --network registry To verify the access of registry-server docker logs registry-server -f Step 3:  You ca...