Giter Site home page Giter Site logo

devops-assessment's Introduction

Devops-Assessment

Part I (Deliver Terraform Code)

  • The terraform code is in the part-1 directory

  • To run this, you need to create a .tfvars file e.g part1.tfvars

  • The file would house the variable storage_account_name and its value.

  • This is due to the fact that its unique across azure, so a default value cannot be set

  • To run, you also need to create a Service Principal that terraform would use to authenticate to Azure

  • You can create the service principal by running "az ad sp create-for-rbac --name name --role Contributor --scopes /subscriptions/subscription-id"

  • You would get a json output containing some credentials.

  • you can store the values in a .env file in this format, export ARM_CLIENT_ID="appId" export ARM_CLIENT_SECRET="password" export ARM_TENANT_ID="tenant" export ARM_SUBSCRIPTION_ID="subscription-id"

  • Each export should be in a new line, then you can run source .env. This would export those variables for you in your shell

  • You also need to update the backend.tf file with the correct values

    • The resource group name
    • The storage account name
    • The container name
  • Then you can finally run;

    • terraform init
    • terraform plan -var-file="part1.tfvars"
    • terraform apply -var-file="part1.tfvars"

Part II (Deliver Small App for K8S and a Helm Chart)

  • Here we have the whole code in the part-2 directory

  • The application folder there contains the python app with its Dockerfile

  • The list-chart folder is the application helm chart

  • To run the application loclaly, you can run a docker build and run command

    • docker build -t list-chart .
    • docker run -d -p 8002:8002 list-chart
  • You can also deploy this into a kubernest cluster by running the below

    • Ensure to Update the values.yaml file with the correct values the value of AZURE_STORAGE_ACCOUNT_KEY
    • helm upgrade --install --atomic --timeout 300s helm-list-app ./list-chart -f ./list-chart/values.yaml -n default

Part III (Setup an AKS cluster and Azure SQL Database )

  • The terraform code is in the part-3 directory

  • To run this, you need to create a .tfvars file e.g part3.tfvars

  • The file would house the following variables

    • aks_service_principal_app_id
    • aks_service_principal_client_secret
    • administrator_login
    • administrator_login_password
  • The aks service principal credentials are the appId and secret gotten from creating the service principal below

  • The Administrator login and password are the credentials to the mssql server

  • This is due to the fact that its unique across azure, so a default value cannot be set

  • To run, you also need to create a Service Principal that terraform would use to authenticate to Azure

  • You can create the service principal by running "az ad sp create-for-rbac --name name --role Contributor --scopes /subscriptions/subscription-id"

  • You would get a json output containing some credentials.

  • you can store the values in a .env file in this format, export ARM_CLIENT_ID="appId" export ARM_CLIENT_SECRET="password" export ARM_TENANT_ID="tenant" export ARM_SUBSCRIPTION_ID="subscription-id"

  • Each export should be in a new line, then you can run source .env. This would export those variables for you in your shell

  • You also need to update the backend.tf file with the correct values

    • The resource group name
    • The storage account name
    • The container name
  • Then you can finally run;

    • terraform init
    • terraform plan -var-file="part3.tfvars"
    • terraform apply -var-file="part3.tfvars"

Part IV (Helm Chart GitHub Action)

  • A github actions workflow has been included
  • This workflow will trigger whenever there is a merge to the main branch
  • The workflow will authenticate to azure, package the helm chart created in Part II and push the helm chart to the Azure blob storage helm repo created in Part I

devops-assessment's People

Contributors

eniayomi avatar

Watchers

 avatar

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.