- A reusable DeploymentConfig template
- Common validation errors and fixes
- How ImageStream tags and DeploymentConfig triggers work
- A simple end-to-end test using a code change that triggers build → image → deployment
Quick overview
- DeploymentConfig manages application lifecycle in OpenShift (rolling updates, triggers, scaling).
ConfigChangetriggers a deployment when the DeploymentConfig spec changes.ImageChangetriggers a deployment when the referenced ImageStreamTag is updated (for example, after a build pushes a new image).
Example: initial DeploymentConfig used during testing
For a typical test deployment I used a minimal configuration (replicas set to1):
Important: ImageStreamTag format
When importing this YAML into the OpenShift web console (Add to Project → Import YAML or JSON), OpenShift validates the manifest and returns errors for invalid fields. In my case the server returned:imageChangeParams.from.name must include an explicit tag (for example :latest). Update from.name to an ImageStream tag in the form name:tag to satisfy validation.
Here is the corrected DeploymentConfig — note the change to from.name: "simple-webapp-docker:latest":
Always specify ImageStream tags in the format
name:tag (for example my-app:latest) when using ImageStreamTag in DeploymentConfig triggers. If you omit the tag, validation will fail.Triggers — quick reference
Example snippet for
ImageChange in a DeploymentConfig:
End-to-end flow recap
- Your build configuration produces a new image and updates an ImageStream tag (for example,
simple-webapp-docker:latest). - The
ImageChangetrigger on the DeploymentConfig watches that ImageStream tag. - When the tag updates, OpenShift automatically starts a new deployment using the updated image.
Example Flask change (triggers a build if your build config reacts to source changes)
Exposing the application externally
Note: This lesson does not expose the application to external traffic. To make your app reachable from outside the cluster, create a Service and a Route (or configure an Ingress depending on your cluster setup). See the OpenShift documentation for examples and best practices.If you expose your application externally, ensure proper network policies, TLS, and authentication are in place for production workloads. Misconfigured routes or unsecured services can expose sensitive data.
Quick troubleshooting checklist
- If you see validation errors for
imageChangeParams.from.name— ensure it isname:tag(for examplemy-app:latest). - If automatic deployments do not trigger after a build:
- Confirm the build updated the ImageStream tag you referenced.
- Confirm the DeploymentConfig
ImageChangetrigger references the same ImageStreamTag. - Check build logs and the ImageStream tags with
oc get isandoc describe is/<name>.
Links and references
- OpenShift DeploymentConfig documentation
- OpenShift ImageStreams and image change triggers
- Kubernetes Resources reference