Example: Deliver Integrations With a Product Release
Build, deploy, and upgrade echo-api on a test Connect installation. You’ll deliver the bundle in a versioned Kubernetes ConfigMap and apply it with kubectl. You don’t need Docker, a bundle image registry, or a product Helm chart.
This is a guided walkthrough with explanations. For a straight to the point description of steps, fields, and behavior, see the Deployment Operator Reference.
This example delivers echo-api with product release 1.4.0, then upgrades it to 1.5.0. The flow accepts POST /echo and sends each request to the backend for the target Connect installation. It returns the backend’s response. The bundle ships with the product. You supply the backend URL and credentials when you deploy it.
Before You Start
-
Use a Maven flow project with the
deploy-flowsMaven profile. -
Use a test Connect installation with the operator enabled and its custom resource definitions (CRDs) installed. You need access to the Connect Console and permission to apply the example resources in Kubernetes.
-
Use a backend the flow-server can reach that accepts a JSON
POSTwith Basic authentication and returns the request body. If you don’t have one, use the test backend below.
Use the namespace where Connect is installed unless your platform administrator has configured a different watched namespace for this deployment. Use your namespace, build organization ID, and environment folder name in place of foundation-env-default, gridos, and test throughout. Use the example resource names only if they’re unused. If you rename a resource, update every reference to it.
Check your Kubernetes context, then verify the CRDs and operator rollout. In the rollout command, use the namespace where Connect is installed and replace connect if your Helm release has a different name:
kubectl config current-context
kubectl get crd connectdeploymentsets.connect.gridos.com connectserviceaccounts.connect.gridos.com
kubectl rollout status deployment/connect-deploymentoperator -n foundation-env-default --timeout=2m
Build and Package Release 1.4.0
-
Save the flow as
src/main/kotlin/echoapi/EchoApi.kt. Put the@FlowDeployfunction inside a Kotlinobjectso the SDK Deployer can load it. If your project setsflow-scan-root, use a package under that root. SetownerIdto the organization you build the bundle for. The Deployer leaves out flows whoseownerIddoesn’t matchowner-idin the build command. TheapiSpecIdmust match the OpenAPI resource you package, andauthenticationConfigKeymust match thesecretKeyyou supply at deployment. The ConfigMap you apply later replaces the sample backend address:src/main/kotlin/echoapi/EchoApi.ktpackage echoapi import com.greenbird.metercloud.integration.flow.spec.FlowExchangePattern import com.greenbird.metercloud.integration.flow.spec.dsl.HttpMethod import com.greenbird.metercloud.integration.flow.spec.dsl.flowConfig import com.greenbird.utilihive.integration.deployment.flow.FlowDeploy object EchoApi { @FlowDeploy fun echoApi() = flowConfig { id = "echo-api" ownerId = "gridos" exchangePattern = FlowExchangePattern.RequestResponse restApi { id = "echo-api" apiSpecId = "OpenAPIv3:echo-api-openapi:latest" } restRequest { id = "backend-request" defaultMethod = HttpMethod.POST defaultEntityContentType = "application/json" address = "https://backend.example/echo" authenticationConfigKey = "echo-backend" } } } -
Add the two OpenAPI resource files below to
src/main/resources/deployment/gridos/test/resources/. If you change the sample resource IDecho-api-openapi, use the new ID in both filenames and inapiSpecId:echo-api-openapi.propertiestype=OpenAPIv3echo-api-openapi.json{ "openapi": "3.0.3", "info": { "title": "Echo API", "version": "1.0.0" }, "components": { "securitySchemes": { "basicAuth": { "type": "http", "scheme": "basic" } } }, "security": [{ "basicAuth": [] }], "paths": { "/echo": { "post": { "operationId": "echo", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object" } } } }, "responses": { "200": { "description": "Echoed payload", "content": { "application/json": { "schema": { "type": "object" } } } } } } } } } -
In
src/main/resources/deployment/gridos/test/flow-access.properties, grant the incoming client access.echo-callermatchesspec.userNameon theConnectServiceAccountyou’ll apply later.echo-apimatches the flow ID:flow-access.propertiesecho-caller=echo-api -
Build the bundle:
mvn clean compile -P deploy-flows -D owner-id=gridos -D environment=test -D command=bundle -
List the contents of the generated ZIP:
unzip -l target/flow-deployment-gridos-test-*.zipExample output from SDK Deployer
12.290.0. Your timestamp and file sizes may differ. The total includes directory entries:Archive: target/flow-deployment-gridos-test-2026-11-26_12-53-44.zip Length Date Time Name --------- ---------- ----- ---- 0 11-26-2026 12:53 deployment/ 0 11-26-2026 12:53 deployment/gridos/ 0 11-26-2026 12:53 deployment/gridos/test/ 0 11-26-2026 12:53 deployment/gridos/test/resources/ 215 11-26-2026 12:53 deployment/gridos/test/resources/echo-api-openapi.properties 647 11-26-2026 12:53 deployment/gridos/test/resources/echo-api-openapi.json 51 11-26-2026 12:53 deployment/gridos/test/flow-access.properties 0 11-26-2026 12:53 deployment/gridos/test/flows/ 706 11-26-2026 12:53 deployment/gridos/test/flows/echo-api.json --------- ------- 1619 9 filesCheck for these four files under
deployment/<BUILD_ORG_ID>/<ENVIRONMENT>/:File in the listing What it contains flows/echo-api.jsonThe flow spec exported from the
@FlowDeployfunction. This is the flow the Deployment Operator will deploy.resources/echo-api-openapi.jsonThe OpenAPI definition for
POST /echothat the flow’sapiSpecIdrefers to.resources/echo-api-openapi.propertiesThe resource metadata, including
type=OpenAPIv3.flow-access.propertiesThe rule
echo-caller=echo-api, which grants the caller access to the flow at deployment time.This example has no
secrets/entries. The backend credentials you supply at deployment time should not be in the bundle. Follow the bundle checks before shipping the ZIP. -
Save the ZIP in a ConfigMap manifest named for release
1.4.0. The filename pattern incpshould match only the ZIP you just built. Keep the ConfigMap data key and label as shown. Run these commands from the flow project:cp target/flow-deployment-gridos-test-*.zip connect-deployment-bundle.zip kubectl create configmap echo-api-bundle-1-4-0 -n foundation-env-default \ --from-file=connect-deployment-bundle.zip=./connect-deployment-bundle.zip \ --dry-run=client -o yaml \ | kubectl label --local -f - app.kubernetes.io/component=connect-deploymentoperator -o yaml \ > echo-api-bundle-1-4-0.yaml
Supply Installation Settings and Deploy the Bundle
-
If you have a backend, use your organization’s approved secret-management process to create the
echo-api-backendKubernetes Secret and populate it with the credentials. The flow processor’sauthenticationConfigKeytells it which secret key to look up. SetsecretKeyto that value; this example usesecho-backend. Keep the labelapp.kubernetes.io/component=connect-deploymentoperator; the operator waits for referenced Secrets and ConfigMaps to have this label. Do not commit credentials. If you don’t have a backend, run the test backend before you continue. It uses this same Secret with test-only values.Backend credentials Secret template:echo-api-backend-secret.yamlapiVersion: v1 kind: Secret metadata: name: echo-api-backend namespace: foundation-env-default labels: app.kubernetes.io/component: connect-deploymentoperator stringData: secretKey: echo-backend userName: "<BACKEND_USERNAME>" password: "<BACKEND_PASSWORD>" -
Save the settings as
echo-api-config.yaml. The example URL points to the test backend Service. If you use your own backend, replace the URL. Keep the label and override key:echo-api-config.yamlapiVersion: v1 kind: ConfigMap metadata: name: echo-api-config namespace: foundation-env-default labels: app.kubernetes.io/component: connect-deploymentoperator data: echo-api.processors.backend-request.address: http://echo-api-backend.foundation-env-default.svc:8080/echo -
Save the caller account manifest as
echo-api-client.yaml. It creates the Connect account that calls the flow. The flow access rule uses the usernameecho-caller; the operator stores its password inecho-api-client-credentials, separate fromecho-api-backend.echo-api-client.yamlapiVersion: connect.gridos.com/v1 kind: ConnectServiceAccount metadata: name: echo-api-client namespace: foundation-env-default spec: organizationId: gridos userName: echo-caller credentialsType: BasicAuthentication serviceAccountSecretRef: name: echo-api-client-credentials -
Save the deployment set as
echo-api.yaml. The flow access rule uses the usernameecho-caller. InserviceAccountRefs, use the Kubernetes resource nameecho-api-client. If the build and target organizations differ, setspec.organizationIdto the target ID in bothecho-api.yamlandecho-api-client.yaml, and set the deployment set’sspec.bundleOrgIdAliasto the build ID. Omit the alias if the IDs match.ConfigMap delivery:echo-api.yamlapiVersion: connect.gridos.com/v1 kind: ConnectDeploymentSet metadata: name: echo-api namespace: foundation-env-default spec: organizationId: gridos environment: test bundleConfigMapRef: name: echo-api-bundle-1-4-0 flowConfigConfigMapRefs: - name: echo-api-config connectSecretsRefs: - name: echo-api-backend serviceAccountRefs: - name: echo-api-client -
Apply the bundle, settings, and
echo-api-client.yamlto create the account that calls the flow. Before applyingecho-api.yaml, verify that your approved process has created the backend Secret. If you use the test backend, apply the Secret from the backend credentials Secret template with throwaway credentials as shown in Run a Test Backend. Use server-side apply for the bundle ConfigMap to avoid a second copy of the ZIP in an annotation:kubectl apply --server-side -f echo-api-bundle-1-4-0.yaml kubectl apply -f echo-api-config.yaml -f echo-api-client.yaml kubectl get secret echo-api-backend -n foundation-env-default kubectl apply -f echo-api.yaml -
Wait for the service account and deployment set to be ready. Adjust the ten-minute timeout if needed:
kubectl wait --for=condition=Ready connectserviceaccount/echo-api-client -n foundation-env-default --timeout=10m kubectl wait --for=condition=Ready connectdeploymentset/echo-api -n foundation-env-default --timeout=10m kubectl describe connectdeploymentset echo-api -n foundation-env-defaultBoth resources should have a condition with
type: Readyandstatus: "True". Expect the reasonReconciledfor the service account andDeployedfor the deployment set. If either wait fails, inspect the status and events before testing the flow.
Test the Integration
-
In the Connect Console, go to Flows, select echo-api, and check that the flow is Up. Open the Documentation tab and copy the base URL under Servers. Replace the example URL with that value, without the
/echopath:export ECHO_URL='https://api.connect.example/gridos/rs/echo-api' -
Set
ECHO_PASSWORDto the caller’s password. If your Kubernetes role permits it, read the password from the Secret named in the caller’sserviceAccountSecretRef. Otherwise, use your approved credential retrieval process:ECHO_PASSWORD=$(kubectl get secret echo-api-client-credentials -n foundation-env-default \ -o jsonpath='{.data.password}' | base64 -d) -
In the same shell, send a request as
echo-caller. If the service uses a private CA, pass its trusted CA certificate tocurlwith--cacert. Unset the password afterward:curl --fail-with-body --user "echo-caller:$ECHO_PASSWORD" \ -H 'Content-Type: application/json' --data '{"value":"Hello from echo-api"}' \ "${ECHO_URL%/}/echo" unset ECHO_PASSWORD -
Check the response. For the example request, expect
{"value":"Hello from echo-api"}. If you change the payload, check that the backend echoes the payload you sent.
Upgrade to Release 1.5.0
-
Change the flow without changing its ID or API contract. For example, set
transientFailureResponseStatuses = "429"onbackend-requestto treat HTTP 429 as transient. See Unit Tests for testing flow changes before bundling. -
Rebuild the ZIP and repeat the ConfigMap generation step with the name
echo-api-bundle-1-5-0and output fileecho-api-bundle-1-5-0.yaml. Keep the old ConfigMap so you can roll back. -
In
echo-api.yaml, changespec.bundleConfigMapRef.nametoecho-api-bundle-1-5-0. Leave the installation settings unchanged for this release. -
Apply the new bundle and updated deployment set. Check the deployment set after reconciliation:
kubectl apply --server-side -f echo-api-bundle-1-5-0.yaml kubectl apply -f echo-api.yaml kubectl describe connectdeploymentset echo-api -n foundation-env-default -
In
kubectl describe, findType: Readyunder Status → Conditions. Check that itsStatusisTrue, itsReasonisDeployed, and its Observed Generation matches Generation under Metadata. Success for an earlier generation does not confirm the upgrade.Example output for the first update to
echo-api. Both generation fields show2; compare the numbers in your own output:Metadata: Generation: 2 Status: Conditions: Message: Deployment successful Observed Generation: 2 Reason: Deployed Status: True Type: ReadySend the test request again.
The new bundle updates echo-api in place. To roll back this upgrade, change spec.bundleConfigMapRef.name back to echo-api-bundle-1-4-0, apply echo-api.yaml, and verify the deployment and flow again.
For product releases that use images and Helm, see Publish an Image and Ship the Deployment Set in a Product Helm Chart.
Run a Test Backend
Use this backend only on a test installation. The flow sends Basic authentication over internal HTTP, so use throwaway credentials. The cluster must be able to pull an approved Python 3 image, and the flow-server must be able to reach the Service on port 8080. Use an existing approved backend instead if you can’t run test workloads in the namespace.
-
For the test backend only, save the backend credentials Secret template as
echo-api-backend-secret.yaml, fill in throwaway credentials, and apply the Secret:kubectl apply -f echo-api-backend-secret.yaml -
Save the following as
echo-api-test-backend.yaml. Replace the Python image with one approved for your cluster if needed. If you changed the namespace, update the backend URL inecho-api-config.yamlto match:echo-api-test-backend.yamlapiVersion: apps/v1 kind: Deployment metadata: name: echo-api-backend namespace: foundation-env-default spec: replicas: 1 selector: matchLabels: app.kubernetes.io/name: echo-api-backend template: metadata: labels: app.kubernetes.io/name: echo-api-backend spec: containers: - name: echo image: python:3.13-slim securityContext: runAsNonRoot: true runAsUser: 10001 allowPrivilegeEscalation: false capabilities: drop: [ALL] seccompProfile: type: RuntimeDefault ports: - name: http containerPort: 8080 readinessProbe: tcpSocket: port: http env: - name: ECHO_USER valueFrom: secretKeyRef: name: echo-api-backend key: userName - name: ECHO_PASSWORD valueFrom: secretKeyRef: name: echo-api-backend key: password command: [python, -u, -c] args: - | import base64 import hmac import os from http.server import BaseHTTPRequestHandler, HTTPServer credentials = f"{os.environ['ECHO_USER']}:{os.environ['ECHO_PASSWORD']}" auth = b"Basic " + base64.b64encode(credentials.encode()) class Echo(BaseHTTPRequestHandler): def do_POST(self): if self.path != "/echo": self.send_error(404) return if not hmac.compare_digest(self.headers.get("Authorization", "").encode(), auth): self.send_response(401) self.send_header("WWW-Authenticate", 'Basic realm="echo"') self.end_headers() return payload = self.rfile.read(int(self.headers.get("Content-Length", 0))) self.send_response(200) self.send_header("Content-Type", "application/json") self.send_header("Content-Length", str(len(payload))) self.end_headers() self.wfile.write(payload) HTTPServer(("0.0.0.0", 8080), Echo).serve_forever() --- apiVersion: v1 kind: Service metadata: name: echo-api-backend namespace: foundation-env-default spec: selector: app.kubernetes.io/name: echo-api-backend ports: - name: http port: 8080 targetPort: http -
Apply the backend and wait for it to be ready before deploying the flow:
kubectl apply -f echo-api-test-backend.yaml kubectl rollout status deployment/echo-api-backend -n foundation-env-default --timeout=2m
After the walkthrough, retire the example deployment, then remove the test backend:
kubectl delete -f echo-api-test-backend.yaml
If you no longer need the test Secret, delete it separately:
kubectl delete -f echo-api-backend-secret.yaml