Skip to content

Extending progressive release to other deployment environments

The Iter8 release chart can be easily extended for applications/ML models composed of new types. We briefly describe how to extend the chart for an Knative application.

Approach

The release chart can be found in the charts/release sub-folder of the Iter8 GitHub repository. The file release.yaml is the starting point. For each valid environment, the chart contains a set of files defining the resources that should be created. These may include:

  • application object(s)
  • routemaps for different traffic patterns
  • configmaps used to specify request percentages
  • a service defining a common entry for requests (if needed)

Note that the file naming helps identify related template files.

Example (Knative Service)

For example, to implement a blue-green release for Knative services, the following files could be added.

  • _knative-istio.tpl - wrapper for all objects that should be deployed
  • _knative-istio.version.ksvc.tpl - the Knative service object that should be deployed for a version
  • _knative-istio.blue-green.tpl - wrapper for all objects that should be deployed to support the blue-green traffic pattern
  • _knative-istio.blue-green.routemap.tpl - the routemap definition
  • _knative-istio.service.tpl - a supporting external service
  • _knative.helpers.tpl - supporting functions

An implementation of these is here.

Note that this sample only implements the blue-green traffic pattern. A more complete implementation would include canary and mirroring traffic patterns.

Finally, update release.yaml to include knative-istio as a valid option:

{{- else if eq "knative-istio" .Values.environment }}
  {{- include "env.knative-istio" . }}

Extend the controller

The Iter8 controller will need to be restarted with permission to watch Knative service objects. Re-install the controller using the following additional options:

--set resourceTypes.ksvc.Group=serving.knative.dev \
--set resourceTypes.ksvc.Version=v1 \
--set resourceTypes.ksvc.Resource=services \
--set "resourceTypes.ksvc.conditions[0]=Ready"

Using the modified chart

Reference the location of the local copy of the chart instead of using the --repo and --version options. For example assuming the location is $CHART, a deployment of two versions of the Knative hello service with a 30-70 traffic split would be:

cat <<EOF | helm upgrade --install hello $CHART -f -
environment: knative-istio
application:
  versions:
  - ksvcSpecification:
      spec:
        template:
          spec:
            containers:
            - image: ghcr.io/knative/helloworld-go:latest
              ports:
              - containerPort: 80
              env:
              - name: TARGET
                value: "v1"
    weight: 30
  - ksvcSpecification:
      spec:
        template:
          spec:
            containers:
            - image: ghcr.io/knative/helloworld-go:latest
              ports:
              - containerPort: 80
              env:
              - name: TARGET
                value: "v2"
    weight: 70
  strategy: blue-green
EOF

Contribute your extensions

Please consider contributing any extensions to Iter8 by submitting a pull request.