https://pulumi.com logo
#kubernetes
Title
# kubernetes
d

dazzling-sundown-39670

06/04/2020, 1:09 PM
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

billowy-army-68599

06/04/2020, 1:52 PM
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

ancient-megabyte-79588

06/04/2020, 2:29 PM
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

billowy-army-68599

06/04/2020, 2:38 PM
@ancient-megabyte-79588 that variable isn't in the values.yaml, it's a setting in
php.ini
a

ancient-megabyte-79588

06/04/2020, 2:38 PM
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

billowy-army-68599

06/04/2020, 2:41 PM
@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

dazzling-sundown-39670

06/04/2020, 2:52 PM
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

billowy-army-68599

06/04/2020, 2:58 PM
(transformations are my favourite pulumi feature)
d

dazzling-sundown-39670

06/04/2020, 3:52 PM
It adds the vars but doesn't fix my problem. Maybe it's defined in multiple places
4 Views