This Helm post-renderer plugin allows for patching the rendered Helm chart templates.
Create a patch.
mkdir ./patches
cat > ./patches/patch.yaml <<EOFtarget: testchart/templates/service.yamlpatches: - action: patch data: apiVersion: v1 kind: Service metadata: name: test spec: type: LoadBalancerEOFTemplate without patching.
$ helm template foo integration/testdata/chart -s templates/service.yaml---
# Source: testchart/templates/service.yamlapiVersion: v1kind: Servicemetadata: name: testspec: ports: - name: http port: 80 protocol: TCP targetPort: http type: ClusterIPTemplate with patching.
$ helm template foo integration/testdata/chart -s templates/service.yaml --post-renderer hotpatch---
# Source: testchart/templates/service.yamlapiVersion: v1kind: Servicemetadata: name: testspec: ports: - name: http port: 80 protocol: TCP targetPort: http type: LoadBalancer# Each patch targets a single template.target: chart/templates/name.yaml# There are three different patch actions, add, remove, patch.patches:
# Patches with action add introduces a new manifest to the rendered output.
- action: adddata:
apiVersion: v1kind: Servicemetadata:
name: new-temporary-servicespec:
...# Patches with action remove deletes the manifest that matches.
- action: removedata:
apiVersion: v1kind: Servicemetadata:
name: existing-service# Patches with action patch changes the manifest that matches.
- action: patchdata:
apiVersion: v1kind: Servicemetadata:
name: existing-service-2ports:
- port: 8080targetPort: 80To create a new release, update the version in plugin.yaml and push the commit to the main branch.