Giter Site home page Giter Site logo

headlamp-k8s / headlamp Goto Github PK

View Code? Open in Web Editor NEW
1.6K 24.0 116.0 76.15 MB

A Kubernetes web UI that is fully-featured, user-friendly and extensible

Home Page: https://headlamp.dev

License: Apache License 2.0

Go 10.95% HTML 0.22% JavaScript 5.90% Dockerfile 0.31% Makefile 0.19% TypeScript 82.03% CSS 0.01% Smarty 0.10% Shell 0.25% PowerShell 0.04%
kinvolk kubernetes headlamp plugins dashboard kubernetes-ui cloud-native debugging k8s kubernetes-dashboard

headlamp's Introduction

Headlamp OpenSSF Best Practices

Headlamp is an easy-to-use and extensible Kubernetes web UI.

Headlamp was created to be a Kubernetes web UI that has the traditional functionality of other web UIs/dashboards available (i.e. to list and view resources) as well as other features.

Features

  • Vendor independent / generic Kubernetes UI
  • Works in-cluster, or locally as a desktop app
  • Multi-cluster
  • Extensible through plugins
  • UI controls reflecting user roles (no deletion/update if not allowed)
  • Clean & modern UI
  • Cancellable creation/update/deletion operations
  • Logs, exec, and resource editor with documentation
  • Read-write / interactive (actions based on permissions)

Screenshots

Quickstart

If you want to deploy Headlamp in your cluster, check out the instructions on running it in-cluster.

If you have a kube config already, you can quickly try Headlamp locally as a desktop application, for Linux, Mac, or Windows. Make sure you have a kubeconfig file set up with your favorite clusters and in the default path so Headlamp can use it.

Accessing

Headlamp uses RBAC for checking whether and how users can access resources. If you try Headlamp with a token that has very limited permissions, you may not be able to view your cluster resources correctly.

See the documentation on how to easily get a Service Account token for your cluster.

Tested platforms

We maintain a list of the Kubernetes platforms we have tested Headlamp with, and invite you to add any missing platform you have tested, or comments if there are regressions in already filed platforms that should be consider.

Extensions / Plugins

If you are interested in tweaking Headlamp to fit your use-cases, you can check out our plugin development guide.

Get involved

Check out our guidelines, including our Code of Conduct, and join the discussion on the #headlamp channel in the Kubernetes Slack.

Roadmap

If you are interested in the direction of the project, we maintain a Roadmap for it with the biggest changes planned so far.

License

Headlamp is released under the terms of the Apache 2.0 license.

headlamp's People

Contributors

alexandersperling avatar ashu8912 avatar blixtra avatar calvin-puram avatar dependabot[bot] avatar egomezbpedro avatar farodin91 avatar haricharan-001 avatar illume avatar joaquimrocha avatar johananl avatar jorgearteiro avatar kaihoffman avatar klopfi-bot avatar knrt10 avatar lijianzhi01 avatar milas avatar r0b2g1t avatar skoeva avatar spowelljr avatar src0p avatar stefkiourk avatar surajssd avatar thisisnttheway avatar till avatar vbatts avatar vyncent-t avatar yolossn avatar zdzichu avatar zoethivet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

headlamp's Issues

Optimize the UI for small screens

Even though having the dashboard on phone screens is not a priority, we want to make sure that the UI adapts well to smaller screens (at least for tablets).

Accetance Criteria:

  • TBD

Unable to create secret

I don't know why because I was able to create the namespace. In screenshot below I am applying labels incorrectly, but even applying correctly, it has the same effect

Screenshot 2020-09-28 at 7 18 45 PM

Build + distribute plugins out-of-tree

Right now, even if plugins are self-contained in their own folder and not importing project's modules directly, they're still being built together with the project.

In order to make the plugins really powerful, we should have them built outside of the project (out-of-tree), and imported in a different way (likely sent from the backend according to how it is configured).
We should check out Mattermost's approach for inspiration: https://github.com/mattermost/mattermost-plugins

Acceptance Criteria:

  • Plugins are built out-of-tree
  • The dashboard can import them dynamically according to what the backend indicates (details TBD)

metrics for each node usage

I tried to use the headlamp for my cluster. it was showing that I need to add the metrics to get the usage details of each node. But I didn't find any documentation regarding how to add the metics

Add PSP view

We should add a view for the Pod Security Policies, under the security tab, using the link
/apis/policy/v1beta1/podsecuritypolicies .

URLs should reflect the views

As much as it is possible, the URLs used in the dashboard should reflect what users see in the view.
i.e. if a table is sorted by some column, then the URL should reflect that.

The reason is that e.g. this way users can share URLs within a team, and everybody is expected to see exactly what the user was seeing without having to change some aspects in the view.

