wmedvede commented on code in PR #565:
URL:
https://github.com/apache/incubator-kie-kogito-docs/pull/565#discussion_r1517656088
##########
serverlessworkflow/modules/ROOT/pages/cloud/operator/service-discovery.adoc:
##########
@@ -0,0 +1,96 @@
+= Kubernetes service discovery in {operator_name}
+:compat-mode!:
+// Metadata:
+:description: Explain what is and how the operator managed service discovery
works
+:keywords: sonataflow, workflow, quarkus, serverless, service-discovery,
operator, enhanced-service-discovery
+
+include::../../../pages/_common-content/service-discovery/kubernetes-service-discovery-introduction.adoc[]
+
+[IMPORTANT]
+====
+When you work with operator managed workflow deployments, there is no specific
configuration required for the Kubernetes service discovery except by using the
expected URI pattern.
+====
+
+[[kubernetes-service-discovery-resolution]]
+== Kubernetes service discovery resolution
+
+Based on the resource to be discovered, the Kubernetes service discovery
follows specific paths as shown in the following figure:
+
+image::cloud/operator/service-discovery/OperatorServiceDiscovery.jpg[]
+
+[[example-kubernetes-service-discovery]]
+== Example of Kubernetes service discovery in {operator_name}
+
+The Kubernetes service discovery is performed by the operator at workflow
deployment time.
+At this point, the operator scans the workflow configuration parameters in the
associated <<workflow_config_map, ConfigMap>>, and searches for the Kubernetes
URI pattern.
+If the URI pattern is found, the operator parses the URI, queries the
Kubernetes API searching for the given resource, and overrides the given
parameter with the resolved value by adding an entry in the corresponding
<<workflow_managed_properties_config_map, managed properties ConfigMap>>.
+
+For example, consider a workflow with the name `mortgage-workflow` that
consumes a resource running on Kubernetes to execute financial operations
implemented by the Knative Service `financial-service`.
+
+[#workflow_config_map]
+.mortgage-workflow ConfigMap Properties
+[source,yaml,subs="attributes+"]
+----
+kind: ConfigMap
+apiVersion: v1
+metadata:
+ name: mortgage-workflow-props
+ namespace: example
+ labels:
+ app: mortgage-workflow
+ sonataflow.org/workflow-app: mortgage-workflow
+data:
+ application.properties: >+
+ # service discovery configuration to resolve the financial-service
+
quarkus.rest-client.financial_service_yaml.url=${knative:services.v1.serving.knative.dev/financial-service}
+----
+
+[NOTE]
+====
+* The service discovery URI must always be included in between `${}`
+====
+
+Finally, as part of the deployment procedure the operator will create the
following `mortgage-workflow-managed-props` ConfigMap, that contains all the
configurations that are managed by the operator, including the service
discovery properties that were calculated for the configuration above.
+
+[#workflow_managed_properties_config_map]
+.mortgage-workflow-managed-props ConfigMap Properties
+[source,yaml,subs="attributes+"]
+----
+kind: ConfigMap
+apiVersion: v1
+metadata:
+ name: mortgage-workflow-managed-props
+ namespace: example
+ labels:
+ app: mortgage-workflow
+ sonataflow.org/workflow-app: mortgage-workflow
+data:
+ application-dev.properties: >
+
org.kie.kogito.addons.discovery.knative\:services.v1.serving.knative.dev\/financial-service
+ = http://financial-service.example.svc.cluster.local
+
+ quarkus.rest-client.financial_service_yaml.url =
+ http://financial-service.example.svc.cluster.local
+
+ quarkus.http.port = 8080
+
+ quarkus.http.host = 0.0.0.0
+
+ ... other operator calculated properties
+----
+
+As you can see, the service discovery URI
`${knative:services.v1.serving.knative.dev/financial-service}` was resolved to
the URL `\http://financial-service.example.svc.cluster.local`.
Review Comment:
Hi @ricardozanini , this "\" is good to escape that url from asciidoctor
generation. Othewise in the generated document well have a real link pointing
to http://financial-service.example.svc.cluster.local, not good.
##########
serverlessworkflow/modules/ROOT/pages/cloud/operator/service-discovery.adoc:
##########
@@ -0,0 +1,96 @@
+= Kubernetes service discovery in {operator_name}
+:compat-mode!:
+// Metadata:
+:description: Explain what is and how the operator managed service discovery
works
+:keywords: sonataflow, workflow, quarkus, serverless, service-discovery,
operator, enhanced-service-discovery
+
+include::../../../pages/_common-content/service-discovery/kubernetes-service-discovery-introduction.adoc[]
+
+[IMPORTANT]
+====
+When you work with operator managed workflow deployments, there is no specific
configuration required for the Kubernetes service discovery except by using the
expected URI pattern.
+====
+
+[[kubernetes-service-discovery-resolution]]
+== Kubernetes service discovery resolution
+
+Based on the resource to be discovered, the Kubernetes service discovery
follows specific paths as shown in the following figure:
+
+image::cloud/operator/service-discovery/OperatorServiceDiscovery.jpg[]
+
+[[example-kubernetes-service-discovery]]
+== Example of Kubernetes service discovery in {operator_name}
+
+The Kubernetes service discovery is performed by the operator at workflow
deployment time.
+At this point, the operator scans the workflow configuration parameters in the
associated <<workflow_config_map, ConfigMap>>, and searches for the Kubernetes
URI pattern.
+If the URI pattern is found, the operator parses the URI, queries the
Kubernetes API searching for the given resource, and overrides the given
parameter with the resolved value by adding an entry in the corresponding
<<workflow_managed_properties_config_map, managed properties ConfigMap>>.
+
+For example, consider a workflow with the name `mortgage-workflow` that
consumes a resource running on Kubernetes to execute financial operations
implemented by the Knative Service `financial-service`.
+
+[#workflow_config_map]
+.mortgage-workflow ConfigMap Properties
+[source,yaml,subs="attributes+"]
+----
+kind: ConfigMap
+apiVersion: v1
+metadata:
+ name: mortgage-workflow-props
+ namespace: example
+ labels:
+ app: mortgage-workflow
+ sonataflow.org/workflow-app: mortgage-workflow
+data:
+ application.properties: >+
+ # service discovery configuration to resolve the financial-service
+
quarkus.rest-client.financial_service_yaml.url=${knative:services.v1.serving.knative.dev/financial-service}
+----
+
+[NOTE]
+====
+* The service discovery URI must always be included in between `${}`
+====
+
+Finally, as part of the deployment procedure the operator will create the
following `mortgage-workflow-managed-props` ConfigMap, that contains all the
configurations that are managed by the operator, including the service
discovery properties that were calculated for the configuration above.
+
+[#workflow_managed_properties_config_map]
+.mortgage-workflow-managed-props ConfigMap Properties
+[source,yaml,subs="attributes+"]
+----
+kind: ConfigMap
+apiVersion: v1
+metadata:
+ name: mortgage-workflow-managed-props
+ namespace: example
+ labels:
+ app: mortgage-workflow
+ sonataflow.org/workflow-app: mortgage-workflow
+data:
+ application-dev.properties: >
+
org.kie.kogito.addons.discovery.knative\:services.v1.serving.knative.dev\/financial-service
+ = http://financial-service.example.svc.cluster.local
+
+ quarkus.rest-client.financial_service_yaml.url =
+ http://financial-service.example.svc.cluster.local
+
+ quarkus.http.port = 8080
+
+ quarkus.http.host = 0.0.0.0
+
+ ... other operator calculated properties
+----
+
+As you can see, the service discovery URI
`${knative:services.v1.serving.knative.dev/financial-service}` was resolved to
the URL `\http://financial-service.example.svc.cluster.local`.
Review Comment:
Hi @ricardozanini , this \ is good to escape that url from asciidoctor
generation. Othewise in the generated document well have a real link pointing
to http://financial-service.example.svc.cluster.local, not good.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]