This is a cache of https://docs.openshift.com/serverless/1.28/knative-serving/config-applications/multi-container-support-for-serving.html. It is a snapshot of the page at 2024-11-28T17:12:38.751+0000.
Multi-container support - Configuring Serverless applications | Serving | Red Hat OpenShift Serverless 1.28
×

You can deploy a multi-container pod by using a single Knative service. This method is useful for separating application responsibilities into smaller, specialized parts.

Multi-container support for Serving is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.

For more information about the support scope of Red Hat Technology Preview features, see Technology Preview Features Support Scope.

Configuring a multi-container service

Multi-container support is enabled by default. You can create a multi-container pod by specifiying multiple containers in the service.

Procedure
  1. Modify your service to include additional containers. Only one container can handle requests, so specify ports for exactly one container. Here is an example configuration with two containers:

    Multiple containers configuration
    apiVersion: serving.knative.dev/v1
    kind: service
    ...
    spec:
      template:
        spec:
          containers:
            - name: first-container (1)
              image: gcr.io/knative-samples/helloworld-go
              ports:
                - containerPort: 8080 (2)
            - name: second-container (3)
              image: gcr.io/knative-samples/helloworld-java
    1 First container configuration.
    2 Port specification for the first container.
    3 Second container configuration.