Skip to content

fix README instructions for webpage sample #959

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions sample-operators/webpage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ spec:
The quickest way to try the operator is to run it on your local machine, while it connects to a local or remote
Kubernetes cluster. When you start it, it will use the current kubectl context on your machine to connect to the cluster.

Before you run it you have to install the CRD on your cluster by running `kubectl apply -f k8s/crd.yaml`
Before you run it you have to install the CRD on your cluster by running
`kubectl apply -f target/classes/META-INF/fabric8/webpages.sample.javaoperatorsdk-v1.yml`.

The CRD is generated automatically from your code by simply adding the `crd-generator-apt`
dependency to your `pom.xml` file.

When the Operator is running you can create some Webserver Custom Resources. You can find a sample custom resource in
`k8s/webpage.yaml`. You can create it by running `kubectl apply -f k8s/webpage.yaml`
Expand All @@ -42,12 +46,14 @@ page. Otherwise you can change the service to a LoadBalancer (e.g on a public cl
You can also try to change the HTML code in `k8s/webpage.yaml` and do another `kubectl apply -f k8s/webpage.yaml`.
This should update the actual NGINX deployment with the new configuration.

If you want the Operator to be running as a deployment in your cluster, follow the below steps.

### Build

You can build the sample using `mvn jib:dockerBuild` this will produce a Docker image you can push to the registry
of your choice. The JAR file is built using your local Maven and JDK and then copied into the Docker image.

### Deployment

1. Deploy the CRD: `kubectl apply -f k8s/crd.yaml`
1. Deploy the CRD: `kubectl apply -f target/classes/META-INF/fabric8/webpages.sample.javaoperatorsdk-v1.yml`
2. Deploy the operator: `kubectl apply -f k8s/operator.yaml`