Skip to content

Commit bed57b1

Browse files
Merge pull request #1438 from camilamacedo86/uninstall-2
feat: add uninstall makefile target
2 parents 27c400b + e705232 commit bed57b1

File tree

2 files changed

+50
-13
lines changed

2 files changed

+50
-13
lines changed

Makefile

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,14 +108,6 @@ build: clean $(CMDS)
108108
$(TCMDS):
109109
go test -c $(BUILD_TAGS) $(MOD_FLAGS) -o bin/$(shell basename $@) $@
110110

111-
run-local: build-linux build-wait build-util-linux
112-
rm -rf build
113-
. ./scripts/build_local.sh
114-
mkdir -p build/resources
115-
. ./scripts/package_release.sh 1.0.0 build/resources doc/install/local-values.yaml
116-
. ./scripts/install_local.sh $(LOCAL_NAMESPACE) build/resources
117-
rm -rf build
118-
119111
deploy-local:
120112
mkdir -p build/resources
121113
. ./scripts/package_release.sh 1.0.0 build/resources doc/install/local-values.yaml
@@ -227,8 +219,40 @@ ifeq ($(quickstart), true)
227219
./scripts/package_quickstart.sh deploy/$(target)/manifests/$(ver) deploy/$(target)/quickstart/olm.yaml deploy/$(target)/quickstart/crds.yaml deploy/$(target)/quickstart/install.sh
228220
endif
229221

222+
################################
223+
# OLM - Install/Uninstall/Run #
224+
################################
225+
230226
.PHONY: run-console-local
231227
run-console-local:
232228
@echo Running script to run the OLM console locally:
233229
. ./scripts/run_console_local.sh
234230

231+
.PHONY: uninstall
232+
uninstall:
233+
@echo Uninstalling OLM:
234+
- kubectl delete -f deploy/upstream/quickstart/crds.yaml
235+
- kubectl delete -f deploy/upstream/quickstart/olm.yam
236+
- kubectl delete catalogsources.operators.coreos.com
237+
- kubectl delete clusterserviceversions.operators.coreos.com
238+
- kubectl delete installplans.operators.coreos.com
239+
- kubectl delete operatorgroups.operators.coreos.com subscriptions.operators.coreos.com
240+
- kubectl delete apiservices.apiregistration.k8s.io v1.packages.operators.coreos.com
241+
- kubectl delete ns olm
242+
- kubectl delete ns openshift-operator-lifecycle-manager
243+
- kubectl delete ns openshift-operators
244+
- kubectl delete ns operators
245+
- kubectl delete clusterrole.rbac.authorization.k8s.io/aggregate-olm-edit
246+
- kubectl delete clusterrole.rbac.authorization.k8s.io/aggregate-olm-view
247+
- kubectl delete clusterrole.rbac.authorization.k8s.io/system:controller:operator-lifecycle-manager
248+
- kubectl delete clusterroles.rbac.authorization.k8s.io "system:controller:operator-lifecycle-manager"
249+
- kubectl delete clusterrolebindings.rbac.authorization.k8s.io "olm-operator-binding-openshift-operator-lifecycle-manager"
250+
251+
.PHONY: run-local
252+
run-local: build-linux build-wait build-util-linux
253+
rm -rf build
254+
. ./scripts/build_local.sh
255+
mkdir -p build/resources
256+
. ./scripts/package_release.sh 1.0.0 build/resources doc/install/local-values.yaml
257+
. ./scripts/install_local.sh $(LOCAL_NAMESPACE) build/resources
258+
rm -rf build

doc/install/install.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
OLM deployment resources are templated so that they can be easily configured for different deployment environments.
44

5-
Check out the latest [releases on github](https://github.com/operator-framework/operator-lifecycle-manager/releases) for release-specific install instructions.
5+
# Installation Options
66

77
## Manual installation
88

@@ -12,20 +12,27 @@ kubectl create -f deploy/upstream/quickstart/crds.yaml
1212
kubectl create -f deploy/upstream/quickstart/olm.yaml
1313
```
1414

15-
## OpenShift
15+
## Install a Release
1616

17-
OLM is installed by default in OpenShift 4.0 and above.
17+
Check out the latest [releases on github](https://github.com/operator-framework/operator-lifecycle-manager/releases) for release-specific install instructions.
1818

1919
## Run locally with minikube
2020

2121
This command starts minikube, builds the OLM containers locally with the minikube-provided docker, and uses the local configuration in [local-values.yaml](local-values.yaml) to build localized deployment resources for OLM.
2222

23-
```
24-
make run-local
23+
```bash
24+
# To install and run locally
25+
$ make run-local
2526
```
2627

2728
You can verify that the OLM components have been successfully deployed by running `kubectl -n local get deployments`
2829

30+
**NOTE** It is recommended for development purposes and will use the source locally
31+
32+
## OpenShift
33+
34+
**IMPORTANT:** OLM is installed by default in OpenShift 4.0 and above.
35+
2936
## Customizing OLM installation
3037

3138
Deployments of OLM can be stamped out with different configurations by writing a `values.yaml` file and running commands to generate resources.
@@ -120,3 +127,9 @@ spec:
120127
source: operatorhubio-catalog
121128
sourceNamespace: olm
122129
```
130+
131+
# Uninstall
132+
133+
Run the command `make uninstall`.
134+
135+
**NOTE** Valid just for local/manual installs.

0 commit comments

Comments
 (0)