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...
-
your Kuberenetes clusters set up and ports open
-
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
-
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
-
Set up node exporter; https://devopscube.com/node-exporter-kubernetes/
-
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 itallow_embedding = true
- [auth.anonymous]
enabled = true org_name = Main Org. org_role = Viewer
http_port = 3001
-
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
- 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 - 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 - 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
- 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
- Use Helm to install Prometheus package which includes Alert Manager: https://www.containiq.com/post/prometheus-alertmanager
- Create port forwards as instructed in article
- Create account on Mailtrap or similar site for email testing purposes
- Be sure to create alertmanager-config.yaml and alert-rules.yaml in an accessible directory, root is recommended
- After testing, run VaaS normally and modify alerts as needed. Do not exit server while Helm is upgrading or errors will result
Installation
- Clone this repository onto your local machine
git clone https://github.com/oslabs-beta/VaaS.git
- Install dependencies
npm install or npm install --legacy-peer-deps
- 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
- 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
- Jimmy Lim @Radizorit | Linkedin
- Alex Kaneps @AlexKaneps | Linkedin
- James Chan @j-chany | Linkedin
- Vu Duong @vduong021 | Linkedin
- Matthew McGowan @mcmcgowan | Linkedin
- Murad Alqadi @murad-alqadi | Linkedin
- Kevin Le @xkevinle | Linkedin
- Richard Zhang @rich9029 | Linkedin
- Irvin Le @irvinie | Linkedin
Show your support
Give a ⭐️ if this project helped you!