Acceptance Criteria:

  • All columns in a table displayed affect the URL when its sorting is changed
  • When using a URL that has some sorting params, etc. the view should reflect that

More details TBD.

Use accent colors for clusters

Since we support multiple clusters, a nice way to quickly identify them (besides the name) is to assign them a different color. We shall call this the cluster's accent color as it will be reflected in a few parts of the dashboard.

We understand this is not an accessible option for color-blind users, but that should be covered by #14 .

This feature also requires having a settings view (#16).

Acceptance Criteria:

  • Allow the user to select a color for each configured cluster
  • Use this color in the cluster's icon (if not custom) and other elements in the UI (TBD)

Show error message when documentation is not found

When creating a new resource, if the kind is not set up yet (or is the wrong kind), the documentation tab should show an error message instead of keeping the spinner showing forever.

Acceptance Criteria:

  • When the resource has a kind and documentation is found, the documentation is shown
  • If there is an error fetching the documentation, it should be shown in red with a message like: Cannot load documentation: CAUSE HERE.

403 when trying to access resource

Hi,

I'm trying to run Headlamp in my local minikube cluster. This is my first time doing so. However, I can't get the resources in the dashboard, eventhough I'm using the default serviceaccount token. I verify that I can use this token to access API, e.g.

kubectl --token=$TOKEN get pods

gives me the list of pods running on my minikube.

In the browser, I can see that I have the following 403 error when opening the cluster page, e.g. http://localhost:3000/c/minikube

apiProxy.ts:48 GET http://localhost:4654/clusters/minikube/apis/metrics.k8s.io/v1beta1/nodes 403 (Forbidden)
request @ apiProxy.ts:48
getMetrics @ api.ts:178
index.js:1 No metrics {err: Error: Api request error: Forbidden - nodes.metrics.k8s.io is forbidden: User "system:anonymous" ca…, url: "/apis/metrics.k8s.io/v1beta1/nodes"}

So my question is, is there any additional step that I should do to test Headlamp, either in minikube or other running k8 cluster?

Thank you :)

Gracefully handle errors when the metrics server is not installed

The metrics server shouldn't be a requirement for running Headlamp, but currently the code just assumes we have metrics server installed.

We should make sure that if the metrics server is not installed then we simply don't show the charts/info we generate from the metrics, and instead we should display a message suggesting to install the metrics server. This message should be non-intrusive and small at the moment (later we can add a link to how to install it, etc.).

Create a desktop app

Some users prefer to use a dashboard from their machines instead of having it running in a cluster or hosted somewhere else.

To support this use-case, we should have a desktop application (Electron) for the most used platforms: Linux, Mac, Windows.

Acceptance Criteria:

  • A Headlamp desktop app exists for Linux
  • A Headlamp desktop app exists for Mac
  • A Headlamp desktop app exists for Windows

Handle exceptions when performing cluster actions

When performing cluster actions such as edit/delete/create, apparently the exceptions aren't being handled.
I have fixed this locally but I'm filing this issue to track it as I cannot finish it now.

Add settings view

There should be a settings view to allow the user to configre several aspects of the dashboard / clusters.

