This tutorial demonstrates how to build an OCI image for a simple template server, deploy it using Helm, and use it for Control-M Kubernetes jobs of type Remote web service.
OCI (Open Container Initiative) is the standard for container image formats and runtimes to ensure interoperability and consistency across container tools. This tutorial uses Docker for building the image, but any OCI-compliant tool can be used instead.
In this tutorial, you run a Control-M Kubernetes-type job. When the job is executed, the Control-M/Agent requests a Job specification from the server by specifying a template and parameters. The server generates the template using those parameters and returns a complete and usable Kubernetes Job specification.
The following diagram illustrates the deployment flow:
In this diagram, you can see the following main deployment flow components:
- Build Machine: Builds and pushes the Docker image
- Container Registry: Stores the tpl-server image
- Kubernetes Cluster: Runs a Helm Chart, which deploys a Template Server Pod and generates the /jobspec service
- Control-M Agent: Runs the RemoteSpec job
Before you begin, ensure you have the following tools installed and configured:
- Docker: https://docs.docker.com/get-docker/
- Kubernetes (with kubectl): https://kubernetes.io/docs/tasks/tools/
- Helm: https://helm.sh/docs/intro/install/
- Access to a Control-M environment, including an agent deployed in the Kubernetes cluster
- Build the OCI image by running the following command:
docker build -t tpl-server:latest imageThis packages your template server into a portable container image that can run anywhere.
- Ensure that you now have the image by running:
docker images | grep tpl-server- Publish the image:
docker tag tpl-server:latest <my-repo>/tpl-server:latest
docker push <my-repo>/tpl-server:latestThis enables Kubernetes to pull the image from a registry accessible to the cluster.
- Ensure that the image is published by running:
docker pull <my-repo>/tpl-server:latest-
Download the sample files located in this folder.
-
Customize the
chart/values.yamlfile. Under theimage:element, provide your repository name:
repos: <my-repo>- In Kubernetes, create a pod using Helm:
helm install my-template-server ./chart- Check pod status:
kubectl get pods
kubectl describe pod <pod-name>- In Control-M, create a Kubernetes-type centralized connection profile:
- Name: K8STPLSVC
- Namespace: your namespace
- Spec Endpoint URL:
http://my-template-server-svc/jobspec
-
Customize the
RemoteSpec_demoJob.jsonfile with your environment details. UpdateControlmServer. -
Run the Kubernetes job via Automation API:
ctm run RemoteSpec_demoJob.jsonDuring execution of the Control‑M RemoteSpec job, Control‑M sends a request to the Template Server (the provided Flask app running tplserver.py). The Template Server loads the requested template file (e.g., demo.yaml) and injects into it the values provided in the job’s Spec Request Parameters.
Using Flask’s render_template(), the server generates a rendered Kubernetes Job spec (YAML), with all placeholders replaced by the passed parameter values.
Common issues and fixes:
- ImagePullBackOff: Verify the image name and tag, and ensure the registry is reachable and authenticated.
- Helm install fails: Ensure
values.yamlcontains the correct repo and tag.
To check pod logs:
kubectl logs <pod-name>