Skip to content
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

Clean up resources and reset to defaults and minor documentation changes #231

Merged
merged 2 commits into from
Aug 1, 2022
Merged
Show file tree
Hide file tree
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
44 changes: 27 additions & 17 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -275,11 +275,11 @@ $ make build

The Operator can run in two modes:

* *Local mode*: It runs the Operator as a local application running on your local computer. When using this mode, you don’t
* *Local mode*: The Operator is deployed as a local application running on your local computer. When using this mode, you don’t
need to build an Operator image. The operator becomes a local application that will be monitoring resources of your
kubernetes/OpenShift cluster.
* *Deploy mode*: Your Operator will be deployed and run in your cluster and not in your local computer. To use this mode
you need to build the Operator, push its image in a public container registry, for example, quay.io, and then deploy it
* *Deploy mode*: The Operator is deployed and runs in your cluster and not in your local computer. To use this mode
you need to build the Operator, push its image in a public container registry, for example, https://quay.io/[quay.io], and deploy it
as a regular resource on your cluster.

#### Local Mode
Expand Down Expand Up @@ -319,18 +319,19 @@ This target will download https://github.com/go-delve/delve[Delve] and will star

In this mode you need to build the Operator, push its image in a public container registry, and deploy it as a regular resource.

To build the Operator image and push it to quay.io, execute the following command:
To build the Operator image and push it to https://quay.io/[quay.io], execute the following command:

[source,shell]
----
$ make manifests docker-build docker-push IMG="quay.io/my-quay-user/wildfly-operator-dev:latest"
$ QUAYIO_USERNAME="my-quay-user"
$ make manifests docker-build docker-push IMG="quay.io/${QUAYIO_USERNAME}/wildfly-operator-dev:latest"
----

To deploy this image in your cluster and deploy the quickstart example, execute the following:

[source,shell]
----
$ make deploy IMG="quay.io/my-quay-user/wildfly-operator-dev:latest"
$ make deploy IMG="quay.io/${QUAYIO_USERNAME}/wildfly-operator-dev:latest"
$ kubectl create -f config/samples/quickstart-cr.yaml
----

Expand Down Expand Up @@ -363,7 +364,8 @@ To run the e2e tests you need to have a cluster accessible from your local machi

#### Run end-to-end (e2e) tests in local mode
This is useful for development since you don’t need to build and push the Operator image to a docker registry.
The Operator will be deployed as a local application. Execute the following to run the test suite deploying the Operator as a local application:
The Operator will be deployed as a local application. Execute the following to run the test suite deploying the Operator
as a local application:

[source,shell]
----
Expand All @@ -385,13 +387,13 @@ If you stop the execution or if a test fails, you have to clean any resource lef
$ make clean
----

Note: Transaction recovery tests will be skipped under this mode since they cannot be run outside the cluster.
Note: Transaction recovery tests will be skipped under this mode since they cannot run outside the cluster.

#### Run end-to-end (e2e) tests in Deploy Mode

In this mode, the Operator will run in Deploy Mode, so you need to have the latest Operator image available somewhere.
Before running the e2e tests. Execute the following to build and push the Operator you want to test to a public container registry, for example to
https://quay.io/[quay.io]
Before running the e2e tests. Execute the following to build and push the Operator you want to test to a public container
registry, for example to https://quay.io/[quay.io]

[source,shell]
----
Expand Down Expand Up @@ -423,9 +425,9 @@ $ make clean

### OLM installation

You can install the Operator by using OLM. This could be useful to verify how changes in the CSV will be
You can also install the Operator by using OLM. This could be useful to verify how changes in the CSV will be
applied. The following instructions describes how to prepare the Operator image, bundle and catalog to deploy the
Operator in a cluster that uses OML. The example commands use `quay.io` as container registry and OpenShift as kubernetes cluster:
Operator in a cluster that uses OML. The example commands use https://quay.io/[quay.io] as container registry and OpenShift as kubernetes cluster:

