This page reports instructions on how to run the Legend Helm chart on a local Minikube installation. The whole process should take from 15 to 30 minutes, depending on your knowledge on cloud native technologies, your current workstation setup and your connection speed.
Please refer to https://minikube.sigs.k8s.io/docs/start/
Please refer to https://helm.sh/docs/intro/install/
Please refer to https://ngrok.com/download
If you don't have already an account, please sign up on https://gitlab.com , then sign in.
To make our life easier, let's copy/paste some aliases in our terminal(s):
alias k8context="kubectl config get-contexts"
alias k8ns="kubectl get namespace"
alias k8get="kubectl get $@"
alias k8del="kubectl delete $@"
alias k8all="kubectl get all $@"
alias k8log="kubectl logs -f $@"
alias k8svc="kubectl get svc $@"
alias k8desc="kubectl describe $@"
With the following commands, we'll start minikube (with right amount of resources and plugins) and switch the kubectl
context to point at it:
minikube start --memory 4096
minikube addons enable ingress
eval $(minikube docker-env)
kubectl config use-context minikube
Below the expected outcome:
π minikube v1.18.1 on Darwin 11.6
βͺ MINIKUBE_ACTIVE_DOCKERD=minikube
β¨ Automatically selected the hyperkit driver. Other choices: virtualbox, ssh
π Starting control plane node minikube in cluster minikube
π₯ Creating hyperkit VM (CPUs=2, Memory=4096MB, Disk=20000MB) ...
π³ Preparing Kubernetes v1.20.2 on Docker 20.10.3 ...
βͺ Generating certificates and keys ...
βͺ Booting up control plane ...
βͺ Configuring RBAC rules ...
π Verifying Kubernetes components...
βͺ Using image gcr.io/k8s-minikube/storage-provisioner:v4
π Enabled addons: storage-provisioner, default-storageclass
π Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default
Switched to context "minikube".
If you now run k8context
, you should get minikube
as the current one:
CURRENT NAME CLUSTER AUTHINFO NAMESPACE
* minikube minikube minikube default
If you want to know the local IP that Minikube is using, simply run minikube ip
.
To allow gitlab.com to call your application, we'll need to create a tunnel between your Minikube virtual machine (port 80) and a public host; we use NGrok for that.
Open a new terminal window and run ngrok http $(minikube ip):80
, below is the expected output:
Session Status online
Account Maurizio Pillitu (Plan: Free)
Update update available (version 2.3.40, Ctrl-U to update)
Version 2.3.38
Region United States (us)
Web Interface http://127.0.0.1:4040
Forwarding http://4114-139-47-125-122.ngrok.io -> http://192.168.64.10:80
Forwarding https://4114-139-47-125-122.ngrok.io -> http://192.168.64.10:80
Connections ttl opn rt1 rt5 p50 p90
0 0 0.00 0.00 0.00 0.00
In this case, 4114-139-47-125-122.ngrok.io
is our host, or $HOST_DNS
.
Legend relies on Gitlab to host data models, map user permissions and much more; for this demo we will use GitLab.com. Follow these steps to create a Gitlab.com Application and allow Legend to run operations against your GitLab projects.
- Navigate to
User Settings > Applications
- Create a new application
- Set the following parameters:
- Name: Legend Demo
- Redirect URI:
http://{HOST_DNS}/engine/callback http://{HOST_DNS}/sdlc/api/auth/callback http://{HOST_DNS}/sdlc/api/pac4j/login/callback http://{HOST_DNS}/studio/log.in/callback
- Enable the "Confidential" check box
- Enable these scopes: openid, profile, api
- Save Application
- Grab the
Application ID
(needed to setGITLAB_OAUTH_CLIENT_ID
) andSecret
(needed to setGITLAB_OAUTH_SECRET
) that is associated to the Application
Open a new terminal and run the following commands:
git clone https://github.com/naeemarsalan/legend.git
cd legend
git checkout feature/helm-chart-installer
export HOST_DNS="4114-139-47-125-122.ngrok.io"
export GITLAB_OAUTH_CLIENT_ID="xyz"
export GITLAB_OAUTH_SECRET="123"
helm install legend ./installers/helm/ --set env.LEGEND_HOST="$HOST_DNS" \
--set env.GITLAB_OAUTH_CLIENT_ID="$GITLAB_OAUTH_CLIENT_ID" \
--set env.GITLAB_OAUTH_SECRET="$GITLAB_OAUTH_SECRET" \
--set sdlc.tag="0.54.0" \
--set studio.tag="0.2.56" \
--set engine.tag="2.46.0" \
--namespace legend \
--create-namespace
This command should take roughly 100 seconds for the first run; if Docker images are already downloaded, should take roughly 40 seconds.
Run k8get pod -n legend
to know if/what Legend components are running; the expected outcome is that all pods are runnning (check the READY
column for 1/1
):
NAME READY STATUS RESTARTS AGE
pod/legend-engine-66fc94c79-t5v4b 1/1 Running 0 1m46s
pod/legend-mongo-8d4dcd4bd-fn8xp 1/1 Running 0 1m46s
pod/legend-sdlc-5f5d4d89c4-ntp69 1/1 Running 0 1m46s
pod/legend-studio-5d7dd777bb-tmsh4 1/1 Running 0 1m46s
You can now access http://${HOST_DNS}/studio
In the dropdown, you should be able to see one workspace for each Project in Gitlab.com that you can access and has a Topic
called pure
; you can set project Topics
from Settings > General
.
- To uninstall Helm chart, run
helm uninstall legend -n legend
- To restart from a fresh Minikube environment, run
minikube delete
and start minikube again (see above). - After redeployments, it's recommented to Clear browser cookies associated with
{DNS_HOST}
.