Skip to content

Commit c03bb77

Browse files
authored
fix README instructions for webpage sample (#959)
k8s/crd.yml no longer exists as the CRDs for Samples are automatically generated by the fabric8 maven plugin
1 parent 7d1ecca commit c03bb77

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

sample-operators/webpage/README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ spec:
2828
The quickest way to try the operator is to run it on your local machine, while it connects to a local or remote
2929
Kubernetes 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

3337
When 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
4246
You can also try to change the HTML code in `k8s/webpage.yaml` and do another `kubectl apply -f k8s/webpage.yaml`.
4347
This 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

4753
You can build the sample using `mvn jib:dockerBuild` this will produce a Docker image you can push to the registry
4854
of 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`
5359
2. Deploy the operator: `kubectl apply -f k8s/operator.yaml`

0 commit comments

Comments
 (0)