auto-replace-gcr-repo

command module
v0.0.0-...-0e1bcf9 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

README

A mutate webhook to replace gcr.io k8s.gcr.io quay.io to azk8s.cn mirror

Useful when you use a component that will automatic create pod ,such as sonobuoy CNCF conformance test

Origin Code is from kubernetes

BUILD

CGO_ENABLED=0 GOARCH=amd64 go build -a -installsuffix cgo -o webhook ./.

USAGE

Generate ca cert file & server cert file & key file

openssl genrsa -out ca.key 2048
openssl genrsa -out server.key 2048
openssl req -new -x509 -key ca.key -out ca.crt
openssl req -new -key server.key -out server.csr
openssl x509 -req -in server.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out server.crt

Notice: The domain when you create server.crt must same as the domain you use in ValidatingWebhookConfiguration

Deploy the webhook on your way

#./webhook -tls-cert-file=server.crt -tls-private-key-file=server.key -alsologtostderr

kubectl create -f mutate.yaml to create the MutatingWebhookConfiguration

kubectl create -f gcr.yaml you will find the image be replaced automatically


##TODO
Add Dockerfile
Add support for glide or go module

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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