Acceptance Criteria:

  • There is a settings button and view available
  • At first, the settings should allow to see the details of all the clusters configured and change their accent color (#15)

Design:

TBD

Publish official images

We should publish official Headlamp images on quay.io/kinvolk. We can set up a CI job to build and push images from master as well as from Git tags when we start doing official releases.

Add keyboard shortcuts

Having keyboard shortcuts for the most common actions in Headlamp allows users to become very productive with the dashboard. So we should add them.

Initially we may just have them to select the search (#13), and switch clusters.

Acceptance Criteria:

  • Accessing the cluster chooser can be done through a shortcut (Ctrl+Shift+L);
  • Selecting the search entry / enabling the filter can be done through a shortcut (Ctrl+Shift+F);

Add a Flatpak build

Flatpak provides sandboxed and easy to manage Linux applications. We want to have Headlamp as a flatpak and on Flathub too, so let's track the work here.

Acceptance Criteria:

  • A flatpak can be easily built
  • Headlamp is published on Flathub

Add dedicated list views to thedifferent workload types

We have severa workload types like DaemonSets, Deployments, Jobs, CronJobs, StatefulSets, ReplicaSets, but only the latter has a dedicated list view.

We should create the dedicated list views for each of them, showing extra data in the list (to be defined).

Add support for multiple clusters

The dashboard should be able to support several clusters. The actual support for this should be a build flag so it's just simple to configure when hosted.

Support passing a directory of plugins when building the docker image

In #66 the Dockerfile assumes that any plugins to be included in the image will be added to a folder plugins in the project's root directory. It would be nicer to instead be able to pass the plugins dir as an arg to the docker's file. This sounds trivial but since we need to copy the dir only when it exists, things get a bit trickier.

Plugin API stabilization

Currently we support plugins but there is yet no stable API for registering views/routes, etc. i.e. they can be done but they're subject to change.
We should evaluate whether the current functions/prototypes are good enough to announce that their "stable", meaning we will support them through minor versions.

Acceptance Criteria:

  • TBD

Doesn't like cert signed by our local CA, but docs don't seem to provide method to give it our root certificate

Description

I get an SSL error when trying to use on-prem Dex with a cert signed by our local cert authority. Is there a way to make this work?

Impact

Prevents me from using OIDC

Environment and steps to reproduce

  1. Set-up: Follow the in-cluster directions.
  2. Task: Try to sign in.
  3. Error: From the headlamp logs:
2020/11/19 23:58:21 Error while fetching the provider from https://dex.tst-k8s.epic.com/callback error Get https://dex.tst-k8s.epic.com/callback/.well-known/openid-configuration: x509: certificate signed by unknown authority
2020/11/19 23:58:21 http: panic serving 10.96.77.112:41566: runtime error: invalid memory address or nil pointer dereference

This results in a pop up window that says 502 bad gateway.

Expected behavior
Be directed to dex to login

Additional information
I'm already passing -insecure-ssl and it did not help.

Access with Ingress without TLS configuration

Hello,

I got an error and there was blank screen when i try to access the url that host name and path defined in the Ingress yaml.
But the url of Service ip and nodeport is working fine and there is only problem when using Ingress.

This is the message on Chrome developer mode. (The url is : "http://test.mycompany.com/monitor/ " but i got this)

GET http://test.mycompany.com/static/css/2.e4d123f2.chunk.css net::ERR_ABORTED 404 (Not Found)

my Ingress yaml is as follows: (I don't think it has its own problem because it works for other services)

kind: Ingress
apiVersion: networking.k8s.io/v1beta1
metadata:
  name: headlamp
  namespace: kube-system
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /$2
spec:
  rules:
  - host: test.mycompany.com
    http:
      paths:
      - path: /monitor(/|$)(.*)
        backend:
          serviceName: headlamp
          servicePort: 80

Could you give me some help to use ingress to access headlamp?

Thanks.

macOS app cannot connect to http://localhost:4466/config

Description

MacOS app does not get beyond "Wait while fetching clusters..." state. Cannot connect to http://localhost:4466/config.

Impact

App seems completely dysfunctional.

Environment and steps to reproduce

  1. Set-up: macOS Big Sur v11.0.1 (20B29), Headlamp Version 0.1.0 (0.1.0)
  2. Task: Launched the App
  3. Action(s):
  4. Error: See below

Expected behavior

Expected to see some clusters, kubectl context or similar.

Additional information

Screenshots

image

image

image

Complete the views' basic functions

We have Edit and Delete buttons with the respective functionality, but they haven't been added and connected to all the views. So we should add those where needed.

Acceptance Criteria:

  • All of the objects' details views have an edit/delete buttons (according to the user's permissions)

Not able to view cluster resources after logging in the UI

Description

Two issues

  • The manifests for deployment to the cluster is wrong - it should be -plugins-dir instead of -plugin-dir
  • After login to the UI after creating the ingress not able to see any data from the cluster (logged in via SA token the default one)
    Impact

[ 1 sentence detailing the impact this bug is creating for you ]

Environment and steps to reproduce

  1. Set-up: a managed k3s cluster on Civo (civo.com)

  2. Task: first edit the deployment and change the plugin-dir to plugins-dir

  3. Action(s): after opening the UI , providing the default SA token for authentication I am not able to view anything inside the cluster

  4. Error:
    image

Expected behavior
Should be able to see the cluster resources

Add documentation about how to see metrics on Headlamp

Current situation
If the metrics server is not installed, then Headlamp shows that notice but there is no mention of it in the docs.

Impact
Users who are not very familiar with the metrics-server/k8s may end up thinking there is a bug.

Ideal future situation
Users will know what to do if they want to see metrics exposed in Headlamp.

Implementation options

  1. We need to add documentation and link to guides for installing the metrics-server, e.g. https://kubernetes.io/docs/tasks/debug-application-cluster/resource-metrics-pipeline/#metrics-server and https://kubernetes.io/docs/tutorials/hello-minikube/ (metrics setting).
  2. Add a link to that documentation from the tooltip in the UI (the one showing up when there are no metrics)

Decide on an approach for authentication in hosted mode

When deploying Headlamp on a cluster, we may want to consider supporting auth using a service account.

Pros:

  • It Just Works (TM) - the user doesn't have to figure out what a "token" is and how to get one.

Cons:

  • Compromising the Headlamp pod grants access to the cluster at the same permission level as the service account.
  • No per-user authentication, so harder to do things like auditing.

Add a legend for the empty charts in the Workloads' view

In the Workloads view's charts, if a chart is empty (because there are no workloads running of that kind), it should still show a legend under it.

E.g.:

Screenshot 2020-07-14 at 1 00 15 PM

In the example above, under the CronJobs' chart it should say: 0 Running.

Acceptance Criteria:

  • When a type of workload has no running resources, its chart's legend should still be shown

Design revamp / Add logo

The overall design of the dashboard will be reviewed by a designer, so we make sure the UX and UI great for our users. We also need a nice logo.

Acceptance Criteria:

  • The UI/UX of the main parts has been reviewed, changes have been implemented (more details TBD)
  • The project has a logo and it's being used in the UI
  • The project has a logo and it's being used in the README

Add notifications area + functionality to create a notification

We should have a notifications area, with the most important events from the cluster.
It's still to be defined whether this area should show events for all clusters or just the current one (or to let it be defined by the settings).

Another possibility that can be part of this feature is to have an actual browser/app notification when an event happens.

Acceptance Criteria:

  • There is a notifications area showing the important events
  • We have a way to dispatch notifications
  • Optional: There are notifications for some events' levels

More details TBD.

"Issue of the week" - Add (cross-cluster) search

We should add a search view that searches for objects across clusters.
This search should have filters to specify e.g. kinds of objects, namespaces, clusters, etc.

Proposals:

  • The search should be accessible from any view within a cluster.
  • It should allow to filter what the search refers to (object kinds, namespaces, etc.), and what cluster to search in (or all, when omitted).
  • It should show the results with links to their respective detailed views.

Back Button broken for Roles and Role Bindings View

Steps to Reproduce the above issue in Roles View:

  1. Go to Roles view
  2. Use the table paginator and press the next arrow button on it
  3. Now Click on any role name from the list
  4. In the Role Detail View Press the Back Button and Boom you will be redirected to chooser page

Steps to Reproduce the above issue in RoleBindings View

  1. Go to RoleBindings View
  2. Click on any Name from the list
  3. On the RoleBindings Detail View Now Press Back and Boom You will be redirected to chooser page

Don't refresh tables if they're not in the first page

In views which use tables (every list view), if the data is updated, then the list refreshes to show those changes. This represents a UX a problem if the user is beyond the first page of the table, as it will refresh and show the 1st page again.
Refreshing and keep showing the previous page the user was seeing is also not a good solution as there may be new entries before or in the current page, which would "displace" the results the user may be interested in checking out.

A better solution thus is to just not update the table when the data changes if the table is in a page > 1, but instead show a "Refresh" button on top of the table, so the user can be aware that there are new changes, and click the button.

Acceptance Criteria:

  • When the table's data changes, if the user has changed the page at all (i.e. even if changed to page 2 and then page 1), the current table page and data are not changed
  • When the table's data changes, a refresh button is shown on top of the table
  • When the user clicks the refresh button, the actual table's data is changed and thus the user is taken to page 1, with the new data showing (and the refresh button is no longer shown)
  • The refresh button will be centralized horizontally and have this icon, the label Refresh, and the tooltip Click to display the new data in the table.

Add a dark theme option

Many users prefer dark backgrounds in a screen, so we should offer this option.

Acceptance Criteria:

  • A dark theme is available
  • The theme selectable from the settings view (#16)

Global view of different clusters

When we support multiple clusters, it'd be useful to have an overview with any interesting data from the clusters, like any failure events, and/or the load. So users can quickly be aware of any changes that require their attention.

Requirements TBD.

Authentication with a kubeconfig (without token)

When starting a Lokomotive cluster without gangway, I get a kubeconfig with a client certificate but without token. We should implement a way in the dashboard to authenticate with a kubeconfig, without a dashboard.

Create a Helm chart

Helm is used by a large portion of the k8s community for managing workloads. We probably want to have an official chart for Headlamp.

Allow custom icons for clusters

One nice way to quickly identify clusters is to assign different icons to them. So we should allow that as an option.

Acceptance Criteria:

  • Offer a way for the user to configure a different icon for a cluster *

* TBD: Whether this will be a choice from a set of predefined icons, or a user uploaded icon, or both.

Add apply feature

We need an apply button that allows users to apply changes to the cluster using a YAML file.

Acceptance Criteria:

  • There is a button for showing up the apply dialog
  • The apply dialog effectively applies the new configuration given by the user
  • There is a grace period between pressing apply and the actual action being performed, within which the user can cancel the action
  • The apply button is only shown if the user has the right permissions

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.