Hajimari

repository·main·Indexed 21 days ago

https://github.com/toboshii/hajimari

A visually oriented startpage and unified dashboard for self-hosted Kubernetes clusters. It features dynamic application discovery via Ingress annotations or Custom Resources, customizable search providers, and support for custom apps and global bookmarks. Built with Go and SvelteKit, it can be deployed via Helm and supports extensive UI customization through themes and a built-in YAML editor.

Tokens
8.3K
Snippets
29
Records
36
Agent score
74%

What's inside Hajimari

  1. Hajimari Overview and Features

    main

    Hajimari is a startpage designed as an entrypoint for self-hosted Kubernetes clusters. It dynamically discovers applications and provides a centralized dashboard.

    Key Features:

    • App Discovery: Dynamically lists apps discovered from Kubernetes Ingresses or Custom Resources. It also displays replica status for ingress endpoints.
    • Search: Web and app search with customizable search providers.
    • Extensibility: Supports non-Kubernetes apps via custom apps configuration.
    • Customization: Customizable bookmarks, selectable themes (including custom theme support), and automatic light/dark mode.
    • User Experience: Custom configuration overrides per user/browser and support for multiple instances.
  2. Reference: Search functionality and tokens

    main

    The Hajimari search bar supports three distinct modes of operation:

    1. Real-time Filtering: Start a query with / to filter the list of displayed applications.
    2. Search Provider Tokens: Start a query with @<token> (e.g., @g query) to trigger a configured search provider. The {query} placeholder in the provider's searchUrl is replaced by the text following the token.
    3. Direct Navigation: If a token is entered without a query, or if no searchUrl is configured, the user is redirected to the provider's url.
  3. Configure NamespaceSelector for Hajimari

    main

    The namespaceSelector determines which namespaces Hajimari monitors for applications. You can select all namespaces, a specific list of names, or filter namespaces using Kubernetes label selectors. If both labelSelector and matchNames are provided, Hajimari uses the union of both.

    ### NamespaceSelector Fields
    - `any` (bool): If `true`, all namespaces are selected.
    - `labelSelector` (metav1.LabelSelector): Filter namespaces based on Kubernetes labels.
    - `matchNames` ([]string): A specific list of namespace names to include.
  4. Install Hajimari via Helm

    main

    To install Hajimari on a Kubernetes cluster, add the Hajimari Helm repository and install the chart using the following commands:

    1. Add the repository: helm repo add hajimari https://hajimari.io
    2. Update your repositories: helm repo update
    3. Install the chart: helm install hajimari hajimari/hajimari

    Detailed Helm configuration can be found in the charts/hajimari directory.

    helm repo add hajimari https://hajimari.io
    helm repo update
    helm install hajimari hajimari/hajimari
  5. Develop the Hajimari Frontend locally

    main

    To start developing the Hajimari web UI, ensure you have installed the project dependencies using npm install, pnpm install, or yarn. You can then launch the development server using the dev script. Use the --open flag to automatically open the application in a new browser tab.

    npm run dev
    
    # or start the server and open the app in a new browser tab
    npm run dev -- --open
  6. Expose applications via Ingress annotations

    main

    Hajimari can automatically discover and display applications by looking for specific annotations on Kubernetes Ingress objects. To make an application visible in Hajimari, add the hajimari.io/enable annotation with the value true to your Ingress.

    metadata:
      annotations:
        hajimari.io/enable: "true"
        hajimari.io/icon: "mdi:kubernetes"
        hajimari.io/appName: "My K8s Cluster"
        hajimari.io/group: "infrastructure"
        hajimari.io/info: "Access my cluster"
  7. Build and preview the Hajimari Frontend production build

    main

    The Hajimari web UI is a Single Page Application (SPA) built with SvelteKit using the static adapter. To generate a production-ready version of the application, run the build script. After building, you can use the preview script to verify the production build locally.

    npm run build
    
    # To preview the production build
    npm run preview
  8. Install Hajimari locally

    main

    To run Hajimari locally, you must have go 1.19 and node 18 installed.

    Build the binary

    Clone the repository and run:

    make deps
    make build

    Local development with hot reload

    For active development with hot reloading enabled, use:

    make deps
    make dev
  9. Set up a custom Hajimari startpage

    main

    You can customize your Hajimari instance directly from the browser:

    1. Open Hajimari in your browser.
    2. Click the hamburger menu in the lower left-hand corner.
    3. Modify settings in the built-in YAML editor.
    4. Click Save. You will be redirected to a unique URL containing a random ID for your custom page.
    5. Set this unique URL as your browser's homepage or new tab page.

    Note: There is no built-in authentication. It is recommended to run Hajimari behind an Ingress with access restrictions.

  10. Configure Hajimari application settings

    main

    The hajimari object in your values.yaml allows you to customize the dashboard's behavior, appearance, and content.

    Key Configuration Options

    • hajimari.instanceName: A unique string to allow running multiple instances of Hajimari on the same cluster.
    • hajimari.defaultEnable: If true, all discovered applications are shown by default.
    • hajimari.namespaceSelector: Uses Kubernetes matchNames to define which namespaces Hajimari should scan for applications.
    • hajimari.name: The name used in the welcome greeting (defaults to "You").
    • hajimari.title: Overrides the page title.
    • hajimari.lightTheme / hajimari.darkTheme: Sets the default themes.
    • hajimari.customThemes: A list of custom theme objects defining name, backgroundColor, primaryColor, and accentColor.
    • hajimari.showAppStatus: Boolean to toggle visibility of application status.
    • hajimari.defaultSearchProvider: The name of the default search provider from the searchProviders list.
    hajimari:
      instanceName: "my-instance"
      defaultEnable: true
      namespaceSelector:
        matchNames:
          - default
          - media
      name: "Alice"
      title: "My Dashboard"
      lightTheme: gazette
      darkTheme: horizon
  11. Configure Hajimari via ConfigMap or values.yaml

    main
    Hajimari's behavior can be customized using a configuration object provided via a ConfigMap or Helm values.yaml. Key configuration areas include instance naming, theme selection, visibility toggles (greeting, groups, URLs, status), and search provider definitions.