{"id":20695243,"url":"https://github.com/ibm-cloud-architecture/eda-kc-gitops","last_synced_at":"2026-03-07T05:07:22.460Z","repository":{"id":76529750,"uuid":"428878188","full_name":"ibm-cloud-architecture/eda-kc-gitops","owner":"ibm-cloud-architecture","description":null,"archived":false,"fork":false,"pushed_at":"2022-02-28T18:46:04.000Z","size":920,"stargazers_count":4,"open_issues_count":3,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-22T20:10:07.732Z","etag":null,"topics":["eda","gitops","kafka","mq","saga","saga-pattern"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ibm-cloud-architecture.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-11-17T02:08:06.000Z","updated_at":"2023-03-13T23:11:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"c7b08bee-e2fe-4ad2-9f25-d525764cbeb2","html_url":"https://github.com/ibm-cloud-architecture/eda-kc-gitops","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ibm-cloud-architecture/eda-kc-gitops","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibm-cloud-architecture%2Feda-kc-gitops","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibm-cloud-architecture%2Feda-kc-gitops/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibm-cloud-architecture%2Feda-kc-gitops/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibm-cloud-architecture%2Feda-kc-gitops/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ibm-cloud-architecture","download_url":"https://codeload.github.com/ibm-cloud-architecture/eda-kc-gitops/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibm-cloud-architecture%2Feda-kc-gitops/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259884469,"owners_count":22926444,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["eda","gitops","kafka","mq","saga","saga-pattern"],"created_at":"2024-11-17T00:08:35.682Z","updated_at":"2025-11-09T00:03:23.621Z","avatar_url":"https://github.com/ibm-cloud-architecture.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EDA KContainer shipment solution GitOps repository\n\nThis is the 2022 version of the [KC solution](https://ibm-cloud-architecture.github.io/refarch-kc/) GitOps. \n\nUpdated 02/25/2022. \n\nThe current update is for the SAGA pattern orchestration with MQ and Kafka for eventing. \n\nAs the implementation of the GitOps practice, this repository includes how to deploy IBM Event Streams and IBM MQ\nas well as the microservices that are part of the solution. \n\nThis project was created with [KAM CLI](https://github.com/redhat-developer/kam) and use the [eda-gitop-catalog](https://github.com/ibm-cloud-architecture/eda-gitops-catalog) for IBM cloud pak for integration operator deployment.\n\n## Gitops approach\n\nThe main approach for the gitops is described in [this note](https://ibm-cloud-architecture.github.io/refarch-eda/use-cases/gitops/#high-level-architecture-view). The figure below is to illustrate that this current repository is \n\n![](./docs/images/hl-view.png)\n\n## Saga with MQ scenario presentation\n\nThe [Saga pattern](https://ibm-cloud-architecture.github.io/refarch-eda/patterns/saga/) helps to support a long running \ntransaction that can be broken up to a collection of sub transactions that can be interleaved any way with other transactions.\n\nThe SAGA orchestration is done by the order service that sends commands to drive each SAGA participant on what to do and when. \nTo support strong consistency and exactly once delivery we are using Queues.\n\nThe Saga will be started by adding a new order, or updating major caracteristics of an existing order.\n\nThe demonstration illustrates the happy path, where each participants respond positively, so voyage and container are\nassigned to the order,\n\n![](./docs/images/saga-flow.png)\n\nand one uncomplete path, where the order will not be satisfied because of lack of refrigerator containers.\n\n![](./docs/images/compensation-flow.png)\n\nSo the compensation logic will roll back the Voyage assignment.\n\n\n## Run the solution locally\n\nYou have two options to demonstrate this solution, one running on your local laptop (using docker compose) and one running on OpenShift.\n\n### MQ Saga demonstration\n\n* Start local MQ and services\n\n```sh\ncd local-demo/mq-based\ndocker compose up -d\n```\n* The User interface to demonstrate the MQ saga is on URL [http://localhost:8089](http://localhost:8089)\n* The Swagger for Order is [http://localhost:8080](http://localhost:8080/q/swagger-ui)\n* The Swagger for Voyage is [http://localhost:8081](http://localhost:8081/q/swagger-ui)\n\nThe demonstration scenario script in [this separated note](https://ibm-cloud-architecture.github.io/refarch-eda/scenarios/saga-orchestration/#full-demo-narration).\n\n* Stop the demo\n\n```sh\ndocker compose down\n```\n\n## GitOps \n\n### How this repository was created\n\nWe used KAM CLI to create the project with the following parameters:\n\nGet Github access token, to be used in the KAM bootstrap command, in future steps.\n\n![](./docs/images/github-access-tk.png)\n\n\n```sh\nkam bootstrap \\\n--service-repo-url https://github.com/ibm-cloud-architecture/eda-kc-order-cmd-mq \\\n--gitops-repo-url  https://github.com/ibm-cloud-architecture/eda-kc-gitops \\\n--image-repo quay.io/ibmcase/ \\\n--output eda-kc-gitops \\\n--git-host-access-token \u003ca-github-token\u003e \\\n--prefix kc-mq --push-to-git=true\n```\n\n### What was added\n\n* Added a bootstrap folder to define gitops and operator declaration and to create an ArgoCD project\n* Defined a script to install IBM Catalogs and Cloud Pak for Integration components \n* Added scripts to deploy operators: `scripts/installOperators.sh`\n* Specific script to install IBM's product operators.\n\n\n### Bootstrap GitOps\n\n* You may need to install the following tools:\n\n```\nbrew install kubeseal\nbrew install jq\n```\n\n* Login to the OpenShift Console, and get login token to be able to use `oc cli`\n* If not already done, use the script to install GitOps and Pipeline operators: \n\n  ```sh\n    ./bootstrap/scripts/installGitOpsOperators.sh\n  ```\n    \n  Once the operators are running the command: `oc get pods -n openshift-gitops` should return\na list of pods like the following:\n\n  ```sh\n    NAME                                                          READY   STATUS    RESTARTS   AGE\n    openshift-gitops-application-controller-0                     1/1     Running   0          4h5m\n    openshift-gitops-applicationset-controller-6948bcf87c-jdv2x   1/1     Running   0          4h5m\n    openshift-gitops-dex-server-64cbd8d7bd-76czz                  1/1     Running   0          4h5m\n    openshift-gitops-redis-7867d74fb4-dssr2                       1/1     Running   0          4h5m\n    openshift-gitops-repo-server-6dc777c845-gdjhr                 1/1     Running   0          4h5m\n    openshift-gitops-server-7957cc47d9-cmxvw                      1/1     Running   0          4h5m\n  ```\n\n* If not done already, install IBM product catalog subscriptions, so the OpenShift Cluster can get visibility of IBM product within the OpenShift Operator Hub:\n\n  ```sh\n  ./bootstrap/scripts/installIBMCatalog.sh\n  ```\n\n* Obtain your [IBM license entitlement key](https://github.com/IBM/cloudpak-gitops/blob/main/docs/install.md#obtain-an-entitlement-key)\n* Update the [OCP global pull secret of the `openshift-operators` project](https://github.com/IBM/cloudpak-gitops/blob/main/docs/install.md#update-the-ocp-global-pull-secret)\nwith the entitlement key\n\n    ```sh\n    export KEY=\u003cyourentitlementkey\u003e\n    oc create secret docker-registry ibm-entitlement-key \\\n    --docker-username=cp \\\n    --docker-server=cp.icr.io \\\n    --namespace=openshift-operators \\\n    --docker-password=$KEY \n    ```\n    \n* Deploy IBM product Operators (Event Streams, MQ) to monitor All Namespaces \n\n  ```sh\n  ./bootstrap/scripts/installIBMOperators.sh\n  ```\n \n* Create ArgoCD project named `kc-mq`\n\n   ```sh\n   oc apply -k bootstrap/argocd-project\n   ```\n\n* To get the `admin` user's password use the following command\n\n    ```sh\n    oc extract secret/openshift-gitops-cluster -n openshift-gitops --to=-\n    ```\n\n* Get the ArgoCD User Interface URL and open a web browser\n\n   ```sh\n   chrome https://$(oc get route openshift-gitops-server -o jsonpath='{.status.ingress[].host}'  -n openshift-gitops)\n   ```\n\n\n* To start the Continuous Deployment management with ArgoCD, just executing the following command:\n\n   ```sh\n   oc apply -k config/argocd\n   ```\n\nThe expected set of ArgoCD apps looks like the following:\n\n![](./docs/images/kc-mq-argoapps.png)\n\n  * Argo-app is an app of apps\n  * dev-env is for the rt-inventory-dev namespace\n  * dev-services is for event streams and mq deployment in dev-env namespace\n  * kc-dev-eda-kc-order-cmd-mq-app: the order manager microservice deployment, using MQ for the saga\n  * kc-dev-eda-kc-order-mq-ui-app: the user interface app for demonstration\n  * kc-dev-eda-kc-reefer-ms-mq-app: the Refrigerator container, Reefer, manager microservice participant into the SAGA\n  * kc-dev-eda-kc-voyage-ms-mq-app: The Voyage (Vessel trips) manager microservice also  participant into the SAGA\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibm-cloud-architecture%2Feda-kc-gitops","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fibm-cloud-architecture%2Feda-kc-gitops","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibm-cloud-architecture%2Feda-kc-gitops/lists"}