Skip to content

Commit e987897

Browse files
committed
improved documentation
1 parent 09f4372 commit e987897

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed

docs/DOCS.md

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,27 @@ You can read about the common problems what is this operator framework is solvin
1313
## Getting Started
1414

1515
The easiest way to get started with SDK is start [minikube](https://kubernetes.io/docs/tasks/tools/install-minikube/) and
16-
execute one of our [examples](https://github.com/ContainerSolutions/java-operator-sdk/tree/master/samples/webserver)
17-
18-
Note that you don't have to deploy the operator to a Kubernetes clusters as a pod (however you have to apply the CRD).
19-
If you run this example from you favorite IDE, it will pick up the kubeconfig (prepared by minikube) and will start
20-
processing events of custom resources immediately.
21-
16+
execute one of our [examples](https://github.com/ContainerSolutions/java-operator-sdk/tree/master/samples/mysql-schema)
17+
18+
Here are the main steps to develop the code and deploy the operator to a Kubernetes cluster. A more detailed and specific
19+
version can be found under `samples/mysql-schema/README.md`.
20+
21+
1. Setup kubectl to work with your Kubernetes cluster of choice.
22+
1. Apply Custom Resource Definition
23+
1. Compile the whole project (framework + samples) using `mvn install -P no-integration-tests` in the root directory
24+
1. Run the main class of the sample you picked and check out the sample's README to see what it does.
25+
When run locally the framework will use your Kubernetes client configuration (in ~/.kube/config) to make the connection
26+
to the cluster. This is why it was important to set up kubectl up front.
27+
1. You can work in this local development mode to play with the code.
28+
1. Build the Docker image and push it to the registry
29+
1. Apply RBAC configuration
30+
1. Apply deployment configuration
31+
1. Verify if the operator is up and running. Don't run it locally anymore to avoid conflicts in processing events from
32+
the cluster's API server.
2233

2334
## Controllers
24-
Controllers are where you implement you logic for you operator.
35+
Controllers are where you implement the business logic of the Operator. An Operator can host multiple Controllers,
36+
each handling a different type of Custom Resource. In our samples each Operator has a single Controller.
2537

2638
### Generation Awareness
2739

samples/mysql-schema/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ the [Container Registry](https://cloud.google.com/container-registry/) in Google
5050

5151
1. The following Maven command will build the jar file, package it as a Docker image and push it to the registry.
5252

53-
`mvn package dockerfile:build dockerfile:push`
53+
`mvn -P no-integration-tests package dockerfile:build dockerfile:push`
5454

5555
1. Deploy the test MySQL on your cluster if you want to use it. Note that if you have an already running MySQL server
5656
you want to use, you can skip this step, but you will have to configure the operator to use that server.

0 commit comments

Comments
 (0)