How to apply transformer plugin after Ingress serviceName is updated?

10/21/2019

I have a kustomize transformer plugin that reads the value of serviceName in Ingress spec/rules/*/http/paths/0/backend/serviceName. The intent of the plugin is to update the host entries in the Ingress with the final serviceName after nameSuffix/namePrefix has been applied.

The plugins reads from stdin, but the state of the yaml isn't what I expected. The names of the Service and the Ingress have the nameSuffix/namePrefix applied, but the value of serviceName in the Ingress is still the raw service name. I verified this by dumping the Ingress yaml when the plugin executes. After the plugin runs, the final output does have the updated serviceName (with prefix/suffix). So something is running after the plugin that does the updating.

How do I configure the plugin so that it runs after the serviceName in the Ingress has been updated?

-- Erick T
kubernetes
kustomize

0 Answers