Execute the following command to build the Operator image, bundle and catalog:

Expand All @@ -438,10 +440,10 @@ BUNDLE_IMG="quay.io/${QUAYIO_USERNAME}/wildfly-operator-bundle:1.0.0" \
CATALOG_IMG="quay.io/${QUAYIO_USERNAME}/wildfly-operator-catalog:1.0.0"
----

* `manifests docker-build docker-push`: Will create your Operator image and push it to your container registry.
* `bundle bundle-build bundle-push`: Will build a bundle with the resources needed by the operator. You can
* `manifests docker-build docker-push`: Creates the Operator image and push it to your container registry.
* `bundle bundle-build bundle-push`: Builds a bundle with the resources needed by the operator. You can
modify the autogenerated CSV by looking at `bundle/manifests/` directory.
* `catalog-build catalog-push`: Will create a catalog containing the bundled Operator.
* `catalog-build catalog-push`: Creates a catalog containing the bundled Operator.

Then deploy a `CatalogSource` which contains information for accessing a repository of Operators.
When using OpenShift, the catalog source needs to be created on the `openshift-marketplace` namespace:
Expand Down Expand Up @@ -471,8 +473,8 @@ $ oc get packagemanifests | grep wildfly-operator
wildfly-operator WildFly Operator Dev 48s
----

Once the operator is recognised by OML, you can install the Operator from the OpenShift web console or, for example,
by directly adding a subscription from the command line:
Once the operator is recognised by OML, you can install the Operator from the OpenShift web console or
by the command line creating a Subscription and an OperatorGroup resource:

[source,yaml]
----
Expand All @@ -489,4 +491,12 @@ spec:
startingCSV: wildfly-operator.v1.0.0
----

[source,yaml]
----
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
name: op-group-wildfly-operator
----

The Operator will be installed on the current namespace.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ spec:
fieldPath: metadata.name
- name: OPERATOR_NAME
value: wildfly-operator
image: quay.io/yborgess/wildfly-operator-dev:latest
image: quay.io/wildfly/wildfly-operator:latest
imagePullPolicy: Always
livenessProbe:
httpGet:
Expand Down
8 changes: 4 additions & 4 deletions bundle/manifests/wildfly.org_wildflyservers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.7.0
controller-gen.kubebuilder.io/version: v0.9.0
creationTimestamp: null
name: wildflyservers.wildfly.org
spec:
Expand Down Expand Up @@ -301,7 +301,7 @@ spec:
volumeClaimTemplate:
description: VolumeClaimTemplate defines the template to store
WildFlyServer standalone data directory. The name of the template
is derived from the WildFlyServer name. The corresponding volume
is derived from the WildFlyServer name. The corresponding volume
will be mounted in ReadWriteOnce access mode. This template
should be used to specify specific Resources requirements in
the template spec.
Expand Down Expand Up @@ -584,5 +584,5 @@ status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
conditions: null
storedVersions: null
11 changes: 2 additions & 9 deletions config/crd/bases/wildfly.org_wildflyservers.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.7.0
controller-gen.kubebuilder.io/version: v0.9.0
creationTimestamp: null
name: wildflyservers.wildfly.org
spec:
Expand Down Expand Up @@ -303,7 +302,7 @@ spec:
volumeClaimTemplate:
description: VolumeClaimTemplate defines the template to store
WildFlyServer standalone data directory. The name of the template
is derived from the WildFlyServer name. The corresponding volume
is derived from the WildFlyServer name. The corresponding volume
will be mounted in ReadWriteOnce access mode. This template
should be used to specify specific Resources requirements in
the template spec.
Expand Down Expand Up @@ -582,9 +581,3 @@ spec:
specReplicasPath: .spec.replicas
statusReplicasPath: .status.replicas
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
2 changes: 1 addition & 1 deletion config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
images:
- name: controller
newName: quay.io/yborgess/wildfly-operator-dev
newName: quay.io/wildfly/wildfly-operator
newTag: latest