Build and Ship Deployment Bundles

This guide is for the release team. Build the deployment bundle in your flow project or CI pipeline and publish the exact artifact you tested. The site deployment team supplies settings for the target Connect installation when it deploys the bundle.

For a straight to the point description of steps, fields, and behavior, see the Deployment Operator Reference.

Use your build organization ID and environment folder name in place of gridos and test throughout the examples.

Build a Reusable Bundle

  1. Prepare the flow specs, resources, and flow-access definitions (which service accounts can call which flows). Put deployment files under src/main/resources/deployment/<OWNER_ID>/<ENVIRONMENT>/. The SDK Deployer also reads shared files from src/main/resources/deployment/<OWNER_ID>/_common-env/. Keep installation-specific endpoints, tuning values, and credentials out of both folders.

  2. If the bundle needs to include a secret, encrypt the sensitive values in a separate step. Put each encrypted value in the source .properties file as ENC(<CIPHERTEXT>). Bundling preserves encryption but does not encrypt plaintext.

  3. In a Maven flow project with the deploy-flows Maven profile, run the SDK Deployer bundle command. Replace gridos with your build organization ID and test with the environment folder name. The Deployer leaves out flows whose ownerId doesn’t match owner-id.

    mvn clean compile -P deploy-flows -D owner-id=gridos -D environment=test -D command=bundle

    The command writes a ZIP under target/ without deploying to Connect. It uses -D environment to select the build environment. The ZIP includes the selected Connect Secrets under secrets/ in that environment folder. Any flowconfig/ values your code uses in a flow spec become part of the exported spec. See how to read flow configuration at build time.

    At deployment time, set spec.environment to the same environment folder name.

Inspect the ZIP Before Publishing

The same bundle can be deployed to several installations. Inspect the ZIP before publishing to catch settings that belong to just one installation or credentials that were packaged by mistake.

  1. From the flow project, extract the ZIP from the clean build into a temporary directory and list the extracted environment folder. If more than one ZIP matches the pattern, use the exact ZIP path printed by the build:

    inspect_dir=$(mktemp -d)
    unzip target/flow-deployment-gridos-test-*.zip -d "$inspect_dir"
    ls -1 "$inspect_dir/deployment/gridos/test"

    For echo-api, ls prints:

    flow-access.properties
    flows
    resources
  2. Inspect each JSON flow spec in the extracted flows/ directory with jq or a text editor. This command uses inspect_dir from the previous step to open the flow spec from the echo-api walkthrough:

    jq . "$inspect_dir/deployment/gridos/test/flows/echo-api.json"

    In echo-api.json, find the processors array. The processor that sends the HTTP request has "id": "backend-request". Its properties array contains entries like this one:

    {
      "name": "address",
      "value": "https://backend.example/echo"
    }

    Read the settings at the top level of the flow spec and the entries in each processor’s properties array. The examples below show when to change a value in your source project:

    What to look for How to fix it

    Backend addresses. In each processor’s properties array, look for service URLs, hostnames, or IP addresses tied to one installation. For example, if address on the backend-request processor pointed to https://backend.installation.example/echo, another installation could send requests to the wrong backend.

    Use a shared default or a placeholder that each installation overrides. The echo-api example uses https://backend.example/echo in the source. Set echo-api.processors.backend-request.address to the actual URL in each installation’s ConfigMap.

    Capacity and timeouts. At the top level of the flow spec, look at settings such as maxNumberOfInFlightMessages and maxBufferSize. Look for settings such as receiveTimeoutMillis in each processor’s properties array. A concurrency limit chosen for a large installation can overload a smaller one. A short timeout can cut off a slower backend.

    Set shared defaults in the source. Supply values that need to vary in each installation’s ConfigMap.

    Credentials. Look through each processor’s property values for passwords, API keys, and tokens. Start with connection URLs and authentication settings. For example, look for a username and password in a URL or a bearer token in an Authorization header. Anyone with the ZIP can read plaintext credentials.

    Remove the credential from the source. For the backend-request processor, keep authenticationConfigKey set to echo-backend. Supply the actual credentials in a Kubernetes Secret with secretKey: echo-backend and reference it with connectSecretsRefs.

  3. If you see a secrets/ directory next to flows/, open each .properties file in secrets/ in a text editor. Decide whether each credential belongs to one installation or should ship with the bundle:

    • If a credential belongs to one installation, leave its secret file out of the bundle inputs even if its value is encrypted. For example, remove echo-backend.properties from the source environment folder or _common-env and supply the backend credentials in that installation’s Kubernetes Secret.

    • Follow the SDK’s Generate Encrypted Values instructions to encrypt any passwords or tokens you intend to ship. Copy the ciphertext from the Encrypted value: line. For example, replace apiKeyValue=example-plaintext-token in the source file with apiKeyValue=ENC(<CIPHERTEXT>). At deployment time, supply the matching key in a Kubernetes Secret referenced by decryptionKeySecretRef.

  4. Fix any issues in the source project. After making changes, rebuild the bundle and inspect the new ZIP. Test the bundle you intend to publish.

