pod-image-swap-webhook

command module
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 7, 2024 License: MIT Imports: 10 Imported by: 0

README

pod-image-swap-webhook

Build Status Go Report Card License

A mutating webhook that patches Pod container images based on configuration rules. For example, if you want to transparently proxy image pulls through an internal registry, this webhook might be for you.

Preparation

This webhook works best in combination with Harbor and its proxy cache feature.

It is recommended to setup a proxy cache project for every registry for which you want the webhook to replace images.

Of course this webhook also works without Harbor.

Deployment

The helm chart provided in this repository can be used to deploy the webhook.

First, add the helm repository:

helm repo add pod-image-swap-webhook \
  https://bonial-international-gmbh.github.io/pod-image-swap-webhook

Create a values.yaml and add a webhookConfig section with the desired replacement configuration, for example:

---
webhookConfig:
  exclude:
    - prefix: k8s.gcr.io/ingress-nginx/controller
  replace:
    - prefix: quay.io
      replacement: registry.example.org/quay.io
    - prefix: k8s.gcr.io
      replacement: registry.example.org/k8s.gcr.io
    - prefix: docker.io
      replacement: registry.example.org/docker.io

You can find documentation for all available webhookConfig fields in config.sample.yaml. For more helm configuration options have a look into the values.yaml defaults.

Finally use helm to install the webhook:

helm upgrade pod-image-swap-webhook pod-image-swap-webhook/pod-image-swap-webhook \
  --install --namespace kube-system --values values.yaml

License

The source code of pod-image-swap-webhook is released under the MIT License. See the bundled LICENSE file for details.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg
config
Package config holds the configuration schema for image replacement rules.
Package config holds the configuration schema for image replacement rules.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL