Jump to content

Docker & Kubernetes ki best tutorial


tamu

Recommended Posts

  • Replies 44
  • Created
  • Last Reply

Top Posters In This Topic

  • Spartan

    14

  • tamu

    8

  • dasari4kntr

    6

  • kothavani

    3

6 hours ago, Spartan said:

ECS ki aina faragate ki aina..u need to build docker image no..

underlying concept is same...

ECS or Faragte is just the service that runs the docker with bells and whistles..ante.

Fargate is serverless. Enta vadite anta payment.

ECS over EC2 instances. Vadina vadakapoina payment.

 

Link to comment
Share on other sites

21 minutes ago, Democraticcompulsion said:

Fargate is serverless. Enta vadite anta payment.

ECS over EC2 instances. Vadina vadakapoina payment.

 

SPOT

Link to comment
Share on other sites

copy pasting from my github...

a small exercise...in case if anyone want to practice...

 

Teamcity setup with docker stack

 

NOTE: using the mysql as backend for teamcity

 

version: '3.3'

services:
  db:
    image: mysql
    secrets:
      - db_root_password
      - db_dba_password
    deploy:
      replicas: 1
      placement:
        constraints: [node.role == manager]
      resources:
        reservations:
          memory: 128M
        limits:
          memory: 256M
    ports:
      - 3306:3306
    environment:
      MYSQL_USER: dba
      MYSQL_DATABASE: mydb
      MYSQL_ROOT_PASSWORD_FILE: /run/secrets/db_root_password
      MYSQL_PASSWORD_FILE: /run/secrets/db_dba_password
    networks:
      - appnet
  viz:
    image: dockersamples/visualizer
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock"
    ports:
      - "8090:8080"
    deploy:
      placement:
        constraints: [node.role == manager]
    networks:
      - appnet
  teamcity:
    image: jetbrains/teamcity-server
    volumes:
      - ./data/server/datadir:/data/teamcity_server/datadir
      - ./data/server/logs:/opt/teamcity/logs
    ports:
      - 8111:8111
    deploy:
      placement:
        constraints: [node.role == manager]
    networks:
      - appnet
  teamcity-agent:
    image: jetbrains/teamcity-agent
    volumes:
      - ./data/agent:/data/teamcity_agent/conf
    environment:
      SERVER_URL: http://teamcity:8111
    deploy:
      replicas: 3
    networks:
      - appnet
secrets:
  db_root_password:
    external: true
  db_dba_password:
    external: true

networks:
  appnet:
    external: true

 

 

step 1: create the network

docker network create --driver overlay appnet

 

step 2: creat the secrets

echo "password123" | docker secret create db_root_password -
echo "password456" | docker secret create db_dba_password -

 

step 3: create the below volume folder in the host (if you are replicating in other workers, make sure this structure is in workers as well)

./data/server/datadir
./data/server/logs
./data/agent/

 

step 4: deploy the docker stack

docker stack deploy -c ci-stack.yml ci

 

step 5: make sure your services are up and running

docker stack ps ci
ID                  NAME                  IMAGE                              NODE                DESIRED STATE       CURRENT STATE               
tiqs09jezgbv        ci_teamcity.1         jetbrains/teamcity-server:latest   manager             Running             Running about an hour ago
2wodvnxzzak8        ci_viz.1              dockersamples/visualizer:latest    manager             Running             Running about an hour ago
8sqiq8zl4lp4        ci_db.1               mysql:latest                       manager             Running             Running about an hour ago
jxffrtfsk6p0        ci_teamcity-agent.1   jetbrains/teamcity-agent:latest    worker2             Running             Running about an hour ago
ndffqvyo0mab        ci_teamcity-agent.2   jetbrains/teamcity-agent:latest    worker1             Running             Running about an hour ago

 

step 6: Check your database access (if you want)

docker exec -it $(docker ps -f name=ci_db.1 -q) mysql -u root -p

 

step 7: access the visulize container

http://{node ip}:8090

 

step 8: access the teamcity server

http://{node ip}:8111

 

step 9: during the teamcity initial setup (jdbc driver for mysql), this needs to be done once the docker services (teamcity) up

sudo wget "https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-8.0.13.tar.gz" -O mysql-connector-java-8.0.13.tar.gz
sudo tar -xzvf mysql-connector-java-8.0.13.tar.gz 
sudo cp ./mysql-connector-java-8.0.13.jar ./data/server/datadir/lib/jdbc/
Link to comment
Share on other sites

50 minutes ago, Democraticcompulsion said:

Fargate is serverless. Enta vadite anta payment.

ECS over EC2 instances. Vadina vadakapoina payment.

 

a cheppina bells and whistles ye Serverless...etc..

Link to comment
Share on other sites

4 hours ago, dasari4kntr said:

copy pasting from my github...

a small exercise...in case if anyone want to practice...

 

Teamcity setup with docker stack

 

NOTE: using the mysql as backend for teamcity

 


version: '3.3'

