0

i have a requirement, where i want to re-use a kubernetes yaml file again and again. how can we do this, in below eg. where i want {{ JENKINS }} to replaced every time with a different varibale.

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: {{ JENKINS  }}
spec:
  rules:
  - host: {{ JENKINS }}.kubernetes.summimak.online
    http:
      paths:
      - path: /
        backend:
         serviceName: jenkins
         servicePort: 80

1 Answer 1

0

There is no native support for templates in Kubernetes.

Openshift has its own simple templating system. Look for oc process. You could probably use the command without having an Openshift cluster.

If you are packaging an application, and you want help with the updates, not only reuse configurable resources definition, the tool for the job is helm, the package manager for Kubernetes.

If you don't like any of this, just use sed or your favorite template system in your favorite programming language. In that case, you should consider using the Kubernetes API.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .