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 2828The quickest way to try the operator is to run it on your local machine, while it connects to a local or remote
2929Kubernetes cluster. When you start it, it will use the current kubectl context on your machine to connect to the cluster.
3030
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.
3236
3337When the Operator is running you can create some Webserver Custom Resources. You can find a sample custom resource in
3438` 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
4246You can also try to change the HTML code in `k8s/webpage.yaml` and do another `kubectl apply -f k8s/webpage.yaml`.
4347This should update the actual NGINX deployment with the new configuration.
4448
49+ If you want the Operator to be running as a deployment in your cluster, follow the below steps.
50+
4551# ## Build
4652
4753You can build the sample using `mvn jib:dockerBuild` this will produce a Docker image you can push to the registry
4854of your choice. The JAR file is built using your local Maven and JDK and then copied into the Docker image.
4955
5056# ## Deployment
5157
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 `
53592. Deploy the operator : ` kubectl apply -f k8s/operator.yaml`
You can’t perform that action at this time.
0 commit comments