Need help?

Our experts have had an average response time of 13.14 minutes in February 2024 to fix urgent issues.

We will keep your servers stable, secure, and fast at all times for one fixed price.

Install Kubernetes Dashboard with NodePort Quickly

by | Oct 24, 2021

Wondering how to install Kubernetes Dashboard with NodePort? We can help you.

As part of our Google Cloud Platform Services, we assist our customers with several Kubernetes queries.

Today, let us see how our Support Techs perform the installation for our customers.

 

Install Kubernetes Dashboard with NodePort

A web-based user interface, Kubernetes provides information on the state of the Kubernetes cluster resources and any errors that may occur.

Moving ahead, let us see the steps our Support Techs employ for a smooth installation.

Step 1: Configure kubectl

To deploy the dashboard to the Kubernetes cluster, we use the kubectl Kubernetes management tool.

Step 2: Deploy Kubernetes Dashboard

By default, the dashboard deployment contains a minimal set of RBAC privileges it needs to run.

To deploy the Kubernetes dashboard, we run:

kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/master/aio/deploy/recommended.yaml

After that, we need to set Service to use NodePort.

To modify the file, we have to download it to the local machine:

wget https://raw.githubusercontent.com/kubernetes/dashboard/master/aio/deploy/recommended.yaml-O kubernetes-dashboard-deployment.yml

Now, we can modify the file to fit the deployment needs.

vim kubernetes-dashboard-deployment.yml

For example, here we modify the Kubernetes dashboard service to be of NodePort type:

kind: Service
apiVersion: v1
metadata:
labels:
k8s-app: kubernetes-dashboard
name: kubernetes-dashboard
namespace: kubernetes-dashboard
spec:
ports:
- port: 443
targetPort: 8443
selector:
k8s-app: kubernetes-dashboard
type: NodePort

Later, to specify NodePort, we use:

kind: Service
apiVersion: v1
metadata:
labels:
k8s-app: kubernetes-dashboard
name: kubernetes-dashboard
namespace: kubernetes-dashboard
spec:
ports:
- port: 443
targetPort: 8443
nodePort: 32000
type: NodePort
selector:
k8s-app: kubernetes-dashboard

Once done, we need to apply the changes:

kubectl apply -f kubernetes-dashboard-deployment.yml

Then we go ahead and check the deployment status:

$ kubectl get deployments -n kubernetes-dashboard
NAME READY UP-TO-DATE AVAILABLE AGE
dashboard-metrics-scraper 1/1 1 1 86s
kubernetes-dashboard 1/1 1 1

It should create two pods, one for the dashboard and another for metrics.

$ kubectl get pods -n kubernetes-dashboard
NAME READY STATUS RESTARTS AGE
dashboard-metrics-scraper-7b64584c5c-xvtqp 1/1 Running 0 2m4s
kubernetes-dashboard-566f567dc7-w59rn 1/1 Running 0 2m4s

Since we made the service type to NodePort, let’s confirm its creation:

$ kubectl get service -n kubernetes-dashboard
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
dashboard-metrics-scraper ClusterIP 10.103.159.77  8000/TCP 8m40s
kubernetes-dashboard NodePort 10.101.194.22  443:32000/TCP 8m40s

Step 3: Access Kubernetes Dashboard

Suppose, the Service deployment was assigned a port 32000/TCP.

# Example
https://xxx.xxx.xxx.xx:32000

Now, we need to confirm if access to the dashboard is working.

To do so, we need a token to access the dashboard.

Then we will see a web dashboard.

Nginx Ingress:

---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: k8s-dashboard
namespace: kubernetes-dashboard
annotations:
nginx.ingress.kubernetes.io/secure-backends: "true"
nginx.ingress.kubernetes.io/ssl-passthrough: "true"
spec:
tls:
- hosts:
- k8sdash.mydomain.com
secretName: tls-secret
rules:
- host: k8sdash.mydomain.com
http:
paths:
- path: /
backend:
serviceName: kubernetes-dashboard
servicePort: 443

[Need further assistance? We’d be happy to help you]

 

Conclusion

In short, we saw how our Support Techs perform the installation of Kubernetes Dashboard with NodePort.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF