DEV Community

Tim Reber
Tim Reber

Posted on

Deploy Helm Chart using kustomize

Hello Dev,

I'm happy to share with you a deployment I recently had to do :).
So... Imagine you have a helm chart for example from Crossplane. What if the Helm Chart doesn't fit your needs? Yes, you could just edit it by hand and make it fit. But what if a new version comes out and you have to upgrade it? You have to do it all over again :(. I'm gonna show you how I did it and what worked out for me.

In the Crossplane Helm-Chart is a ConfigMap used to store the PKI Certificates. But I would like to use a Secret. So I wrote a part of a Deployment that overrides the ConfigMap with a Secret.

apiVersion: apps/v1
kind: Deployment
metadata:
  name: crossplane
spec:
  template:
    spec:
      volumes:
        - name: ca-certs
          configMap: null
          secret:
            secretName: pki
            items:
              - key: pki
                path: pki
Enter fullscreen mode Exit fullscreen mode

When this config should be used you have to mention it in your kustomization.yaml file under the patchesStrategicMerge property.

namespace: kube-crossplane
patchesStrategicMerge:
- deployment-crossplane.yaml
helmCharts:
- name: crossplane
  version: 1.10.1
  repo: https://charts.crossplane.io/stable
  valuesFile: values.yaml
Enter fullscreen mode Exit fullscreen mode

When you deploy that, the ConfigMap for ca-certs will now be replaced with a Secret.

Top comments (0)