To reuse the same bundle across installations, build it with shared defaults or placeholders. Supply installation-specific settings and credentials at deployment time through ConfigMap and Secret references on the ConnectDeploymentSet.

Publish an Image

Use an OCI image when you already ship images with a product or the ZIP exceeds the ConfigMap limit of 1 MiB. In the container image, put the ZIP at /connect-deployment-bundle.zip and provide curl on the image’s PATH. The operator creates a bundle-fetch Job in the deployment set’s namespace and runs the container as UID 1001. Make the ZIP readable and curl executable by that user.

  1. Copy the verified ZIP to the directory where you’ll run docker build. For example, after a clean build for gridos/test, run this from the flow project:

    cp target/flow-deployment-gridos-test-*.zip connect-deployment-bundle.zip
  2. Create a Dockerfile. Replace the example base image reference with the approved curl image and version for your build. Keep the ZIP filename and destination path as shown:

    Dockerfile
    FROM curlimages/curl:<version>
    COPY --chmod=644 connect-deployment-bundle.zip /connect-deployment-bundle.zip

    COPY --chmod requires BuildKit.

  3. Build and tag the image with a new release version. Replace registry.example.com/echo-api-bundle:1.4.0 with your registry, repository, and release tag:

    docker build -t registry.example.com/echo-api-bundle:1.4.0 .
  4. Push the image to a registry the cluster can reach. Use the same image reference you used for the build:

    docker push registry.example.com/echo-api-bundle:1.4.0
  5. Record the image’s SHA-256 identifier (its digest) from the docker push output. Look for digest: sha256:<64 hex characters>.

    If you no longer have the push output, fetch the digest from the registry with this Docker command:

    docker buildx imagetools inspect registry.example.com/echo-api-bundle:1.4.0

    The output includes a Digest: line like:

    Digest:    sha256:<64 hex characters>

    Use the full value from the Digest: line, including the sha256: prefix, after @ in bundleImage:

    bundleImage: "registry.example.com/echo-api-bundle@sha256:<64 hex characters>"

Do not reuse image tags. Publishing a new image under an existing tag does not trigger a deployment. Kubernetes can reuse a cached image.

For private images or fetch Jobs outside the Connect namespace, ask a platform administrator to configure image pulls.

Deliver a ConfigMap

Use a ConfigMap for a small bundle when you do not want to deliver an image. Kubernetes limits a ConfigMap to 1 MiB of data. If the ZIP is too large, use an image or split the bundle into smaller bundles with separate deployment sets.

  1. Choose a ConfigMap name for the release. Replace echo-api-bundle-1-4-0 with that name, foundation-env-default with the target namespace, and ./connect-deployment-bundle.zip with your local ZIP path. Use the deployment set’s namespace unless you plan to specify a different watched namespace in bundleConfigMapRef.

  2. Generate and save the manifest. Keep the watch label and the data key connect-deployment-bundle.zip as shown. These commands do not change the cluster:

    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

    The ZIP is stored in binaryData under connect-deployment-bundle.zip.

  3. Deliver the manifest to the site deployment team. They apply it and reference it by name in bundleConfigMapRef. Use a new name for each release and keep the prior ConfigMap if you need to roll back.

Deliver into a Restricted IT/OT Network

  1. Build and test the bundle outside the target Connect installation’s restricted network. Record the approved image digest or ZIP checksum and prepare the deployment manifests without credentials.

  2. Use the approved route into the restricted network. For image delivery, import the image into a registry the target Kubernetes cluster can reach and verify its digest against the approved release record. For ConfigMap delivery, transfer the manifest and verify the checksum of the ZIP inside it, not the checksum of the manifest.

  3. Prepare the target configuration. For image delivery, set bundleImage to the imported image’s full reference in that registry, pinned to the verified digest. Provision credentials using the secret management process approved for the restricted network.

  4. Once the artifact and configuration are available in the restricted network, use the target cluster’s deployment tool to apply the manifests.

The target cluster does not need external registry access at deploy time. For image delivery, its Kubernetes nodes must reach the registry holding the imported image. The fetch Job must reach the operator, and the operator must reach the target installation’s identity provider and Connect Identity and Management APIs.