# DKP 2.1.1 Multi-Tenant Logging **Deploy Workspace Logging (Default Workspace)** ## :memo: Pre-Requisites - [ ] One Management cluster with SSO capability - [ ] One Managed cluster with SSO configured - [ ] Kubectl Access to the both cluster via admin - [ ] Admin access to Management cluster UI :::info :bulb: **Hint:** Logging has to enabled at cluster level as the access is tied to the ingress controller :bulb: This guide deploys the logging stack using UI instead of CLI. ::: **Step 1: Deploy logging at workspace** a. Using the UI Deploy logging dashboard on the your desired workspace. In this example its we using the default workspace. ![](https://i.imgur.com/wIc6PPC.png) Select workspace --> Go to Application on left nav window --> Deploy all 5 loggin apps :::info :bulb: **Hint:** You need to deploy of the components for the stack to work. ::: **Step 2: Deploy logging at project level** a. Select the workspace where loggin in deployed. In this case its Deployed in default workspace b. Select Projects and click on the project when you need loggin deployed c. While in desired project, select application on the hoirzontal nav section for projects and deploy all of 3 of the logging applications ![](https://i.imgur.com/4vXv94g.png) **Step 3: Validate all helm app deployments are created** You must wait for the Project’s logging stack HelmReleases to deploy before configuring or using the Project-level logging features, including multi-tenancy: 1. Run the following commands on the **management cluster**: Execute the following command to get the namespace of your workspace ```bash=1 kubectl get workspaces ``` Copy the value under WORKSPACE NAMESPACE column for your workspace. This may NOT be identical to the Display Name of the Workspace. 2. Export the WORKSPACE_NAMESPACE variable: ```bash=2 export WORKSPACE_NAMESPACE=<WORKSPACE_NAMESPACE> ``` 3. Execute the following command to get the namespace of your project ```bash=3 kubectl get projects -n ${WORKSPACE_NAMESPACE} ``` Copy the value under PROJECT NAMESPACE column for your project. This may NOT be identical to the Display Name of the Project. 4. Export the PROJECT_NAMESPACE variable: ```bash=4 export PROJECT_NAMESPACE=<PROJECT_NAMESPACE> ``` Run the following commands on the **attached cluster**: :::info :bulb: **Hint:** Ensure you switch to the correct context or kubeconfig of the attached cluster for the following kubectl commands. ::: 5. Check the deployment status using this command on the attached cluster: ```bash=5 kubectl get helmreleases -n ${PROJECT_NAMESPACE} ``` NOTE: It may take some time for these changes to take effect, based on the duration configured for the Flux GitRepository reconciliation. When successfully deployed, you will see output that includes the following HelmReleases: ``` NAMESPACE NAME READY STATUS AGE ${PROJECT_NAMESPACE} grafana-logging True Release reconciliation succeeded 15m ${PROJECT_NAMESPACE} loki-distributed True Release reconciliation succeeded 11m ``` 6. Run the following commands on the **attached cluster** to access the Project’s Grafana UI: ```bash=6 kubectl get ingress -n ${PROJECT_NAMESPACE} ${PROJECT_NAMESPACE}-project-grafana-logging -o go-template='https://{{with index .status.loadBalancer.ingress 0}}{{or .hostname .ip}}{{end}}{{with index .spec.rules 0}}{{with index .http.paths 0}}{{.path }}{{end}}{{end}}{{"\n"}}' ``` 7. To access logs explore tab use this UI ```bash=7 kubectl get ingress -n ${PROJECT_NAMESPACE} ${PROJECT_NAMESPACE}-project-grafana-logging -o go-template='https://{{with index .status.loadBalancer.ingress 0}}{{or .hostname .ip}}{{end}}{{with index .spec.rules 0}}{{with index .http.paths 0}}{{.path }}{{end}}{{end}}/explore{{"\n"}}' ``` 8. At the top of the page, change the datasource to Loki. It may take a sometime to generate any useful logs but you should see the logs. Click on `Log browser` --> select the parameters you wanna see and click on `Run Query` on the Top Right. You should see project level logs :::info :bulb: **Hint:** You may be prompted to log in using the SSO flow. See Kommander Security for more information. ::: After 5 minutes, I was getting logs :-) ![](https://hackmd.io/_uploads/SyGfG_ly5.png)