Giter Site home page Giter Site logo

phrase-test-task's Introduction

Test task

Short description

This main goal of this task is to containerize the application in the ./src directory, setup infrastructure and CI/CD. I chose Hetzner CLoud for the provider, terraform and ansible for infrastructure provision and server setup: setting the users and microk8s configuration. GitHub Actions is used for build and deploy with self-hosted agent.

Setup

First, it's important to generate the key which will be used for ssh connection to the server: ssh-keygen -f ~/.ssh/hetzner -t rsa -b 4096 -N '' -C ''

Also, let's put other public keys in the ~/.ssh directory for future automation of users creation process: cp phrase_admin.pub phrase_user.pub ~/.ssh

Now, It should be created new project and API token in the Hetzner Cloud: the token should be placed in the ./terraform/terraform.tfvars in the variable hcloud_token = %PLACE_TOKEN_HERE%

After that it's possible to run terraform init, terraform plan and terraform apply from the ./terraform directory. That should create server with ipv4 address attached and all the necessary users setup.

Terraform automatically creates inventory for ansible, so we could cd into ./ansible and run ansible-playbook microk8s.yml --private-key ~/.ssh/hetzner -i inventory -e "github_token=%TOKEN_FOR_SELFHOSTED_AGENT%" -e "install_github_agent=true"

It's needed the github token for the self-hosted runner, there is description how to setup it: https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/adding-self-hosted-runners

After running ansible playbook any changes of the source code or helm chart will be deployed to the microk8s cluster and will be available through ingress

phrase-test-task's People

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.