Skip to main content

Build mongodb5 image for Component Pack with Buildah

To install the Component Pack for HCL Connections 8, you need to create a Mongodb5 image. The image sources can be found in the HCL MongoDB repository, and the process for creating the image is documented in Installing MongoDB5 for Component Pack 8. The process involves using Docker, so if you have it installed, you can follow the instructions provided.

Note that after Kubernetes 1.20, the container engine has been changed to containerd, and Redhat-based systems now prefer podman over Docker. If you want to build container images for podman or Kubernetes/containerd, you can use buildah, which can be installed directly from the official repositories. Installing Docker just for the image creation installs the Docker service and needs resources. Most of the time, buildah is my way to go here.

Podman can be aliased to docker and you can use all the commands you already know with. One of the differences is that podman doesn’t use a service and there is no need to run it as root.

Install buildah
#

sudo dnf install buildah

Clone Repository
#

git clone https://github.com/HCL-TECH-SOFTWARE/connections-mongo5

Create image
#

cd connections-mongo5
buildah bud -t hclcr.io/cnx/middleware-mongodb5:20230329-171549 .

Export image as tar file
#

buildah push --format oci hclcr.io/cnx/middleware-mongodb5:20230329-171549 oci-archive:middleware-mongodb5_20230329-171549.tar

Now we can copy the image file to the Kubernetes nodes and import with ctr, or push to a registry.

ctr -n=k8s.io image import --digests=true middleware-mongodb5_20230329-171549.tar

Check the imported image:

ctr -n=k8s.io image ls | grep mongodb5

When the image has no tag after importing it, you can tag with ctr:

ctr -n=k8s.io image tag import-2023-05-08@sha256:7d2f5e93a6cebcd29b10b79d5d84f1c41383aaf52db3c14ccd9eff3af7d125d9  \
  hclcr.io/cnx/middleware-mongodb5:20230329-171549

The process is a bit complicated, and when you install with connections-automation you have to run the installation at least twice and the image needs to be imported on each worker node. So, my next task will be a new role to create the image during the installation.

Christoph Stoettner
Author
Christoph Stoettner
I work at Vegard IT GmbH as a senior consultant, focusing on collaboration software, Kubernetes, security, and automation. I primarily work with HCL Connections, WebSphere Application Server, Kubernetes, Ansible, Terraform, and Linux. My daily work occasionally leads to technical talks and blog articles, which I share here more or less regularly.

Related

Update Elasticsearch certificates in Componentpack

Elasticsearch in HCL Connections Componentpack is secured with Searchguard and needs certificates to work properly. These certificates are generated by bootstrap during the initial container deployment with helm. These certificates are valid for 10 years (chain_ca.pem) or 2 years (elasticsearch*.pem) and stored in the Kubernetes secrets elasticsearch-secret, elasticsearch-7-secret. So when your HCL Connections deployment is running for 2 years, the certficates stop working.

Backup Elasticsearch Indices in Component Pack

During a migration from Cognos Metrics to Elasticsearch Metrics, I had some issues with the index. So I wanted to create a backup of the already migrated data and start over from scratch. The official documentation has an article on the topic: Backing up and restoring data for Elasticsearch-based components, but I had to slightly adjust the commands to get a successful snapshot.