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 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

  1. Save the flow as src/main/kotlin/echoapi/EchoApi.kt. Put the @FlowDeploy function inside a Kotlin object so the SDK Deployer can load it. If your project sets flow-scan-root, use a package under that root. Set ownerId to the organization you build the bundle for. The Deployer leaves out flows whose ownerId doesn’t match owner-id in the build command. The apiSpecId must match the OpenAPI resource you package, and authenticationConfigKey must match the secretKey you supply at deployment. The ConfigMap you apply later replaces the sample backend address:

    src/main/kotlin/echoapi/EchoApi.kt
    package 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"
            }
        }
    }
  2. Add the two OpenAPI resource files below to src/main/resources/deployment/gridos/test/resources/. If you change the sample resource ID echo-api-openapi, use the new ID in both filenames and in apiSpecId:

    echo-api-openapi.properties
    type=OpenAPIv3
    echo-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" } } }
              }
            }
          }
        }
      }
    }
  3. In src/main/resources/deployment/gridos/test/flow-access.properties, grant the incoming client access. echo-caller matches spec.userName on the ConnectServiceAccount you’ll apply later. echo-api matches the flow ID:

    flow-access.properties
    echo-caller=echo-api
  4. Build the bundle:

    mvn clean compile -P deploy-flows -D owner-id=gridos -D environment=test -D command=bundle
  5. List the contents of the generated ZIP:

    unzip -l target/flow-deployment-gridos-test-*.zip

    Example 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 files

    Check for these four files under deployment/<BUILD_ORG_ID>/<ENVIRONMENT>/:

    File in the listing What it contains

    flows/echo-api.json

    The flow spec exported from the @FlowDeploy function. This is the flow the Deployment Operator will deploy.

    resources/echo-api-openapi.json

    The OpenAPI definition for POST /echo that the flow’s apiSpecId refers to.

    resources/echo-api-openapi.properties

    The resource metadata, including type=OpenAPIv3.

    flow-access.properties

    The 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.

  6. Save the ZIP in a ConfigMap manifest named for release 1.4.0. The filename pattern in cp should 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

  1. If you have a backend, use your organization’s approved secret-management process to create the echo-api-backend Kubernetes Secret and populate it with the credentials. The flow processor’s authenticationConfigKey tells it which secret key to look up. Set secretKey to that value; this example uses echo-backend. Keep the label app.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.yaml
    apiVersion: 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>"
  2. 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.yaml
    apiVersion: 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
  3. 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 username echo-caller; the operator stores its password in echo-api-client-credentials, separate from echo-api-backend.

    echo-api-client.yaml
    apiVersion: 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
  4. Save the deployment set as echo-api.yaml. The flow access rule uses the username echo-caller. In serviceAccountRefs, use the Kubernetes resource name echo-api-client. If the build and target organizations differ, set spec.organizationId to the target ID in both echo-api.yaml and echo-api-client.yaml, and set the deployment set’s spec.bundleOrgIdAlias to the build ID. Omit the alias if the IDs match.

    ConfigMap delivery: echo-api.yaml
    apiVersion: 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
  5. Apply the bundle, settings, and echo-api-client.yaml to create the account that calls the flow. Before applying echo-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
  6. 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-default

    Both resources should have a condition with type: Ready and status: "True". Expect the reason Reconciled for the service account and Deployed for the deployment set. If either wait fails, inspect the status and events before testing the flow.

Test the Integration

  1. 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 /echo path:

    export ECHO_URL='https://api.connect.example/gridos/rs/echo-api'
  2. Set ECHO_PASSWORD to the caller’s password. If your Kubernetes role permits it, read the password from the Secret named in the caller’s serviceAccountSecretRef. 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)
  3. In the same shell, send a request as echo-caller. If the service uses a private CA, pass its trusted CA certificate to curl with --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
  4. 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

  1. Change the flow without changing its ID or API contract. For example, set transientFailureResponseStatuses = "429" on backend-request to treat HTTP 429 as transient. See Unit Tests for testing flow changes before bundling.

  2. Rebuild the ZIP and repeat the ConfigMap generation step with the name echo-api-bundle-1-5-0 and output file echo-api-bundle-1-5-0.yaml. Keep the old ConfigMap so you can roll back.

  3. In echo-api.yaml, change spec.bundleConfigMapRef.name to echo-api-bundle-1-5-0. Leave the installation settings unchanged for this release.

  4. 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
  5. In kubectl describe, find Type: Ready under Status → Conditions. Check that its Status is True, its Reason is Deployed, 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 show 2; compare the numbers in your own output:

    Metadata:
      Generation:        2
    Status:
      Conditions:
        Message:               Deployment successful
        Observed Generation:   2
        Reason:                Deployed
        Status:                True
        Type:                  Ready

    Send 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.

  1. 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
  2. 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 in echo-api-config.yaml to match:

    echo-api-test-backend.yaml
    apiVersion: 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
  3. 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