From 118dc4c57d10dbedc0471fad1f460b5fedbd9864 Mon Sep 17 00:00:00 2001 From: Yeray Borges Date: Wed, 27 Jul 2022 16:55:17 +0100 Subject: [PATCH 1/2] Clean up resources and reset to defaults --- .../wildfly-operator.clusterserviceversion.yaml | 2 +- bundle/manifests/wildfly.org_wildflyservers.yaml | 8 ++++---- config/crd/bases/wildfly.org_wildflyservers.yaml | 11 ++--------- config/manager/kustomization.yaml | 2 +- 4 files changed, 8 insertions(+), 15 deletions(-) diff --git a/bundle/manifests/wildfly-operator.clusterserviceversion.yaml b/bundle/manifests/wildfly-operator.clusterserviceversion.yaml index 62e68478..aa16a597 100644 --- a/bundle/manifests/wildfly-operator.clusterserviceversion.yaml +++ b/bundle/manifests/wildfly-operator.clusterserviceversion.yaml @@ -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: diff --git a/bundle/manifests/wildfly.org_wildflyservers.yaml b/bundle/manifests/wildfly.org_wildflyservers.yaml index b6a22069..1b35b7ca 100644 --- a/bundle/manifests/wildfly.org_wildflyservers.yaml +++ b/bundle/manifests/wildfly.org_wildflyservers.yaml @@ -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: @@ -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. @@ -584,5 +584,5 @@ status: acceptedNames: kind: "" plural: "" - conditions: [] - storedVersions: [] + conditions: null + storedVersions: null diff --git a/config/crd/bases/wildfly.org_wildflyservers.yaml b/config/crd/bases/wildfly.org_wildflyservers.yaml index af39b37e..e3617860 100644 --- a/config/crd/bases/wildfly.org_wildflyservers.yaml +++ b/config/crd/bases/wildfly.org_wildflyservers.yaml @@ -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: @@ -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. @@ -582,9 +581,3 @@ spec: specReplicasPath: .spec.replicas statusReplicasPath: .status.replicas status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/config/manager/kustomization.yaml b/config/manager/kustomization.yaml index 3587a176..88fed04c 100644 --- a/config/manager/kustomization.yaml +++ b/config/manager/kustomization.yaml @@ -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 From 2a3eddaf149f176129ce1889cc25d113b617245d Mon Sep 17 00:00:00 2001 From: Yeray Borges Date: Thu, 28 Jul 2022 09:13:22 +0100 Subject: [PATCH 2/2] Minor documentation adjustments --- README.adoc | 44 +++++++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/README.adoc b/README.adoc index 6528404e..4f4a9fdf 100644 --- a/README.adoc +++ b/README.adoc @@ -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 @@ -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 ---- @@ -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] ---- @@ -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] ---- @@ -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: @@ -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: @@ -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] ---- @@ -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.