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

feat: add uninstall makefile target #1438

Merged
merged 1 commit into from
Jun 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 32 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,6 @@ build: clean $(CMDS)
$(TCMDS):
go test -c $(BUILD_TAGS) $(MOD_FLAGS) -o bin/$(shell basename $@) $@

run-local: build-linux build-wait build-util-linux
rm -rf build
. ./scripts/build_local.sh
mkdir -p build/resources
. ./scripts/package_release.sh 1.0.0 build/resources doc/install/local-values.yaml
. ./scripts/install_local.sh $(LOCAL_NAMESPACE) build/resources
rm -rf build

deploy-local:
mkdir -p build/resources
. ./scripts/package_release.sh 1.0.0 build/resources doc/install/local-values.yaml
Expand Down Expand Up @@ -227,8 +219,40 @@ ifeq ($(quickstart), true)
./scripts/package_quickstart.sh deploy/$(target)/manifests/$(ver) deploy/chart/crds deploy/$(target)/quickstart/olm.yaml deploy/$(target)/quickstart/crds.yaml deploy/$(target)/quickstart/install.sh
endif

################################
# OLM - Install/Uninstall/Run #
################################

.PHONY: run-console-local
run-console-local:
@echo Running script to run the OLM console locally:
. ./scripts/run_console_local.sh

.PHONY: uninstall
uninstall:
@echo Uninstalling OLM:
- kubectl delete -f deploy/upstream/quickstart/crds.yaml
- kubectl delete -f deploy/upstream/quickstart/olm.yam
- kubectl delete catalogsources.operators.coreos.com
- kubectl delete clusterserviceversions.operators.coreos.com
- kubectl delete installplans.operators.coreos.com
- kubectl delete operatorgroups.operators.coreos.com subscriptions.operators.coreos.com
- kubectl delete apiservices.apiregistration.k8s.io v1.packages.operators.coreos.com
- kubectl delete ns olm
- kubectl delete ns openshift-operator-lifecycle-manager
- kubectl delete ns openshift-operators
- kubectl delete ns operators
- kubectl delete clusterrole.rbac.authorization.k8s.io/aggregate-olm-edit
- kubectl delete clusterrole.rbac.authorization.k8s.io/aggregate-olm-view
- kubectl delete clusterrole.rbac.authorization.k8s.io/system:controller:operator-lifecycle-manager
- kubectl delete clusterroles.rbac.authorization.k8s.io "system:controller:operator-lifecycle-manager"
- kubectl delete clusterrolebindings.rbac.authorization.k8s.io "olm-operator-binding-openshift-operator-lifecycle-manager"

.PHONY: run-local
run-local: build-linux build-wait build-util-linux
rm -rf build
. ./scripts/build_local.sh
mkdir -p build/resources
. ./scripts/package_release.sh 1.0.0 build/resources doc/install/local-values.yaml
. ./scripts/install_local.sh $(LOCAL_NAMESPACE) build/resources
rm -rf build
23 changes: 18 additions & 5 deletions doc/install/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

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

## Manual installation

Expand All @@ -12,20 +12,27 @@ kubectl create -f deploy/upstream/quickstart/crds.yaml
kubectl create -f deploy/upstream/quickstart/olm.yaml
```

## OpenShift
## Install a Release

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

## Run locally with minikube

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.

```
make run-local
```bash
# To install and run locally
$ make run-local
```

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

**NOTE** It is recommended for development purposes and will use the source locally

## OpenShift

**IMPORTANT:** OLM is installed by default in OpenShift 4.0 and above.

## Customizing OLM installation

Deployments of OLM can be stamped out with different configurations by writing a `values.yaml` file and running commands to generate resources.
Expand Down Expand Up @@ -120,3 +127,9 @@ spec:
source: operatorhubio-catalog
sourceNamespace: olm
```

# Uninstall

Run the command `make uninstall`.

**NOTE** Valid just for local/manual installs.