Skip to content

Commit

Permalink
Tidy up README and RELEASE info
Browse files Browse the repository at this point in the history
  • Loading branch information
cnmcavoy committed Dec 4, 2023
1 parent 280725c commit 7fafec1
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 31 deletions.
1 change: 1 addition & 0 deletions OSSMETADATA
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
osslifecycle=active
63 changes: 35 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 [email protected].
# License
License
===
The harbor-container-webhook is open source under the [Apache 2](LICENSE) license.
20 changes: 20 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -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`
5 changes: 2 additions & 3 deletions deploy/charts/harbor-container-webhook/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: ""
Expand Down

0 comments on commit 7fafec1

Please sign in to comment.