neighbor-peace / VaaS

Modular Kubernetes Management System with OpenFaaS Support

Home Page:https://vaas.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

VaaS
Visualization tool for OpenFaas

NOTE: The initial instructions below are meant to get you in and testing the development version of VaaS on your local machine as quickly as possible

Before firing up and installing VaaS, please make sure to have...

  1. your Kuberenetes clusters set up and ports open

  2. create a Prometheus deployment - with ports properly forwarded: https://devopscube.com/setup-prometheus-monitoring-on-kubernetes/
    a) Terminal: kubectl get pods --namespace=monitoring
    b) kubectl port-forward <prometheus-deployment name> 30000:9090 -n monitoring

  3. Set up Kube State metrics: https://devopscube.com/setup-kube-state-metrics/
    a) kubectl port-forward svc/kube-state-metrics 30135:8080 -n kube-system

  4. Set up node exporter; https://devopscube.com/node-exporter-kubernetes/

  5. Install Grafana through standalone macOS binaries; https://grafana.com/docs/grafana/latest/setup-grafana/installation/mac/
    a) if on macOS, enable view hidden files and navigate to /usr/local/etc/grafana/; https://grafana.com/docs/grafana/latest/setup-grafana/configure-grafana/
    b) make a copy of grafana.ini and rename the copy to custom.ini c) in both custom.ini AND grafana.ini, modify the following settings: DISCLAIMER: remember to remove the semicolon in front of the setting to enable it

    1. allow_embedding = true
    2. [auth.anonymous]
      enabled = true
      org_name = Main Org.
      org_role = Viewer 
    3. http_port = 3001
  6. Download CLI tools with arkade; https://github.com/alexellis/arkade
    a) curl -sLS https://get.arkade.dev | sh
    b) complete section, "Download CLI tools with arkade" in github link

Skip to appropriate section -

Prerequisites ( OPTIONAL ) Create a containerized image of your application

  1. Set up a Kubernetes cluster https://kubernetes.io/docs/tasks/tools/
    a) Setting up Kind to run local cluster: https://kind.sigs.k8s.io/docs/user/quick-start/
    b) Setting up minikube to run local cluster: https://minikube.sigs.k8s.io/docs/start/
    c) Install kubectl
  2. Deploying Prometheus onto you clusters: https://devopscube.com/setup-prometheus-monitoring-on-kubernetes/
    a) Follow the guide to deploy and port forward properly - keep track of the monitoring pods and which port you're forwarding it to on localhost
  3. Deploy OpenFaaS to Kubernetes: https://goncalo-a-oliveira.medium.com/setting-up-openfaas-with-minikube-28ed2f78dd1b
    a) Again keep track of your password, take special note of the command and how to temporarily store it as a temporary environment variable b) Note: If you close the terminal/command prompt you will have to refetch and reassign the PASSWORD before you can use the OpenFaaS CLI to sign in

If you want to set up and play with multiple clusters, make sure to have kind (requires Docker) and minikube up and running

  1. Navigating and moving between clusters
    i) To see all clusters - take note of the cluster names
    kubectl config view
    ii) To see current cluster
    kubectl config current-context
    iii) To switch into the cluster you want to configure/port forward
    kubectl config use-context [clusterName]
    iv) From here follow the steps under the "Using Kubectl port forwarding" - in link found in Step 2 of the pre-requisites

Documentation on best practice utilizing configuration files (recommended read): https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/

Optional - Setting up Ability to change alerts through VaaS

  1. Use Helm to install Prometheus package which includes Alert Manager: https://www.containiq.com/post/prometheus-alertmanager
  2. Create port forwards as instructed in article
  3. Create account on Mailtrap or similar site for email testing purposes
  4. Be sure to create alertmanager-config.yaml and alert-rules.yaml in an accessible directory, root is recommended
  5. After testing, run VaaS normally and modify alerts as needed. Do not exit server while Helm is upgrading or errors will result

Installation

  1. Clone this repository onto your local machine
 git clone https://github.com/oslabs-beta/VaaS.git
  1. Install dependencies
npm install or npm install --legacy-peer-deps 
  1. Set up .env file (create in root of VaaS folder)
JWT_ACCESS_SECRET=hello
JWT_REFRESH_SECRET=hello
JWT_EXP=400000000
JWT_GRACE=4000000000

MONGO_URL=@
MONGO_PORT=
MONGO_USERNAME=
MONGO_PASSWORD=
MONGO_COLLECTION=

EXPRESS_PORT=3020
EXPRESS_CONSOLE_LOG=on
  1. Run the app with
npm run dev

Set up order: You will need to port-forward Promethesus and openFaaS Grafana will need to be changed to port 3001 in customs.ini, but that will be in the documentation as well.

https://www.docker.com/products/docker-desktop/ https://minikube.sigs.k8s.io/docs/start/ https://goncalo-a-oliveira.medium.com/

Authors

Show your support
Give a ⭐️ if this project helped you!

About

Modular Kubernetes Management System with OpenFaaS Support

https://vaas.dev


Languages

Language:TypeScript 90.1%Language:CSS 8.7%Language:JavaScript 1.0%Language:HTML 0.2%