Openshift templates are Openshift’s answer to Kubernetes helm charts. In this way, an openshift template contains a list of objects. In consequence, applying an openshift template substitutes its placeholders. Also, it contains a parameter list. Openshift template are a built-in feature of Openshift. But what are differences to helm?

How does Openshift Template work?


Openshift Template

apiVersion: v1
kind: Template
  name: redis-template
  redis: master
- apiVersion: v1
  kind: Pod
    name: redis-master
    - env:
      - name: REDIS_PASSWORD
        value: ${REDIS_PASSWORD}
      image: dockerfile/redis
      name: master
      - containerPort: 6379
        protocol: TCP
- description: Password used for Redis authentication
  from: '[A-Z0-9]{8}'
  generate: expression
Openshift templates are pretty simple. The header introduces the template “> “> (line 1+). The objects section (line 8+) defines a list of cluster objects. Objects may contain placeholder in curly brackets (see line 17). Section of parameters (line 23+) defines parameters to substitute such placeholders. In this example the template requires a parameter REDIS_PASSWORD. The parameters section supplies it.

applying on openshift template

oc process -f template.yaml --param REDIS_PASSWORD=secret

oc process -f template.yaml --param REDIS_PASSWORD=secret | oc create -f -

oc process -f template.yaml --param REDIS_PASSWORD=secret | ec applay -f -
Once openshift template is defined it must be applied to the cluster. The process command (1) reads the template and substitutes parameters and writes results to console. Piping output to “oc create” (3) lets cluster create the new objects. Once created, objects are updated by “oc apply” (5) command.

Openshift Templates versus Helm Charts?

Are Openshift Templates better than Helm charts? There is no easy answer. Notably, Openshift templates are a built-in feature. In contrast, helm requires tiller service installed. Tiller service creates cluster objects. Because of this, Tiller services require cluster-admin permission on Kube-system service account. But for security reasons, most production systems does not grant this permission. Read here for more details.


Templates offer a generic mechanism to deploy applications to different environments. The process of defining a template substitutes environment specific values. Text files may store substitutions. Such text files may be applied to process command.



Using Development Environment in Containers on Workstation

Setting up the workstation with small auxiliary tools is done quickly for the individual. In a growing team, the setup quickly becomes a challenge. Containers can help and bring everything ready configured to each individual's workplace. Setting up the new laptop The...

New: OKD Docker Image is stuck – Operation not possible

Openshift and also OKD Docker image is stuck when loading. A severe bug in the CRI-O engine causes stuck the OKD Docker images in an invalid and unusable state. There are discussions about timeouts while loading the images from the docker registry or too long...

Windows Subsystem for Linux and Minikube

The Windows Subsystem for Linux is the seamless integration of Linux into Windows. Use Windows natively and quickly issue a Linux command. Apply a Linux command to the Windows file system without having to start a virtual machine. As a result, Linux is always...

New: Openshift OKD causes image layer not known problems

The POD fails to start, and referrers to the image layer not known. The "layer not known" issue may affect one or more cluster nodes. In effect, there is a corrupt docker image on the local disk cache. The layer not known problem still exists, even after a node or...

The Docker daemon configuration files

Where are the Docker daemon configuration files located? How to restart the Docker daemon after applying changes to the configuration? How to change and activate the Docker configuration? These are frequently asked questions. But changes to the Docker configuration...