Giter VIP home page Giter VIP logo

mat-infra's Introduction

Terraform configuration for Master Thesis Project

Local infrastructure

For local setup Vagrant is used. Vagrant comes with a concept of boxes, which essentially are images of ready made virtual machines. Various images can be downloaded from https://app.vagrantup.com/boxes/search[Vagrant Cloud]. The defintion of infrastructure is done in a file called "Vagrantfile". Following commands can be used to initiate the creation of local infrastructure.

Prerequisites:

  • Virtual Box
  • Vagrant, incl. vagrant-disksize plugin
brew install vagrant
brew install ngrok/ngrok/ngrok
vagrant plugin install vagrant-share
vagrant plugin install vagrant-disksize
vagrant init phoenixmedia/k3s
vagrant up 

# copy the kubeconfig file from the vm to be able to connect from outside

# install operator lifecycle manager

Halyard Spinnaker

https://spinnaker.io/docs/setup/install/faq/

# all hal commands https://spinnaker.io/docs/reference/halyard/commands/
# apply configuraiton change with
hal deploy apply

Flagger

Prereq. setup FluxCD

brew install fluxcd/tap/flux export GITHUB_TOKEN=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 export GITHUB_USER=caf3babe

Cloud infrastructure

Flagger

terraform -chdir=azure/flagger apply -auto-approve

# start, stop aks cluster
az aks stop --name aks-prod -g mat-project-2110838008-prod
az aks start --name aks-prod -g mat-project-2110838008-prod

terraform -chdir=azure/flagger apply -replace=azurerm_kubernetes_cluster.aks_flagger -auto-approve

Argo Rolouts

terraform -chdir=azure/flagger apply -auto-approve

# start, stop aks cluster
az aks stop --name aks-prod -g mat-project-2110838008-prod
az aks start --name aks-prod -g mat-project-2110838008-prod

terraform -chdir=azure/flagger apply -replace=azurerm_kubernetes_cluster.aks_flagger -auto-approve

Spinnaker

Spin up kubernetes cluster in azure

./init-spinnaker.sh

# from mat-deploy repo execute deploy-services as instructed in the REAMDE.md of that repo

Destroy Spinnaker cluster including config

terraform -chdir=azure/spinnaker destroy -auto-approve
docker stop halyard
rm -r azure/spinnaker/hal-config
rm azure/spinnaker-secrets.yaml

Port forward to use Spinnakers web UI

kubectl port-forward svc/spin-deck 9000:9000 > /dev/null &
kubectl port-forward svc/spin-gate 8084:8084 > /dev/null &

kubectl port-forward -n monitoring svc/kube-prometheus-stack-grafana 8080:80 > /dev/null &

Backup/restore halyard config

# === backup config
hal backup create
cp /home/spinnaker/halyard-2023-03-05_18-09-14-181Z.tar /home/spinnaker/.hal/

# === restore config
hal backup restore --backup-path /home/spinnaker/.hal/halyard-2023-03-05_18-09-14-181Z.tar

mat-infra's People

Contributors

aqcep 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.