Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manager image patch #101

Merged
merged 12 commits into from
May 1, 2019
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ bin
# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Manager image patch file
/config/manager_image_patch.yaml

# Kubernetes Generated files - skip generated files, except for vendored files

!vendor/**/zz_generated.*
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ docker-push-release: docker-tag-release
docker-build:
docker build . -t ${IMG}
@echo "updating kustomize image patch file for manager resource"
sed -i'' -e 's@image: .*@image: '"${IMG}"'@' ./config/manager_image_patch.yaml
ctab marked this conversation as resolved.
Show resolved Hide resolved
echo "#" > ./config/manager_image_patch.yaml

docker-build-ci:
docker build . -t $(IMG) -f Dockerfile_ci
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,13 @@ Currently the most reliable way of installing Gatekeeper is to build and install

#### Deploying a Release using Prebuilt Image

If you want to deploy a released version of Gatekeeper in your cluster with a prebuilt image, then you can run the following command:
If you want to deploy a released version of Gatekeeper in your cluster with a prebuilt image, then first copy the following kustomize configuration patch:

```sh
cp config/manager_image_patch_template.yaml config/manager_image_patch.yaml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prebuilt Image here refers to a published image as part of a release we have previous cut. For example: quay.io/open-policy-agent/gatekeeper:v3.0.0

This deployment yaml https://raw.githubusercontent.com/open-policy-agent/gatekeeper/master/deploy/gatekeeper-constraint.yaml should work out of the box, without any modification. If you want to build you own image, then there are two options:

  1. Follow this to deploy head using Make
  2. Replace the gatekeeper image in gatekeeper-constraint.yaml with your own image.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't think this step is needed if user is using a prebuilt image.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ritazh, I wasn't sure since I've only been doing the make deploy process. I'll remove this then.

```

Then modify the new manager_image_patch.yaml file to point to your prebuilt image. Finally, run the following:

```sh
kubectl apply -f https://raw.githubusercontent.com/open-policy-agent/gatekeeper/master/deploy/gatekeeper-constraint.yaml
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# You can copy this file to manager_image_patch.yaml to specify a prebuilt image
apiVersion: apps/v1
kind: StatefulSet
metadata:
Expand All @@ -8,5 +9,5 @@ spec:
spec:
containers:
# Change the value of image field below to your controller image URL
- image: gcr.io/smythe-kpc/open-policy-agent/gatekeeper:latest
- image: <IMAGE URL>
name: manager