From 7fafec1e1bff7eb5b260519a8cfab771c8413cf1 Mon Sep 17 00:00:00 2001 From: Cameron McAvoy Date: Mon, 4 Dec 2023 13:48:13 -0600 Subject: [PATCH] Tidy up README and RELEASE info --- OSSMETADATA | 1 + README.md | 63 ++++++++++--------- RELEASE.md | 20 ++++++ .../harbor-container-webhook/values.yaml | 5 +- 4 files changed, 58 insertions(+), 31 deletions(-) create mode 100644 OSSMETADATA create mode 100644 RELEASE.md diff --git a/OSSMETADATA b/OSSMETADATA new file mode 100644 index 0000000..b96d4a4 --- /dev/null +++ b/OSSMETADATA @@ -0,0 +1 @@ +osslifecycle=active diff --git a/README.md b/README.md index 8618f6e..7a6d8d2 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,28 @@ -# harbor-container-webhook +harbor-container-webhook ========= -# Project Overview - -harbor-container-webhook is a kubernetes mutating webhook which rewrites container images to use a Harbor proxy cache. +A kubernetes mutating webhook which rewrites container images to use a Harbor proxy cache. This is typically useful for mirroring public registries that have low rate limits, such as dockerhub, or limiting public bandwidth usage, by mirroring images in a local Harbor registry. harbor-container-webhook inspects pod requests in a kubernetes cluster and rewrites the container image registry of matching images. -# Configuration +* [Prerequisites](#prerequisites) +* [Installing](#installing) +* [Usage](#usage) +* [Local Development](#local-development) + +Prerequisites +=== +Requires kubernetes 1.17+ and can either be installed via helm or bare manifests. + +Installing +=== +See the helm chart available in the /deploy directory. +Usage +=== The harbor-container-webhook rewrites are managed by configuration rules. Each rule contains a list of regular expressions to match on, as well as an optional list of regular expressions to exclude. For each container image reference which matches at least one match rule and none of the exclusion rules, then the registry is replaced @@ -41,42 +52,38 @@ rules: replace: 'harbor.example.com/ubuntu-proxy' checkUpstream: true # tests if the manifest for the rewritten image exists ``` -# Local Development - +Local Development +=== `make help` prints out the help info for local development: ``` -build build harbor-container-webhook binary -deps download go modules -docker-build build the docker image -docker-push push the docker image -fmt ensure consistent code style -hack build and run the webhook w/hack config -hack-test curl the admission and no-op json bodies to the webhook -help displays this help message -lint run golangci-lint -test run go tests - +build Build binary for the specified arch +docker.build Build the docker image +fmt ensure consistent code style +generate Generate code +hack-test curl the admission and no-op json bodies to the webhook +hack build and run the webhook w/hack config +helm.build Build helm chart +helm.docs Generate helm docs +help displays this help message +lint run golangci-lint +test Run tests ``` Ensure tests and linters pass with `make lint test`. The webhook can be run locally with `make hack` and then `make hack-test` to submit sample responses to the webhook. -# Deployment - -deploy/charts contains a helm chart which can deploy the harbor-container-webhook. - -# Contributing - +Contributing +=== We welcome contributions! Feel free to help make the harbor-container-webhook better. -# Code of Conduct - +Code of Conduct +=== harbor-container-webhook is governed by the [Contributer Covenant v1.4.1](CODE_OF_CONDUCT.md) For more information please contact opensource@indeed.com. -# License - +License +=== The harbor-container-webhook is open source under the [Apache 2](LICENSE) license. diff --git a/RELEASE.md b/RELEASE.md new file mode 100644 index 0000000..3c0aec0 --- /dev/null +++ b/RELEASE.md @@ -0,0 +1,20 @@ +# Release Process + +TODO: Migrate these to github actions. + +### Prerelease + +1. Ensure the [CHANGELOG.md](CHANGELOG.md) is up to date. +2. Bump the [Chart.yaml](deploy/charts/harbor-container-webhook/Chart.yaml) `version` or `appVersion` as needed. + +### Test the build of harbor-container-webhook + +1. Build the webhook: `make docker.build` + +### Release harbor-container-webhook + +1. Release the webhook: `git tag 0.x.x && git push --tags` + +### Release Helm Chart + +1. Regenerate the helm chart + docs: `helm.build` \ No newline at end of file diff --git a/deploy/charts/harbor-container-webhook/values.yaml b/deploy/charts/harbor-container-webhook/values.yaml index 8f64a77..6b9a2b9 100644 --- a/deploy/charts/harbor-container-webhook/values.yaml +++ b/deploy/charts/harbor-container-webhook/values.yaml @@ -5,10 +5,9 @@ replicaCount: 1 image: - repository: cnmcavoy/harbor-container-webhook + repository: ghcr.io/indeedeng/harbor-container-webhook pullPolicy: IfNotPresent - # Overrides the image tag whose default is the chart version. - tag: "v0.5.0" + tag: "main" imagePullSecrets: [] nameOverride: ""