Installation on Kubernetes and OpenShift

Learn about the installation process for KubeLedger on Kubernetes and OpenShift.

Requirements

KubeLedger requires read-only access to the following Kubernetes API endpoints:

Installing Kubernetes Metrics Server (Skip if using OpenShift)

To install the Kubernetes Metrics Server, run the following command:

# This step is not needed if using OpenShift. 
kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml

Deployment methods for Kubernetes

KubeLedger can be installed on a Kubernetes cluster using one of the following methods:

Cloning the Deployment Artifacts

Clone the repository and navigate to the main folder:

git clone https://github.com/realopslabs/kubeledger.git --depth=1
cd kubeledger

Installing with Kustomize (Default Settings)

This approach provides a quick way to deploy KubeLedger using the default settings (You can review the Kustomize resources located in the ./manifests/kustomize/resources/ folder).

If these default settings do not meet your requirements, consider using the Helm-based installation described below, which offers greater customization options.

Default Settings:

  • A persistent volume with a 1Gi storage request.
  • The Kubernetes distribution is not OpenShift, as OpenShift requires additional SCC settings.
  • The pod is configured with security contexts that allow UID 4583 and GID 4583 inside the container.

Installation Steps

Follow these steps to install KubeLedger using Kustomize:

# Create the installation namespace if it does not exist
kubectl create ns kubeledger

#  Create KubeLedger resources
kubectl -n kubeledger apply -k ./manifests/kustomize

# Check that the status of the pod and wait that it starts
kubectl -n kubeledger get po -w

# If not pod is found, check events for additional information.
kubectl -n kubeledger get ev

Customizing the Installation with Helm

This approach is recommended when deploying on OpenShift or when advanced configuration is required.

Customization is done by modifying the Helm values file at the following location ./manifests/helm/values.yaml.

Common Customizations

Below are some frequently used customizations:

  • Use emptyDir for local testing
    Set .dataVolume.persist to false (it’s set to true by default).

  • Set specific persistent volume

    • Set .dataVolume.persist to true (default value).
    • Set .dataVolume.capacity with the persistent volume size (it’s set to 1Gi by default).
    • Set .dataVolume.storageClass with the storage class name (if not set, the default storage class of the cluster will be used).
  • Enable deployment on OpenShift
    Set .securityContext.openshift to true. This binds the SCC nonroot-v2 to the KubeLedger service account.
    If emptyDir is enabled, the SCC hostaccess is also bound to the service account.

  • Enable DCGM Integration

    • Set dcgm.enable to true
    • Set dcgm.endpoint with the URL of DCGM metrics endpoint (e.g. http://dcgm-exporter.gpu-operator.svc:9400/metrics)
  • Customize CPU and memory requests
    Adjust .resources.requests.cpu and .resources.requests.memory as needed.

  • Customize the integration with Kubernetes Set the different environment variables under the value .envs section. See KubeLedger configuration variables

Installation Steps

The installation consists of the following steps. The installation namespace (kubeledger) is created it does not exist.

# Create the installation namespace if it does not exist
kubectl create ns kubeledger

#  Create kubeledger resources
helm upgrade -n kubeledger --install kubeledger manifests/helm/

# Check that the status of the pod and wait that it starts
kubectl -n kubeledger get po -w

# If not pod is found, check events for additional information.
kubectl -n kubeledger get ev

Get Access to the kube-opex-anakytics’s Web Interface

The deployment create an HTTP service named kubeledger on port 80 in the selected namespace. This service provides access to the built-in kubeledger dashboard.