DevOps Classroomnotes 25/Jun/2022

Docker Networking

  • Docker Networking Architecture is based on Container Network Model (CNM)
  • Refer Here for the docker container networking article

Cluster

  • A server cluster is group of two or more nodes (servers), that run in parallel to acheive a common goal
  • A cluster functions as if it were a single system. A user accessing the cluster should not need to know whether the system is a cluster or individual machine
  • Benifits:
    • High Availability
    • Load Balancing
    • Scaling
    • Performance
  • To manage clusters we generally use cluster orchestration software
  • Container Orchestration Softwares
    • Docker Swarm
    • Kubernetes
    • Mesos
  • Using Container Orchestration Softwares, we enable
    • multi node setups
    • we express the desired state rather than commands to create containers
  • Generally Orchestration softwares have two kinds of nodes
    • master nodes (manager)
    • nodes (worker)
  • To decide which node is manager there are consensus algorithms like RAFT etc which will choose the manager by election.

Docker Swarm Setup

  • Refer Here for the article
  • Create 3 ubuntu instances and install docker in them
  • explore swarm command line
    Preview
    Preview
  • Note the output
Swarm initialized: current node (4zbhonvbfzpzs2dzbbgjcmfz3) is now a manager.

To add a worker to this swarm, run the following command:

    docker swarm join --token SWMTKN-1-02wrpqrep3ytgxynjurslwjseu4898o1vvbi0cozh00eth7ova-aswifi8z4zrdwmnl51nzyd7li 172.31.7.10:2377

To add a manager to this swarm, run 'docker swarm join-token manager' and follow the instructions.
  • When the swarm is initialized docker will create an overlay network
    Preview
  • Docker has one more subcommand node
    Preview
    Preview
  • Basic interaction diagram
    Preview
  • In swarm we create services
    Preview
    Preview
    Preview
    Preview
  • Note: Sending the image to docker hub
    Preview
  • For experimentation lets use the container image shaikkhajaibrahim/qttestapp:1.0 Refer Here
  • Create a service using test app docker service create --name testapp --replicas 2 --publish published=5001,target=5000 shaikkhajaibrahim/qttestapp:1.0
    Preview
  • To access the test app use any nodes ip with 5001
  • Understanding how overlay works Refer Here

Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Animated Social Media Icons by Acurax Wordpress Development Company

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Visit Us On FacebookVisit Us On LinkedinVisit Us On Youtube