Skip to content

Commit

Permalink
Closes #4146 - provides instructions on how to set up a target to und…
Browse files Browse the repository at this point in the history
…eploy the operator (#4163)

Adds instructions on how to set up a target to undeploy the operator.
Modifies the deployment namespace so that it does not match an existing namespace.
  • Loading branch information
fgiloux committed Nov 10, 2020
1 parent 723bec5 commit f20ea9e
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions website/content/en/docs/building-operators/golang/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -330,11 +330,7 @@ The name and tag of the image (`IMG=<some-registry>/<project-name>:tag`) in both

#### Deploy the operator

For this example we will run the operator in the `default` namespace which can be specified for all resources in `config/default/kustomization.yaml`:

```sh
$ cd config/default/ && kustomize edit set namespace "default" && cd ../..
```
By default, a new namespace is created with name `<project-name>-system`, i.e. memcached-operator-system and will be used for the deployment.

Run the following to deploy the operator. This will also install the RBAC manifests from `config/rbac`.

Expand All @@ -348,7 +344,7 @@ in the cluster or `make deploy` will fail when creating the cert-manager resourc
Verify that the memcached-operator is up and running:

```console
$ kubectl get deployment
$ kubectl get deployment -n memcached-operator-system
NAME READY UP-TO-DATE AVAILABLE AGE
memcached-operator-controller-manager 1/1 1 1 8m
```
Expand Down Expand Up @@ -436,12 +432,19 @@ memcached-sample 5/5 5 5 3m

### Cleanup

```sh
$ kubectl delete -f config/samples/cache_v1alpha1_memcached.yaml
$ kubectl delete deployments,service -l control-plane=controller-manager
$ kubectl delete role,rolebinding --all
A new target can be added into the Makefile for cleaning up the resources that have been created along this tutorial:

```make
# Undeploy controller from the configured Kubernetes cluster
undeploy:
$(KUSTOMIZE) build config/default | kubectl delete -f -
```

Once that's done the simple command below will delete all the resources:
```sh
$ make undeploy
```
## Further steps
Expand Down

0 comments on commit f20ea9e

Please sign in to comment.