Skip to content
This repository has been archived by the owner on May 20, 2022. It is now read-only.

AlbanAndrieu/kayrros

Repository files navigation

Nabla kayrros

Kayrros devops tests

Table of contents

Requirements

General guidance

  • Provide deliverables as a tarball or zip file
  • Manage code with git and make sure the history is clean
    • I missed a bit time to clean/squash my commit.
  • Prefer Python or Go for any scripting need
    • Python is for sure tmy targetted language
    • Would be happy to lean GO
  • Prefer Terraform for any Infrastructure as Code need
    • This test gave me the occasion to play with terraform. Thanks...
  • Document everything, at least with READMEs
    • READMEs are my entrypoint for doc, as you can see on my github projects
  • Provide code testing where relevant
  • Write code following coding best practices
    • With more time, I would
  • The level of details given is part of the test, do your best with what you have.
    • This tests without infra takes time...

Pet clinic

As equivalent to PetClinic, Please look at Sample. A Java/Javascript project equivalent that I am using since years to test CI/CD new features and stability of CI/CD. This project is working on Rancher cluster and AKS.

  1. Create an EKS cluster

Based java-app-deployment-to-aws-eks-with-terraform

terraform init
terraform validate
terraform fmt
terraform plan
terraform apply
  • For Dev I am configuring workstation on Ubuntu LTS using microk8s
  • Dev and QA clusters have k8s clusters using VM and rancher. k8s nodes are provisionned using ansible. Docker images and charts are on Harbor
  • We are currently migrating to AKS and ACR
  • My personnal AWS account is locked. I tried to recreate one but credit card is not working. So petclinic helm chart have been tested on my workstation (Ubuntu LTS with microk8s)

To conclude, I did manage to create AKS managed cluster at petclinic-native. BTW AWS is not free... But tool is great.

I used hub.docker.com instead of ECR... And Github to store my chart.

terraform show
  1. Adapt PetClinic application to run on the previously created cluster

I have created a fork of PetClinic which is PetClinic. History is not cleaned. Sorry.

git submodule add --force https://github.com/AlbanAndrieu/spring-petclinic.git
  1. Integrate(a dummy test is fine) and deploy using any CI/CD tool
  • As a sample project, you can look at : https://github.com/AlbanAndrieu/nabla-projects-interview-visma, previously deployed with docker-compose on Jenkins and many other java projects, where I have added many tests (unit tests, integration, frontend, perf)... Feel free to ask.

    1. Jenkins
    1. Other CI/CD Tools

    I used this techinical tests to work on github action, as it seems to evolve quicly, so that you will see maven build, then docker and helm charts creation. Unfortunalty I did not manage to deploy.

    1. Testing
    • I used to be C++/Java developper and as a DevOps I test frameworks for all the stack. Unit tests Junit / Integration tests Maven Cargo / EndToEnd test (Selenium) / Performance tests for Java. CPPUnit for C++. And DevOps for Javascripts (Karma, Protractor)/Python (Tox/Pytest) now...
    • Security tests (Checkmarx, Aqua, WhiteSource, Bandit)
    1. Quality and Best pratices
      • Deployement
    • Old deployment is using docker-compose on Jenkins using shell
    • New deployment is using helm charts
    • I do no really to plan to deploy services with terraform. Helm seems fins for that. But it a great tool to create kubernetes clusters (I guess, because it did not work for me).
  1. Make sure your deliverables are working out of the box

Petclinic charts are working HELM out of the box.

Below should work on you cluster, if you can access docker hub...

helm install --kubeconfig ${HOME}/.kube/config --kube-context microk8s my-petclinic helm-petclinic-1.0.0.tgz --timeout 5m0s --wait --atomic --replace

To conclude I did basic CI, but not CD for this tests. But I can show you that I do CD at work...

Essay

Pick a subject below and write a 500-1000 words essay

  1. How has DevOps changed the way we deploy applications?
  2. What is the difference between DevOps and SRE?
  3. What is the right balance between Public and Private Cloud?
  4. What do you think is the next big game-changer in IT infrastructures?

I will choose subject 1.

See ESSAY

Python/SQL debug

  1. Provided the code below, please provide extensive answers to the listed issues
  • When running this script, Python is unable to find the imported modules
  • The following error keeps coming up: "boto3 client NoRegionError: You must specify a region" when connecting to SSM and RDS
  • When the DB is created, privileges aren't working as expected
  1. Provide an updated version of the script migrated to PostgreSQL.

See PYTHON

ECR

Create ECR

aws ecr get-login-password --region ${AWS_REGION} | docker login --username AWS --password-stdin 172728779084.dkr.ecr.eu-central-1.amazonaws.com/petclinic-native

Push image

#docker pull nabla/petclinic-native:latest

docker tag nabla/petclinic-native:latest 172728779084.dkr.ecr.eu-central-1.amazonaws.com/petclinic-native
docker push 172728779084.dkr.ecr.eu-central-1.amazonaws.com/petclinic-native:latest

Replace image in k8s

Replace nabla/petclinic-native:latest by 172728779084.dkr.ecr.eu-central-1.amazonaws.com/petclinic-native:latest in kubernetes.tf

Github - Terraform - AWS

terraform-github

terraform-petclinic-native

terraform-aws

About

Kayrros devops tests

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published