Learn about the installation process for KubeLedger on Kubernetes and OpenShift.
Requirements
KubeLedger requires read-only access to the following Kubernetes API endpoints:
/api/v1/apis/metrics.k8s.io/v1beta1(provided by the Kubernetes Metrics Server).
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:
- kubectl + Kustomize - Quick installation with default settings.
- Helm - For more advanced customization.
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
1Gistorage request. - The Kubernetes distribution is not OpenShift, as OpenShift requires additional SCC settings.
- The pod is configured with security contexts that allow UID
4583and GID4583inside 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
emptyDirfor local testing
Set.dataVolume.persisttofalse(it’s set totrueby default).Set specific persistent volume
- Set
.dataVolume.persisttotrue(default value). - Set
.dataVolume.capacitywith the persistent volume size (it’s set to1Giby default). - Set
.dataVolume.storageClasswith the storage class name (if not set, the default storage class of the cluster will be used).
- Set
Enable deployment on OpenShift
Set.securityContext.openshifttotrue. This binds the SCCnonroot-v2to the KubeLedger service account.
IfemptyDiris enabled, the SCChostaccessis also bound to the service account.Enable DCGM Integration
- Set
dcgm.enabletotrue - Set
dcgm.endpointwith the URL of DCGM metrics endpoint (e.g.http://dcgm-exporter.gpu-operator.svc:9400/metrics)
- Set
Customize CPU and memory requests
Adjust.resources.requests.cpuand.resources.requests.memoryas needed.Customize the integration with Kubernetes Set the different environment variables under the value
.envssection. 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.
