README
¶
Kie Cloud Operator
Requirements
- go v1.16.x
- operator-sdk v1.13.1+
Build
make
Upload to a container registry
e.g.
docker push quay.io/kiegroup/kie-cloud-operator:<version>
Deploy to OpenShift 4.5+ using OLM
To install this operator on OpenShift 4 for end-to-end testing, make sure you have access to a quay.io account to create an application repository. Follow the authentication instructions for Operator Courier to obtain an account token. This token is in the form of "basic XXXXXXXXX" and both words are required for the command.
If pushing to another quay repository, replace kiegroup with your username or other namespace. Also note that the push command does not overwrite an existing repository, and it needs to be deleted before a new version can be built and uploaded. Once the bundle has been uploaded, create an Operator Source to load your operator bundle in OpenShift.
Create your own index image
Requires opm v1.15.3+ -
USERNAME=tchughesiv
VERSION=$(go run getversion.go -csv)
IMAGE=quay.io/${USERNAME}/rhpam-operator-bundle
BUNDLE=${IMAGE}:${VERSION}
$ make bundle-dev
$ docker push ${BUNDLE}
BUNDLE_DIGEST=$(docker inspect --format='{{index .RepoDigests 0}}' ${BUNDLE})
INDEX_VERSION=v4.7
INDEX_IMAGE=quay.io/${USERNAME}/ba-operator-index:${INDEX_VERSION}
INDEX_FROM=${INDEX_IMAGE}_$(go run getversion.go -csvPrior)
INDEX_TO=${INDEX_IMAGE}_${VERSION}
$ opm index add -c docker --bundles ${BUNDLE_DIGEST} --from-index ${INDEX_FROM} --tag ${INDEX_TO}
$ docker push ${INDEX_TO}
# only run in dev env
$ oc patch operatorhub.config.openshift.io/cluster -p='{"spec":{"disableAllDefaultSources":true}}' --type=merge
$ oc apply -f - <<EOF
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
name: my-catalog
namespace: openshift-marketplace
spec:
displayName: "Dev Bundles"
publisher: "Red Hat"
sourceType: grpc
image: ${INDEX_TO}
updateStrategy:
registryPoll:
interval: 45m
EOF
It will take a few minutes for the operator to become visible under the OperatorHub section of the OpenShift console Catalog. It can be easily found by filtering the provider type to Custom.
Trigger a KieApp deployment
Use the OLM console to subscribe to the Kie Cloud
Operator Catalog Source within your namespace. Once subscribed,
use the console to Create KieApp
or create one manually as seen below.
$ oc create -f deploy/crs/v2/kieapp_rhpam_trial.yaml
kieapp.app.kiegroup.org/rhpam-trial created
Clean up a KieApp deployment
oc delete kieapp rhpam-trial
Development
Change log level at runtime w/ the DEBUG
environment variable. e.g. -
make mod
make clean
DEBUG="true" operator-sdk run local --watch-namespace <namespace>
Also at runtime, change registry for rhpam ImageStreamTags -
INSECURE=true REGISTRY=<registry url> operator-sdk run local --watch-namespace<namespace>
Before submitting PR, please be sure to generate, vet, format, and test your code. This all can be done with one command.
make test
Build rhel-based image for release
Requires cekit
v3.11 and rhpkg
-
# local build
make rhel
# scratch build
make rhel-scratch
# release candidate
make rhel-release
CSV Generation
make csv
Documentation
¶
There is no documentation for this package.
Directories
¶
Path | Synopsis |
---|---|
api
|
|
v2
Package v2 contains API Schema definitions for the app v2 API group +kubebuilder:object:generate=true +groupName=app.kiegroup.org
|
Package v2 contains API Schema definitions for the app v2 API group +kubebuilder:object:generate=true +groupName=app.kiegroup.org |
controllers
|
|
core
|
|