1 Star 0 Fork 0

KIE / kogito-serverless-operator-mirror

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
README.md 4.34 KB
一键复制 编辑 原始数据 按行查看 历史

Kogito Serverless Operator

The Kogito Serverless Operator is built in order to help the Kogito Serverless users to build and deploy easily on Kubernetes/Knative/OpenShift a service based on Kogito that it will be able to execute a workflow.

The CustomResources defined and managed by this operator are the following:

  • Workflow
  • Platform
  • Build`

Getting Started

You’ll need a Kubernetes cluster to run against. You can use

to get a local cluster for testing, or run against a remote cluster. Note: Your controller will automatically use the current context in your kubeconfig file (i.e. whatever cluster kubectl cluster-info shows).

Running on the cluster

  1. Install Instances of Custom Resources:
kubectl apply -f config/samples/
  1. Build and push your image to the location specified by IMG:
make docker-build docker-push IMG=<some-registry>/kogito-serverless-operator:tag
  1. Deploy the controller to the cluster with the image specified by IMG:
make deploy IMG=<some-registry>/kogito-serverless-operator:tag

Uninstall CRDs

To delete the CRDs from the cluster:

make uninstall

Undeploy controller

UnDeploy the controller to the cluster:

make undeploy

Test the Greeting workflow on Minikube

A good starting point to check that everything is working well, it is the Greeting workflow.

Follow these steps to create a container that you can than deploy as a Service on Kubernetes or KNative.

  1. Start Minikube
minikube start --cpus 4 --memory 4096 --addons registry --insecure-registry "10.0.0.0/24"
  1. Create a namespace for the building phase
kubectl create namespace kogito-builder
  1. Create a secret
kubectl create secret docker-registry regcred --docker-server=<registry_url> --docker-username=<registry_username> --docker-password=<registry_password> --docker-email=<registry_email> -n kogito-builder
  1. Build and push your image to the location specified by IMG:
make container-build container-push IMG=<some-registry>/kogito-serverless-operator:tag
  1. Deploy the controller to the cluster with the image specified by IMG:
make deploy IMG=<some-registry>/kogito-serverless-operator:tag
  1. Create a dedicated Namespace for the test:
kubectl create namespace greeting-workflow
  1. Install Instances of Custom Resources:
kubectl apply -f config/samples/sw.kogito_v1alpha08_kogitoserverlessworkflow.yaml -n greeting-workflow
  1. Default configuration

A configmap called kogito-serverless-operator-builder-config will be created under the kogito-serverless-operator-system namespace when the Operator will be installed, and it contains:

  • DEFAULT_BUILDER_RESOURCE = kogito_builder_dockerfile.yaml
  • DEFAULT_WORKFLOW_DEXTENSION = .sw.json
  • DEFAULT_KANIKO_SECRET_DEFAULT = regcred
  • DEFAULT_REGISTRY_REPO = quay.io/kiegroup
  • kogito_builder_dockerfile.yaml = dockerfile content

For the local development the DEFAULT_REGISTRY_REPO must be changed

Test It Out

  1. Install the CRDs into the cluster:
make install
  1. Run your controller (this will run in the foreground, so switch to a new terminal if you want to leave it running):
make run

NOTE: You can also run this in one step by running: make install run

NOTE: Run make help for more information on all potential make targets

More information can be found via the Kubebuilder Documentation

Development and Contributions

Contributing is easy, just take a look at our contributors'guide.

License

Copyright 2022.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

1
https://gitee.com/kiegroup/kogito-serverless-operator-mirror.git
git@gitee.com:kiegroup/kogito-serverless-operator-mirror.git
kiegroup
kogito-serverless-operator-mirror
kogito-serverless-operator-mirror
1.30.x

搜索帮助