Kustomize Transformer Configurations for OpenShift types namely, BuildConfigs, Imagestreams and DeploymentConfigs.
- Download and copy over the kustomizeconfig directory into
$TEMPLATE_HOME/kustomizeconfig. - Update your kustomization.yaml to include all the
configurationsin kustomization.yaml
Note: kustomize doesn't allow specification of remote urls for configurations in kustomization.yaml
Assuming the kustomize workspace looks like:
├── kustomization.yaml
├── overlays
│ └── dev
│ ├── kustomization.yaml
│ └── service_port.yaml
└── resources
├── _helpers.tpl
├── buildconfig.yaml
├── deployment.yaml
├── imagestream.yaml
├── route.yaml
└── service.yaml
To add a transformer config to custom OpenShift types like BuildConfig, we need to convey to Kustomize where in the spec lies the image.
Similarly, we need to convey the path to the image specification in a DeploymentConfig and in an Imagestream.
The configuratiom for ImageStreams, BuildConfigs and DeploymentConfigs are maintained in openshift-kustomizeconfigs/kustomizeconfig. They can be used of the box by copying over the directory into your Kustomize workspace as shown below.
├── kustomization.yaml
├── kustomizeconfig
│ ├── buildconfig.yaml
│ ├── deploymentconfig.yaml
│ └── imagestream.yaml
├── overlays
│ └── dev
│ ├── buildconfig.yaml
│ ├── kustomization.yaml
│ └── service_port.yaml
└── resources
├── buildconfig.yaml
├── deployment.yaml
├── imagestream.yaml
├── route.yaml
└── service.yaml
To enable it, add the following to your base kustomization.yaml
configurations:
- kustomizeconfig/imagestream.yaml
- kustomizeconfig/buildconfig.yaml
- kustomizeconfig/deploymentconfig.yaml
Sample usage could be found in https://github.com/sbose78/nodejs-ex