liveBook · Manning

ImageStream

As explained in Quarkus in Action

An ImageStream is an OpenShift resource that provides an abstraction over container images and tracks image updates.

An ImageStream is an OpenShift resource that abstracts container images and tracks image updates. It connects image production with deployments so new builds can trigger application redeployment. section 11.3.4

An OpenShift application deployment can use ImageStreams to:

  • Represent both a base JDK image and the Inventory service image. section 11.3.4
  • Provide ImageStreamTags as BuildConfig outputs, such as inventory-service:1.0.0-SNAPSHOT. section 11.3.4
  • Notify the Deployment of image changes so a new s2i build automatically redeploys the service. section 11.3.4

Inventory service build flow

Build the JAR locally, push it to OpenShift, and let the BuildConfig create the application image. The Deployment then runs the resulting image and redeploys when its ImageStreamTag changes. section 11.3.4

Listing 11.14 Simplified version of the generated openshift.yml
---
apiVersion: v1
kind: Service
  ...
  name: inventory-service
  ...
---
apiVersion: image.openshift.io/v1
kind: ImageStream
  ...
  dockerImageRepository: registry.access.redhat.com/ubi8/openjdk-21
  ...
---
apiVersion: image.openshift.io/v1
kind: ImageStream
  ...
  name: inventory-service
  namespace: default
spec:
  dockerImageRepository: quay.io/quarkus-in-action/inventory-service
  ...

Inspect generated ImageStream definitions for the JDK base image and the Inventory service image. section 11.3.4

Listing 11.15 Continuation of the simplified generated openshift.yml
---
apiVersion: build.openshift.io/v1
kind: BuildConfig
  ...
  name: inventory-service
  namespace: default
spec:
  output:
    to:
      kind: ImageStreamTag
      name: inventory-service:1.0.0-SNAPSHOT
  source:
    binary: {}
  strategy:
    sourceStrategy:
      from:
        kind: ImageStreamTag
        name: openjdk-21:1.20
---
apiVersion: apps/v1
kind: Deployment
  ...
  name: inventory-service
  namespace: default
spec:
  ...
    spec:
      containers:
        ...
            - name: JAVA_APP_JAR
              value: /deployments/quarkus-run.jar
          image: quay.io/quarkus-in-action/inventory-service:1.0.0
          imagePullPolicy: Always

Inspect how BuildConfig writes an ImageStreamTag and how the Deployment consumes the service image. section 11.3.4

How Quarkus in Action covers it

How deep it goes
Explains the abstraction and build-to-redeployment flow, without detailing the complete resource schema.
Examples
Uses generated openshift.yml definitions for JDK and Inventory service images.
What it assumes
Assumes familiarity with OpenShift resources, container images, BuildConfig, and Deployment.
What you can do after
Operate OpenShift deployments that rebuild and redeploy services when ImageStreamTags change.
How it connects
Links container images with BuildConfig, ImageStreamTag, source-to-image builds, and Deployment.

This explainer was generated by Manning's knowledge graph from the text of Quarkus in Action. The section links point to the parts of the book it draws on.