Skooner Kubernetes Dashboard

repository·master·Indexed 23 days ago

https://github.com/skooner-k8s/skooner

A CNCF sandbox project providing a Kubernetes dashboard for full cluster management and real-time visualization of resources such as Pods, Nodes, and Deployments. It includes a React-based client (@skooner-k8s/skooner-client) and an Express.js server that proxies requests to the Kubernetes API. The documentation covers installation via YAML manifests, OIDC and Keycloak authentication configuration, Ingress and NodePort exposure, and API proxying for streaming and managing Kubernetes resources.

Tokens
6K
Snippets
11
Records
28
Agent score
81%

What's inside Skooner

  1. Understand Skooner's versioning and release strategy

    master

    Skooner follows Semantic Versioning (SemVer) once version v1.0.0 is released. Version tags follow the v<semantic version> pattern.

    To ensure stability, Skooner uses a dual-branch strategy:

    • Stable branch: Contains tested, non-breaking releases. Users can subscribe to a specific Major version to receive updates without fear of breaking changes.
    • Main branch: Contains the latest features and cutting-edge changes. Users wanting the newest features can subscribe to this branch.

    Major releases are achieved by releasing the current Stable content as a Minor/Patch, replacing the Stable branch with Main, and then releasing the updated Stable branch as a Major release.

  2. Identify breaking changes in Skooner

    master

    A breaking change is generally defined as removing or changing any interface that interacts with anything outside of Skooner (including User Interfaces) in a non-additive way.

    Examples of breaking changes include:

    • Dropping Kubernetes Support: Removing support for a specific K8s cluster version or a specific Custom Resource Definition (CRD) version (e.g., HPA support).
    • Browser Support: Removing support for a specific browser type (Chrome, Mozilla, etc.) or a specific browser version, or adding features that fail on older browsers.
    • Integration Deprecations: Deprecating previously supported versions of OpenId Connect (OIDC) or metrics-server.
    • Performance/Resource Changes: Significant changes to minimum resource requirements (CPU/Memory) due to new features, or changes that impact the performance of pulling/presenting data on large clusters.
  3. Contribution workflow for Skooner

    master

    To contribute to Skooner, follow this workflow:

    1. Fork the repository from the Main branch.
    2. Develop your changes within your fork.
    3. Prepare your PR by cleaning up your work and merging updates from the upstream repository.
    4. Submit a PR against the Main branch.
    5. Review: Maintainers will review the code. If breaking changes are identified, the PR may be held until the next Major Release unless backwards compatibility can be added. If no breaking changes exist, the maintainer will merge to Stable.
  4. Login using a Service Account Token

    master

    The simplest way to log in is by creating a dedicated Service Account with cluster-admin privileges and extracting its token.

    Steps:

    1. Create the service account.
    2. Bind it to the cluster-admin role.
    3. Retrieve the token based on your Kubernetes version.
    4. Paste the token into the Skooner login screen.
    # Create the service account in the current namespace (we assume default)
    kubectl create serviceaccount skooner-sa
    
    # Give that service account root on the cluster
    kubectl create clusterrolebinding skooner-sa --clusterrole=cluster-admin --serviceaccount=default:skooner-sa
    
    # For Kubernetes v1.21 or lower
    # Find the secret that was created to hold the token for the SA
    kubectl get secrets
    
    # Show the contents of the secret to extract the token
    kubectl describe secret skooner-sa-token-xxxxx
    
    # For Kubernetes v1.22 or higher
    kubectl create token skooner-sa
  5. Manage the Skooner client development lifecycle

    master

    The @skooner-k8s/skooner-client package is built using Create React App. You can manage the application using the following npm scripts:

    • Development: Use npm start to run the app in development mode. The app will be available at http://localhost:3000 and will automatically reload on edits.
    • Testing: Use npm test to launch the test runner in interactive watch mode.
    • Production Build: Use npm run build to create an optimized, minified production build in the build folder.
    • Ejecting: Use npm run eject if you need full control over the underlying build configuration (Webpack, Babel, etc.). Warning: This is a one-way operation and cannot be undone.
    npm start
    npm test
    npm run build
    npm run eject
  6. Configure Skooner with OIDC authentication

    master

    If your cluster is configured for OpenID Connect, you can deploy Skooner with OIDC support by creating a secret in the kube-system namespace and applying the OIDC manifest.

    Required Environment Variables for Setup:

    • OIDC_URL: Your OIDC endpoint (e.g., https://accounts.google.com).
    • OIDC_ID: Your OIDC client ID.
    • OIDC_SECRET: Your OIDC client secret.

    Additional Configuration via Environment Variables:

    • OIDC_SCOPES: Additional scopes (default: openid email). Example: OIDC_SCOPES="openid email groups".
    • OIDC_METADATA: A JSON string passed to the node-openid-client constructor. Example: OIDC_METADATA='{"token_endpoint_auth_method":"client_secret_post"}'.
    OIDC_URL=<put your endpoint url here... something like https://accounts.google.com>
    OIDC_ID=<put your id here... something like blah-blah-blah.apps.googleusercontent.com>
    OIDC_SECRET=<put your oidc secret here>
    
    kubectl create secret -n kube-system generic skooner \
    --from-literal=url=$OIDC_URL \
    --from-literal=id=$OIDC_ID \
    --from-literal=secret=$OIDC_SECRET
    
    kubectl apply -f https://raw.githubusercontent.com/skooner-k8s/skooner/master/kubernetes-skooner-oidc.yaml
  7. Run Skooner Client locally

    master
    The Skooner client is a React application written in TypeScript. When running locally, you may see an Unhandled Rejection (Error): Api request error: Forbidden... message initially; simply close this error to access the login UI.
  8. Access Skooner via NodePort

    master

    If you do not have an Ingress server, you can use a NodePort service. This maps Skooner port 4654 to a random port on your node. Use kubectl get svc --namespace=kube-system to find the assigned port.

    $ kubectl get svc --namespace=kube-system
    
    NAME       TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)          AGE
    skooner     NodePort    10.107.107.62   <none>        4654:32565/TCP   1m
  9. Configure Skooner with Keycloak OIDC

    master

    To use Keycloak for authentication, you must configure the OpenID Connect (OIDC) settings via a Kubernetes secret and then redeploy the Skooner server.

    1. Prepare OIDC Variables:

      • Set OIDC_URL to your Keycloak OpenId endpoint configuration page (e.g., https://{keycloak_domain}/realms/foo/.well-known/openid-configuration).
      • Set OIDC_ID to your Keycloak client_id.
      • Obtain OIDC_SECRET from Keycloak. Ensure 'Client authentication' is toggled ON (or 'Access Type' is set to 'confidential' in older versions).
    2. Create the Kubernetes Secret: Create a generic secret named skooner in the kube-system namespace (or your specific Skooner namespace) using the exact variable names url, id, and secret.

    3. Redeploy Skooner: Apply the OIDC-enabled configuration manifest.

    4. Verify Deployment: Check the rollout status and verify the pod is running.

    # 1. Create the secret
    kubectl create secret generic skooner \
    --from-literal=url=$OIDC_URL \
    --from-literal=id=$OIDC_ID \
    --from-literal=secret=$OIDC_SECRET \
    --namespace=kube-system
    
    # 2. Redeploy Skooner server
    kubectl apply -f https://raw.githubusercontent.com/skooner-k8s/skooner/master/kubernetes-skooner-oidc.yaml
    
    # 3. Check rollout status
    kubectl rollout status deploy/skooner --namespace=kube-system
  10. Install Skooner on a Kubernetes cluster

    master

    Deploy Skooner using the provided YAML resources. It is recommended to review the contents of the manifest before applying it.

    Prerequisites:

    • A running Kubernetes cluster.
    • metrics-server installed (strongly recommended for real-time metrics).
    • (Optional) OpenID Connect (OIDC) configuration for authentication.
    kubectl apply -f https://raw.githubusercontent.com/skooner-k8s/skooner/master/kubernetes-skooner.yaml
  11. Expose Skooner via Ingress

    master

    To access the Skooner dashboard, you must make it publicly visible. If you use an Ingress controller, create an Ingress resource in the kube-system namespace.

    Note: Kubernetes v1.22+ requires networking.k8s.io/v1 Ingress. The extensions/v1beta1 API is deprecated and unavailable in v1.22+.

    kind: Ingress
    apiVersion: networking.k8s.io/v1
    metadata:
      name: skooner
      namespace: kube-system
    spec:
      rules:
        - host: skooner.example.com
          http:
            paths:
              - path: /
                backend:
                  service:
                    name: skooner
                    port:
                      number: 80
                pathType: ImplementationSpecific