Skip to content

Commit 8b0fe6b

Browse files
ngopalak-redhatk8s-ci-robot
authored andcommitted
Enhance OpenShift deployment instructions and Makefile
1 parent 876ff72 commit 8b0fe6b

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

Makefile

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -681,8 +681,8 @@ endif
681681
set-openshift-image-params:
682682
$(eval DOCKERFILE = Dockerfile.ubi)
683683

684-
.PHONY: push-openshift-dev
685-
push-openshift-dev: set-openshift-image-params openshift-user image
684+
.PHONY: _push-image-openshift-dev
685+
_push-image-openshift-dev:
686686
@echo "Exposing the default route to the image registry"
687687
@oc patch configs.imageregistry.operator.openshift.io/cluster --patch '{"spec":{"defaultRoute":true}}' --type=merge
688688
@echo "Pushing image $(IMAGE) to the image registry"
@@ -698,6 +698,13 @@ else
698698

699699
endif
700700

701+
.PHONY: push-prebuilt-image-openshift-dev
702+
push-prebuilt-image-openshift-dev: set-openshift-image-params openshift-user _push-image-openshift-dev
703+
@echo "Pushed a pre-built image to image registry"
704+
705+
.PHONY: push-openshift-dev
706+
push-openshift-dev: set-openshift-image-params openshift-user image _push-image-openshift-dev
707+
@echo "Built image and pushed to image registry"
701708
.PHONY: do-deploy-openshift-dev
702709
do-deploy-openshift-dev: $(BUILD_DIR)/kustomize
703710
@echo "Deploying"
@@ -709,6 +716,9 @@ do-deploy-openshift-dev: $(BUILD_DIR)/kustomize
709716
.PHONY: deploy-openshift-dev
710717
deploy-openshift-dev: push-openshift-dev do-deploy-openshift-dev
711718

719+
# Deploy pre-built image for development into OpenShift
720+
.PHONY: deploy-prebuilt-openshift-dev
721+
deploy-prebuilt-openshift-dev: push-prebuilt-image-openshift-dev do-deploy-openshift-dev
712722

713723
# Deploy the operator into the current kubectl context.
714724
.PHONY: deploy

hacking.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,15 +180,24 @@ On a high level, the process is as follows:
180180
to change the image references to point to your images
181181

182182
### Distribution specific instructions: OpenShift
183+
Before you start, you must have the `KUBECONFIG` environment variable set correctly to point to your
184+
OpenShift cluster's configuration file, and you need to be successfully logged in using the `oc login` command.
185+
183186
For convenience, the `Makefile` contains a target called `deploy-openshift-dev` which
184187
deploys SPO in an OpenShift cluster with the appropriate defaults (SELinux is on by default)
185-
and the appropriate settings (no cert-manager needed).
188+
and the appropriate settings (no cert-manager needed). It should be noted that `deploy-openshit-dev`
189+
will not enable eBPF and app-armor capabilities (APPARMOR_ENABLED=0, BPF_ENABLED=0).
186190

187191
If you modify the code and need to push the images to the cluster again, use the
188192
`push-openshift-dev` Makefile target. Because the targets use the `ImageStream` feature
189193
of OpenShift, simply pushing the new images will trigger a new rollout of the deployments
190194
and DaemonSets.
191195

196+
To build the SPO image with eBPF enabled, simply use `BPF_ENABLED=1 make image`, which will compile the image and
197+
make it available locally at `localhost/security-profiles-operator:latest`. Once built, you can deploy this pre-built
198+
image to OpenShift by running `make deploy-prebuilt-openshift-dev`. Subsequently, if you need to push this locally
199+
built image to image registry used by OpenShift, execute `make push-prebuilt-image-openshift-dev`.
200+
192201
### Tearing down your test environment
193202
At the moment, there's no teardown target provided. At the same time, some
194203
custom resources, notably the policies themselves use finalizers which prevent

0 commit comments

Comments
 (0)