Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Deploying a Containerized Remote Spec Service for a Control-M Kubernetes Agent

Introduction

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:

diagram

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

🔧 Prerequisites

Before you begin, ensure you have the following tools installed and configured:

🚀 Begin

  1. Build the OCI image by running the following command:
docker build -t tpl-server:latest image

This packages your template server into a portable container image that can run anywhere.

  1. Ensure that you now have the image by running:
docker images | grep tpl-server
  1. Publish the image:
docker tag tpl-server:latest <my-repo>/tpl-server:latest
docker push <my-repo>/tpl-server:latest

This enables Kubernetes to pull the image from a registry accessible to the cluster.

  1. Ensure that the image is published by running:
docker pull <my-repo>/tpl-server:latest
  1. Download the sample files located in this folder.

  2. Customize the chart/values.yaml file. Under the image: element, provide your repository name:

repos: <my-repo>
  1. In Kubernetes, create a pod using Helm:
helm install my-template-server ./chart
  1. Check pod status:
kubectl get pods
kubectl describe pod <pod-name>
  1. In Control-M, create a Kubernetes-type centralized connection profile:
  • Name: K8STPLSVC
  • Namespace: your namespace
  • Spec Endpoint URL: http://my-template-server-svc/jobspec
  1. Customize the RemoteSpec_demoJob.json file with your environment details. Update ControlmServer.

  2. Run the Kubernetes job via Automation API:

ctm run RemoteSpec_demoJob.json

What Happens When the Control-M Job Runs

During 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.

🛠️ Troubleshooting

Common issues and fixes:

  • ImagePullBackOff: Verify the image name and tag, and ensure the registry is reachable and authenticated.
  • Helm install fails: Ensure values.yaml contains the correct repo and tag.

To check pod logs:

kubectl logs <pod-name>