Skip to content

Repository files navigation

Helm Hotpatch

This Helm post-renderer plugin allows for patching the rendered Helm chart templates.

Quickstart

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: LoadBalancerEOF

Template 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: ClusterIP

Template 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

Patching

# 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: 80

Release

To create a new release, update the version in plugin.yaml and push the commit to the main branch.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages