{"id":25493711,"url":"https://github.com/llanlan1/kubernetesdashboarddeploymentguide","last_synced_at":"2025-11-09T02:30:37.197Z","repository":{"id":278212232,"uuid":"934885941","full_name":"llanlan1/kubernetesDashboardDeploymentGuide","owner":"llanlan1","description":"A guide to deploying a Kubernetes Dashboard on Azure Kubernetes Service (AKS) with setup, deployment, and troubleshooting steps.","archived":false,"fork":false,"pushed_at":"2025-02-18T16:09:16.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-18T16:23:35.218Z","etag":null,"topics":["aks","aks-kubernetes-cluster","docker-image","dockerfile","kubernetes-cluster","kubernetes-deployment"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/llanlan1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-18T15:06:13.000Z","updated_at":"2025-02-18T16:09:20.000Z","dependencies_parsed_at":"2025-02-18T16:23:37.001Z","dependency_job_id":"3591a6f2-bd39-4a9a-b1d8-ac5ad1686b1e","html_url":"https://github.com/llanlan1/kubernetesDashboardDeploymentGuide","commit_stats":null,"previous_names":["llanlan1/kubernetesdashboarddeploymentguide"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llanlan1%2FkubernetesDashboardDeploymentGuide","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llanlan1%2FkubernetesDashboardDeploymentGuide/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llanlan1%2FkubernetesDashboardDeploymentGuide/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llanlan1%2FkubernetesDashboardDeploymentGuide/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/llanlan1","download_url":"https://codeload.github.com/llanlan1/kubernetesDashboardDeploymentGuide/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239565663,"owners_count":19660158,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aks","aks-kubernetes-cluster","docker-image","dockerfile","kubernetes-cluster","kubernetes-deployment"],"created_at":"2025-02-18T23:17:08.292Z","updated_at":"2025-11-09T02:30:37.152Z","avatar_url":"https://github.com/llanlan1.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kubernetes Dashboard Deployment Guide\n\nThis guide walks through deploying a Kubernetes dashboard on **Azure Kubernetes Service (AKS)** while resolving common issues. It covers setting up your environment, deploying services, and troubleshooting potential problems.\n\n---\n\n## **Prerequisites**\n\nEnsure you have the following installed:\n\n- **Azure CLI** ([Installation Guide](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli))  \n- **Kubectl** ([Installation Guide](https://kubernetes.io/docs/tasks/tools/install-kubectl/))  \n- **Docker** ([Installation Guide](https://docs.docker.com/get-docker/))  \n- **Admin access to an Azure Kubernetes Service (AKS) cluster**  \n  - **If you already have an AKS cluster,** retrieve its credentials:\n    ```sh\n    az aks list --output table  # Check if an AKS cluster exists\n    az aks get-credentials --resource-group k8s-resource-group --name k8s-cluster\n    ```\n  - **If you don't have an AKS cluster, follow Step 0 below.**\n\n✅ **Confirm your cluster is running**:\n```sh\nkubectl get nodes\n```\nIf nodes appear as `Ready`, your AKS cluster is set up correctly.\n\n---\n\n## **Step 0: Create an AKS Cluster (If Needed)**\n\nIf you don't already have an AKS cluster, create one with the following commands:\n\n```sh\naz group create --name k8s-resource-group --location eastus #location of your choice\naz aks create --resource-group k8s-resource-group --name k8s-cluster --node-count 1 --enable-managed-identity --generate-ssh-keys\n```\n\nRetrieve cluster credentials:\n\n```sh\naz aks get-credentials --resource-group k8s-resource-group --name k8s-cluster\nkubectl get nodes  # Verify nodes are Ready\n```\n\n---\n\n## **Step 1: Connect to Your AKS Cluster**\n\nRetrieve cluster credentials to interact with Kubernetes securely.\n\n```sh\naz login  # Authenticate with Azure\naz aks get-credentials --resource-group k8s-resource-group --name k8s-cluster\n```\n\n✅ **Verify the connection:**\n\n```sh\nkubectl config get-contexts\nkubectl get nodes\n```\n\nIf nodes are in `Ready` state, you are successfully connected.\n\n\u003e **Security Tip:** Avoid exposing kubeconfig paths. Instead, use:\n\u003e ```sh\n\u003e export KUBECONFIG=/tmp/kubeconfig\n\u003e az aks get-credentials --resource-group k8s-resource-group --name k8s-cluster --file /tmp/kubeconfig\n\u003e ```\n\u003e After use, remove the file:\n\u003e ```sh\n\u003e rm /tmp/kubeconfig \u0026\u0026 unset KUBECONFIG\n\u003e ```\n\n---\n\n## **Step 2: Build and Push the Docker Image**\n\n### **2.1 Create a `Dockerfile`**\n\n```dockerfile\nFROM nginx:alpine\nCOPY . /usr/share/nginx/html\nEXPOSE 80\nCMD [\"nginx\", \"-g\", \"daemon off;\"]\n```\n\n### **2.2 Build and Push the Image**\n\nReplace `YOUR-DOCKERHUB-USERNAME` with your actual Docker Hub username.\n\n```sh\ndocker build -t YOUR-DOCKERHUB-USERNAME/k8s-dashboard:v1 .\ndocker login\ndocker push YOUR-DOCKERHUB-USERNAME/k8s-dashboard:v1\n```\n\n---\n\n## **Step 3: Deploy Kubernetes Dashboard**\n\n### **3.1 Apply Deployment Configuration**\n\nCreate a `deployment.yaml` file and apply it.\n\n```sh\nkubectl apply -f deployment.yaml --validate=false\n```\n\n### **3.2 Apply Service Configuration**\n\nCreate a `service.yaml` file and apply it to expose the dashboard.\n\n```sh\nkubectl apply -f service.yaml --validate=false\n```\n\n✅ **Check if the service is running:**\n\n```sh\nkubectl get services\n```\n\nExpected output:\n\n```\nNAME                    TYPE           CLUSTER-IP        EXTERNAL-IP     PORT(S)        AGE\nk8s-dashboard-service   LoadBalancer   \u003cyour-cluster-ip\u003e \u003cyour-external-ip\u003e 80:32619/TCP  2m33s\n```\n\n---\n\n## **Step 4: Access the Dashboard**\n\nUse the external IP address of your service to access the dashboard in your browser:\n\n```\nhttp://\u003cyour-external-ip\u003e\n```\n\nIf successful, you should see **\"Welcome to the Internal Dashboard - Deployed on Kubernetes!\"** 🎉\n\n---\n\n## **Step 5: Verify and Debug (if necessary)**\n\n### **5.1 Check Running Pods**\n\n```sh\nkubectl get pods -A\n```\n\nEnsure all pods are running. If any are stuck in `Pending` or `CrashLoopBackOff`, debug using:\n\n```sh\nkubectl describe pod \u003cpod-name\u003e -n \u003cnamespace\u003e\nkubectl logs \u003cpod-name\u003e -n \u003cnamespace\u003e\n```\n\n### **5.2 Restart Pods if Needed**\n\n```sh\nkubectl delete pod \u003cpod-name\u003e -n \u003cnamespace\u003e\n```\n\n### **5.3 Troubleshoot Service Issues**\n\nIf the service is not accessible:\n\n1. **Check if the LoadBalancer has an assigned external IP:**  \n   ```sh\n   kubectl get services\n   ```\n2. **Restart the service:**  \n   ```sh\n   kubectl delete service k8s-dashboard-service\n   kubectl apply -f service.yaml\n   ```\n3. **If using `ClusterIP` instead of `LoadBalancer`, manually port-forward:**  \n   ```sh\n   kubectl port-forward svc/k8s-dashboard-service 8080:80\n   ```  \n   Then access it via `http://localhost:8080`.\n\n---\n\n## **Summary**\n\n✅ **Built and pushed Docker image** to Docker Hub  \n✅ **Deployed Kubernetes Dashboard** using AKS  \n✅ **Connected to Cluster** using `az aks get-credentials`  \n✅ **Checked Nodes and Services**  \n✅ **Debugged Common Issues**  \n\nYour dashboard is now up and running! 🎉\n\n---\n\n## **Next Steps**\n\n- 🔒 **Secure the dashboard** with **RBAC (Role-Based Access Control)**.  \n- 🔐 **Implement HTTPS and authentication** for secure access.  \n- 📊 **Monitor logs** using **Azure Monitor for Containers**.  \n- 🚀 **Set up automated deployments** using **CI/CD pipelines**.  \n\nHappy deploying! 🚀\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fllanlan1%2Fkubernetesdashboarddeploymentguide","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fllanlan1%2Fkubernetesdashboarddeploymentguide","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fllanlan1%2Fkubernetesdashboarddeploymentguide/lists"}