Using ConfigOption or LicenseFieldValue in kots-app.yaml

Is it possible to use ConfigOption or LicenseFieldValue in kots-app.yaml?

Background:
We define additional images in kots-app and one of the image names should be rendered based on the LicenseFieldValue. Is this possible?

Hi @ravi_devarakonda, only certain fields can be templated in the kots application spec and, unfortunately, additionalImages does not support templating. Our docs outline this custom resource and the fields that support template functions: Application | Replicated Docs

Hi @craig,

Thank you for the reply.
If this is not possible, is there a different way to achieve this?

Best regards,
Ravi

One option could be to define all of the potentially used images in the additionalImages field and use the template functions in a Pod spec to render the particular image that should be used based on a LicenseFieldValue.

apiVersion: kots.io/v1beta1
kind: Application
...
spec:
  additionalImages:
    - my-image:red
    - my-image:blue
apiVersion: v1
kind: Pod
...
spec:
  containers:
    - image: 'my-image:{{repl LicenseFieldValue "color" }}'

It might also be good to know that all the images will be included in the airgap bundle. In other words: The airgap bundle creation is not depending on the customer license. Each customer gets the same airgap bundle based on the channel they are assigned.

That also means that for example if a customer has blue in their LicenseFieldValue, the airgap bundle will still contain blue and red images.

If needed, happy to jump on a call to better understand your use case and why each customer requires a specific image. Maybe there’s an easier solution.

1 Like

Hello Josh,
Thank you for the reply.
Our use case is that, we have a container image which is unique to each customer. So, my idea was to include the image name in the customer License as a LicenseFieldValue and then render it in the chart.
But, the real problem is that this image and a bunch of other images are dynamically pulled by our operator and that’s the reason we included all these in additional images.

It would be really helpful if we can jump on a call. Let me know if you have some free time on Friday and I can send an invite across. I am based in Berlin. But, we can workout a time based on your timezone.

Best regards,
Ravi