Is it possible to override files inside helm chart...
# kubernetes
d
Is it possible to override files inside helm charts? 🤔 I'm trying to use chart
bitnami/phpmyadmin
but the maximum upload size is too low for me and they don't offer a way to set it. So I would like to override the config file with a different one
b
You can use a transformation to modify the existing config map, or drop it from the chart and using a transformation and just add your own resource instead
a
What file are you trying to override? Most Helm charts (all?) provide a
values.yaml
replacement option which Pulumi supports providing.
You need to investigate this
values.yaml
, figure out what config you need to change, and then create teh pulumi
values: {}
comparable object in your Chart options. https://github.com/bitnami/charts/blob/master/bitnami/phpmyadmin/values.yaml
b
@ancient-megabyte-79588 that variable isn't in the values.yaml, it's a setting in
php.ini
a
That's sucks. Does the container allow for setting a volume that you can put your own php.ini in?
I have zero experience with that particular bitnami chart, so I'm just spitballing ideas here! 😄
b
@dazzling-sundown-39670 it appears you can set the maxupload size using
PHP_UPLOAD_MAX_FILESIZE
as an environment variable. The chart doesn't appear to support arbitrary env vars, but you can use a transform to set it. Let me know if you'd like an example
d
Thanks everyone, trying this out now:
Copy code
transformations: [
      (obj: any) => {
        if (obj.kind === 'Deployment') {
          obj.spec.template.spec.containers[0].env.push({
            name: 'PHP_UPLOAD_MAX_FILESIZE',
            value: '1G',
          });
          console.log(JSON.stringify(obj, null, 2));
        }
      },
    ],
👍 1
b
(transformations are my favourite pulumi feature)
d
It adds the vars but doesn't fix my problem. Maybe it's defined in multiple places