Skip to content

blachniet/kustomize-plugins

Repository files navigation

Kustomize Plugins

A collection of Kustomize plugins developed according to the Kustomize plugins guide.

You must provide the --enable-alpha-plugins argument to kubectl or kustomize to use these plugins because the Plugin feature status is currently in alpha.

Plugins

PullPolicyTransformer

Set the imagePullPolicy for all containers whose image name matches a given value.

This is particularly useful in combination with the ImageTagTransformer when changing the tag to/from a "rolling" tag (e.g. latest). When you change the tag to latest, you may want to set imagePullPolicy: Always. When you change the tag to a specific version (e.g. v1.2.3), you may want to set imagePullPolicy: IfNotPresent.

Example

apiVersion: k8s.blachniet.com/v1alpha1
kind: PullPolicyTransformer
metadata:
  name: set-pull-policy
  annotations:
    config.kubernetes.io/function: |
      container:
        image: ghcr.io/blachniet/kustomize-plugins:0.3.0
images:
- name: nginx
  newPullPolicy: Always
- name: busybox
  newPullPolicy: IfNotPresent

Contributing

Generate Dockerfile

go run main.go gen .

Run example one-liner

Build the Docker image and run an example.

docker build . -t ghcr.io/blachniet/kustomize-plugins:dev \
    && kubectl kustomize --enable-alpha-plugins examples/pull-policy-transformer \
    | less

Release checklist

  1. List existing releases and choose the next release version.

    gh release list
  2. Update documentation and examples with the new version number. This is a manual step. Search the repository for ghcr.io/blachniet/kustomize-plugins:.

  3. Commit and push the changes.

    git commit <updated-files>
    git push
  4. Ensure the workflows pass.

  5. Create the release.

    gh release create vX.Y.Z
  6. Confirm that GitHub workflows publish the new Docker image.

Resources

About

A collection of Kustomize plugins.

Topics

Resources

Stars

Watchers

Forks

Packages