services:
  db:
    image: mysql
    secrets:
      - db_root_password
      - db_dba_password
    deploy:
      replicas: 1
      placement:
        constraints: [node.role == manager]
      resources:
        reservations:
          memory: 128M
        limits:
          memory: 256M
    ports:
      - 3306:3306
    environment:
      MYSQL_USER: dba
      MYSQL_DATABASE: mydb
      MYSQL_ROOT_PASSWORD_FILE: /run/secrets/db_root_password
      MYSQL_PASSWORD_FILE: /run/secrets/db_dba_password
    networks:
      - appnet
  viz:
    image: dockersamples/visualizer
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock"
    ports:
      - "8090:8080"
    deploy:
      placement:
        constraints: [node.role == manager]
    networks:
      - appnet
  teamcity:
    image: jetbrains/teamcity-server
    volumes:
      - ./data/server/datadir:/data/teamcity_server/datadir
      - ./data/server/logs:/opt/teamcity/logs
    ports:
      - 8111:8111
    deploy:
      placement:
        constraints: [node.role == manager]
    networks:
      - appnet
  teamcity-agent:
    image: jetbrains/teamcity-agent
    volumes:
      - ./data/agent:/data/teamcity_agent/conf
    environment:
      SERVER_URL: http://teamcity:8111
    deploy:
      replicas: 3
    networks:
      - appnet
secrets:
  db_root_password:
    external: true
  db_dba_password:
    external: true

networks:
  appnet:
    external: true

 

 

step 1: create the network


docker network create --driver overlay appnet

 

step 2: creat the secrets


echo "password123" | docker secret create db_root_password -
echo "password456" | docker secret create db_dba_password -

 

step 3: create the below volume folder in the host (if you are replicating in other workers, make sure this structure is in workers as well)


./data/server/datadir
./data/server/logs
./data/agent/

 

step 4: deploy the docker stack


docker stack deploy -c ci-stack.yml ci

 

step 5: make sure your services are up and running


docker stack ps ci

ID                  NAME                  IMAGE                              NODE                DESIRED STATE       CURRENT STATE               
tiqs09jezgbv        ci_teamcity.1         jetbrains/teamcity-server:latest   manager             Running             Running about an hour ago
2wodvnxzzak8        ci_viz.1              dockersamples/visualizer:latest    manager             Running             Running about an hour ago
8sqiq8zl4lp4        ci_db.1               mysql:latest                       manager             Running             Running about an hour ago
jxffrtfsk6p0        ci_teamcity-agent.1   jetbrains/teamcity-agent:latest    worker2             Running             Running about an hour ago
ndffqvyo0mab        ci_teamcity-agent.2   jetbrains/teamcity-agent:latest    worker1             Running             Running about an hour ago

 

step 6: Check your database access (if you want)


docker exec -it $(docker ps -f name=ci_db.1 -q) mysql -u root -p

 

step 7: access the visulize container


http://{node ip}:8090

 

step 8: access the teamcity server


http://{node ip}:8111

 

step 9: during the teamcity initial setup (jdbc driver for mysql), this needs to be done once the docker services (teamcity) up


sudo wget "https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-8.0.13.tar.gz" -O mysql-connector-java-8.0.13.tar.gz
sudo tar -xzvf mysql-connector-java-8.0.13.tar.gz 
sudo cp ./mysql-connector-java-8.0.13.jar ./data/server/datadir/lib/jdbc/

So the code is written in she'll or ruby

Link to comment
Share on other sites

7 hours ago, Spartan said:

cheppina bells and whistles ye Serverless...etc

Bro, interviews or certification exam lo bells and whistles ante ega diga choostaremo.

Serverless architecture is a huge concept. Including databases (Aurora serverless), almost anything can be serverless now. 

Lambda functions oka million times per month vadina 350 per month payment ante amazing kada..

SFor those who do not know,

Serverless concept is by no means bells and whistles. 

Beanstalk comes with preloaded environment and necessary architecture. After You create the environment, can customize it like a container too. And then create an AMI or golden AMI.

Kubernetes: Manage a cluster of Linux containers as a single system to accelerate Dev and simplify Ops. Kubernetes is an open source orchestration system for Docker containers.

Linux and open source are key words here.

 

 

 

Link to comment
Share on other sites

46 minutes ago, Democraticcompulsion said:

Bro, interviews or certification exam lo bells and whistles ante ega diga choostaremo.

Serverless architecture is a huge concept. Including databases (Aurora serverless), almost anything can be serverless now. 

Lambda functions oka million times per month vadina 350 per month payment ante amazing kada..

SFor those who do not know,

Serverless concept is by no means bells and whistles. 

Beanstalk comes with preloaded environment and necessary architecture. After You create the environment, can customize it like a container too. And then create an AMI or golden AMI.

Kubernetes: Manage a cluster of Linux containers as a single system to accelerate Dev and simplify Ops. Kubernetes is an open source orchestration system for Docker containers.

Linux and open source are key words here.

 

 

 

Uncle I eat drink and sleep serverless architecture daily.

containerization concept telvanodiki serverless varaku enduku ani bells and whistles ani cheppa...

oggeyi nannu 

  • Upvote 1
Link to comment
Share on other sites

33 minutes ago, Spartan said:

Uncle I eat drink and sleep serverless architecture daily.

 

Swarry uncle. Didn't mean to come strongly at it. All is well.

Link to comment
Share on other sites

ACTE is the best Training Institute in Chennai offers Classroom Training and Online Training on all the IT related courses like Java Training, J2EE Training, Web Designing Training, Digital Marketing Training, SEO Training, Software Testing Training and etc.. with assured Job Placement.

 

https://www.acte.in/php-training-in-chennai

https://www.acte.in/machine-learning-training-in-chennai

https://www.acte.in/iot-training-in-chennai

https://www.acte.in/blockchain-training-in-chennai

https://www.acte.in/openstack-training-in-chennai

 

Link to comment
Share on other sites

  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...