Skip to content

Commit

Permalink
WIP: doc/user-guide: Document operator-sdk up local
Browse files Browse the repository at this point in the history
  • Loading branch information
etiennecoutaud committed May 18, 2018
1 parent 67e438f commit def5398
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion doc/user-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,15 @@ Replace the default handler with the reference [memcached handler][memcached_han
### Build and run the operator

There is 2 ways to run the operator:

- As pod inside Kubernetes cluster
- As go program outside cluster

#### 1. Run as pod inside Kubernetes cluster

Running as pod inside Kubernetes cluster is prefered for production use.

Build the memcached-operator image and push it to a registry:
```
$ operator-sdk build quay.io/example/memcached-operator:v0.0.1
Expand All @@ -114,6 +123,28 @@ NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
memcached-operator 1 1 1 1 1m
```

#### 2. Run outside the cluster

This method is prefered during development cycle to deploy and test faster.

Run the operator localy with the default kubernetes config file present at `$HOME/.kube/config`

```sh
$ operator-sdk up local
INFO[0000] Go Version: go1.10
INFO[0000] Go OS/Arch: darwin/amd64
INFO[0000] operator-sdk Version: 0.0.5+git
```

Run the operator localy with a provided kubernetes config file

```sh
$ operator-sdk up local --kubeconfig=config
INFO[0000] Go Version: go1.10
INFO[0000] Go OS/Arch: darwin/amd64
INFO[0000] operator-sdk Version: 0.0.5+git
```

### Create a Memcached CR

Modify `deploy/cr.yaml` as shown and create a `Memcached` custom resource:
Expand Down Expand Up @@ -211,4 +242,4 @@ $ kubectl delete -f deploy/operator.yaml
[go_tool]:https://golang.org/dl/
[docker_tool]:https://docs.docker.com/install/
[kubectl_tool]:https://kubernetes.io/docs/tasks/tools/install-kubectl/
[minikube_tool]:https://github.com/kubernetes/minikube#installation
[minikube_tool]:https://github.com/kubernetes/minikube#installation

0 comments on commit def5398

Please sign in to comment.