Skip to content

Gabriele Pelizzari

Dubium Sapientiae Initium

  • Home
  • Veeam
    • Ransomware & Security
    • NAS Backup
    • Veeam DRO (VAO)
    • Cloud Service Provider
    • Veeam Agent
    • VBR – To Know
    • Powershell
  • Cloud
    • Kubernetes
    • Tanzu
    • VMware
  • Bridge
    • Stories
    • Strong Club – Angy
    • Bridge Online
  • About me
    • Privacy & GDPR
    • Photo Gallery
    • About me
  • Feeds
  • English
    • Italiano (Italian)
  • Search

Tag: rbac

Posted on 30 October 2022

Kubernetes – Dashboard

We resume the journey started in the past months on the Cloud-Native approach to show with a real case how flexible and powerful Kubernetes technology turns out to be.

To this end, the article will illustrate how to implement a dashboard capable of monitoring a k8s architecture in a few steps.

The project consists of two phases:

  1. Creation of the Dashboard service
  2. Web-browsing access to the Dashboard

1. Service creation: In the k8s world, the deployment of a service is done through the use of descriptive files with a YAML extension. It is an approach called declarative that has the imperative as its alter ego.

In our scenario, it is sufficient to use the following command:

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

Using the file found on GitHub recommended.yaml, the dashboard service is automatically created within a new namespace named Kubernetes-dashboard (see image 1).

Picture 1

The command can be used to verify that the service is available:

kubectl get services –namespace=kubernetes-dashboard (see image 2)

picture 2

 

2. Dashboard Access (via https)

In Kubernetes, access to available resources is based on RBAC (Role-Base access control), which defines the relationship between the user, the roles, and the resources within the organization.

Two YAML declarative files can be used for the Dashboard service:

(a) service-account.yaml (which defines permissions for resources in cluster/namespace)

(b) cluster-role-binding.yaml (defining users and/or service accounts)

Note1: Granting administrator privileges to the service account for Dashboard could pose a security risk. Ask your security team.

We are almost at the end, one last effort.

  1. With the command: kubectl proxy Dashboard is exposed via HTTPS to the address: http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/.
  2. With the command kubectl -n kubernetes-dashboard create token admin-us the token authorizing the user to access the console is created (see image 3)

Picture 3

The result should be as shown in image 4.

Picture 4

See you Soon!

  • Italiano (Italian)
  • English

Articles & Descriptions

Disclaimer: All content provided on this blog is for informational purposes only. The owner of this blog makes no representations as to the accuracy or completeness of any information on this site or found by following any link on this site.

All the tutorials included on this site are performed in a lab environment to simulate a real-world production scenario. As everything is done to provide the most accurate steps to date, we take no responsibility if you implement any of these steps in a production environment

This is my personal site. I love writing in English and sharing my greatest passions: cloud, virtualization, backup and bridge.

I Apologize for any mistake you’ll find in my articles.

September 2021 update: After several requests, the new articles will be available in two languages, Italian and English. To choose your preferred language please select the flag above.

Google Ads




Categorie

Searching

Google Ads




  • Email
Proudly powered by WordPress