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
-
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 fromsrc/main/resources/deployment/<OWNER_ID>/_common-env/. Keep installation-specific endpoints, tuning values, and credentials out of both folders. -
If the bundle needs to include a secret, encrypt the sensitive values in a separate step. Put each encrypted value in the source
.propertiesfile asENC(<CIPHERTEXT>). Bundling preserves encryption but does not encrypt plaintext. -
In a Maven flow project with the
deploy-flowsMaven profile, run the SDK Deployerbundlecommand. Replacegridoswith your build organization ID andtestwith the environment folder name. The Deployer leaves out flows whoseownerIddoesn’t matchowner-id.mvn clean compile -P deploy-flows -D owner-id=gridos -D environment=test -D command=bundleThe command writes a ZIP under
target/without deploying to Connect. It uses-D environmentto select the build environment. The ZIP includes the selected Connect Secrets undersecrets/in that environment folder. Anyflowconfig/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.environmentto 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.
-
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,lsprints:flow-access.properties flows resources
-
Inspect each JSON flow spec in the extracted
flows/directory withjqor a text editor. This command usesinspect_dirfrom the previous step to open the flow spec from theecho-apiwalkthrough:jq . "$inspect_dir/deployment/gridos/test/flows/echo-api.json"In
echo-api.json, find theprocessorsarray. The processor that sends the HTTP request has"id": "backend-request". Itspropertiesarray 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
propertiesarray. 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
propertiesarray, look for service URLs, hostnames, or IP addresses tied to one installation. For example, ifaddresson thebackend-requestprocessor pointed tohttps://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-apiexample useshttps://backend.example/echoin the source. Setecho-api.processors.backend-request.addressto the actual URL in each installation’s ConfigMap.Capacity and timeouts. At the top level of the flow spec, look at settings such as
maxNumberOfInFlightMessagesandmaxBufferSize. Look for settings such asreceiveTimeoutMillisin each processor’spropertiesarray. 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
Authorizationheader. Anyone with the ZIP can read plaintext credentials.Remove the credential from the source. For the
backend-requestprocessor, keepauthenticationConfigKeyset toecho-backend. Supply the actual credentials in a Kubernetes Secret withsecretKey: echo-backendand reference it withconnectSecretsRefs. -
If you see a
secrets/directory next toflows/, open each.propertiesfile insecrets/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.propertiesfrom the source environment folder or_common-envand 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, replaceapiKeyValue=example-plaintext-tokenin the source file withapiKeyValue=ENC(<CIPHERTEXT>). At deployment time, supply the matching key in a Kubernetes Secret referenced bydecryptionKeySecretRef.
-
-
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.
-
Copy the verified ZIP to the directory where you’ll run
docker build. For example, after a clean build forgridos/test, run this from the flow project:cp target/flow-deployment-gridos-test-*.zip connect-deployment-bundle.zip -
Create a
Dockerfile. Replace the example base image reference with the approvedcurlimage and version for your build. Keep the ZIP filename and destination path as shown:DockerfileFROM curlimages/curl:<version> COPY --chmod=644 connect-deployment-bundle.zip /connect-deployment-bundle.zipCOPY --chmodrequires BuildKit. -
Build and tag the image with a new release version. Replace
registry.example.com/echo-api-bundle:1.4.0with your registry, repository, and release tag:docker build -t registry.example.com/echo-api-bundle:1.4.0 . -
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 -
Record the image’s SHA-256 identifier (its digest) from the
docker pushoutput. Look fordigest: 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.0The output includes a
Digest:line like:Digest: sha256:<64 hex characters>
Use the full value from the
Digest:line, including thesha256:prefix, after@inbundleImage: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.
-
Choose a ConfigMap name for the release. Replace
echo-api-bundle-1-4-0with that name,foundation-env-defaultwith the target namespace, and./connect-deployment-bundle.zipwith your local ZIP path. Use the deployment set’s namespace unless you plan to specify a different watched namespace inbundleConfigMapRef. -
Generate and save the manifest. Keep the watch label and the data key
connect-deployment-bundle.zipas 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.yamlThe ZIP is stored in
binaryDataunderconnect-deployment-bundle.zip. -
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
-
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.
-
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.
-
Prepare the target configuration. For image delivery, set
bundleImageto 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. -
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.
Next: Configure and Deploy Bundles.