Code Monkey home page Code Monkey logo

assesmentbdiplus's Introduction

QUESTION:

  • Use case: Need to create a 3-tier web application using Docker + Kubernetes utilizing any of their favorite Infrastructure as Code. It can be a dummy application or hello world too. But should be able to demonstrate the understanding of the technologies. ANSWER:

  • Basic 3 tier of an application consists of 3 layers

    1. The presentation layer
    1. application layer
    1. database layer Preview
  • The architecture of the deployment is Preview

    1. presentation layer of the application represents the UI, and provides the user interface for interaction and the display of information. This layer could be a web application, mobile application, or a third-party application consuming your services.
    1. An application layer is an abstraction layer that specifies the shared communications protocols and interface methods used by hosts in a communications network. An application layer abstraction is specified in both the Internet Protocol Suite (TCP/IP) and the OSI model.
    1. Database layer consists of a database which is attched to application for data storage.
  • For the purpose iam taking the Python flask application whichh consists of an application and mysql database. referhere

  • I have already build the docker image and pushed it into the docker repository referhere.

  • For the deployment of this application i am using the EKS k8s cluster. The eks cluster is created through eksctl.

  • Then i have created two types of pods

  • a. One is the pod which contains the application.

  • b. Second one is the pod which contains the mysql pod.

  • For this application i have taken the aws infrastucture through Terraform.

  • The instance for building docker image was built through terraform.

  • For creating cluster through eksctl we have following steps

    1. Create a linux instance, install aws cli, create iam credentials
    1. install kubectl Referhere
    1. Install eksctl referhere
    1. Create a file called as cluster.yaml with the following content
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig

metadata:
  name: basic-cluster
  region: us-west-2

nodeGroups:
  - name: basic
    instanceType: t2.large
    desiredCapacity: 2
    volumeSize: 20
    ssh:
      allow: true # will use ~/.ssh/id_rsa.pub as the default ssh key

    1. Execute ssh-keygen ssh-keygen
    1. add the key to aws
    1. Now execute the command eksctl create cluster -f cluster.yaml Preview Preview
  • Now apply the manifests.
  • then run 'kubectl get deplloyments' Preview
  • to know about pods apply 'kubectl get pods' Preview
  • To get the services, run 'kubectl get svc' Preview
  • The website interface Preview
  • In this we are using two pods one is for app and another is for db(mysql).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.