File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 28
28
The quickest way to try the operator is to run it on your local machine, while it connects to a local or remote
29
29
Kubernetes cluster. When you start it, it will use the current kubectl context on your machine to connect to the cluster.
30
30
31
- Before you run it you have to install the CRD on your cluster by running ` kubectl apply -f k8s/crd.yaml`
31
+ Before you run it you have to install the CRD on your cluster by running
32
+ ` kubectl apply -f target/classes/META-INF/fabric8/webpages.sample.javaoperatorsdk-v1.yml`.
33
+
34
+ The CRD is generated automatically from your code by simply adding the `crd-generator-apt`
35
+ dependency to your `pom.xml` file.
32
36
33
37
When the Operator is running you can create some Webserver Custom Resources. You can find a sample custom resource in
34
38
` k8s/webpage.yaml` . You can create it by running `kubectl apply -f k8s/webpage.yaml`
@@ -42,12 +46,14 @@ page. Otherwise you can change the service to a LoadBalancer (e.g on a public cl
42
46
You can also try to change the HTML code in `k8s/webpage.yaml` and do another `kubectl apply -f k8s/webpage.yaml`.
43
47
This should update the actual NGINX deployment with the new configuration.
44
48
49
+ If you want the Operator to be running as a deployment in your cluster, follow the below steps.
50
+
45
51
# ## Build
46
52
47
53
You can build the sample using `mvn jib:dockerBuild` this will produce a Docker image you can push to the registry
48
54
of your choice. The JAR file is built using your local Maven and JDK and then copied into the Docker image.
49
55
50
56
# ## Deployment
51
57
52
- 1. Deploy the CRD : ` kubectl apply -f k8s/crd.yaml `
58
+ 1. Deploy the CRD : ` kubectl apply -f target/classes/META-INF/fabric8/webpages.sample.javaoperatorsdk-v1.yml `
53
59
2. Deploy the operator : ` kubectl apply -f k8s/operator.yaml`
You can’t perform that action at this time.
0 commit comments