This document describes the tools needed to build, test, and run Elemental Lifecycle Manager (LCM) from source.
kubectl v1.35+Ensure unit tests pass:
make test
Build the LCM manager binary:
make build
Install the LCM CRDs before running the controller:
make install
Run the LCM controller locally with webhooks disabled:
ENABLE_WEBHOOKS=false make run
NOTE: Disabling webhooks avoids requiring the Kubernetes API server to call a webhook Service backed by a controller running outside the cluster.
Optionally, deploy a Release resource to trigger an upgrade and monitor its progress.
Before proceeding with the steps below, ensure that the project’s unit tests pass:
make test
Prepare image build variables:
# Define the image that will be built and pushed
export IMG=<your-img-repo>/lcm:<tag>
# Define the container tool that will be used. Defaults to `docker` if unset.
export CONTAINER_TOOL=podman
Build the LCM image:
make docker-build
NOTE: By default,
make docker-buildbuilds the image for the host platform. To build for a different platform, setPLATFORM.
Push the built LCM image to your registry:
make docker-push
These steps build the LCM container image and push it to the registry specified by $IMG.
makeNOTE: Applicable only if you have access to the cluster’s kubeconfig under
~/.kube/config.
NOTE: These steps will deploy the controller resources defined in the
config/directory.
Install LCM CRDs:
make install
Deploy the controller from the pre-built image:
make deploy IMG=<your-img-repo>/lcm:<tag>
NOTE: If you encounter RBAC errors, you may need to grant yourself cluster-admin privileges or be logged in as admin.
Generate the consolidated LCM YAML file:
make build-installer IMG=<your-img-repo>/lcm:<tag>
NOTE: This will produce an
install.yamlfile under thedist/directory.
Deploy the consolidated LCM YAML file:
NOTE: As a prerequisite step to this one, you can move the
install.yamlfile to an environment with access to the cluster.
kubectl apply -f install.yaml
NOTE: Make sure the chart refers to the image that you built in the Prepare LCM Image section.
Refer to the Helm reference guide.
After deploying LCM with your custom changes, deploy a Release resource to trigger an upgrade and monitor its progress.
makeUninstall the controller:
make undeploy
Uninstall LCM CRDs:
make uninstall
kubectl delete -f install.yaml
helm uninstall elemental-lifecycle-manager elemental-lifecycle-manager-crds --namespace elemental-system