Creating a release

A Release object informs Konflux that an Application’s Snapshot is ready to be released, in accordiance with its associated ReleasePlan.

Creating a Release object

The development team creates a Release object in the developer tenant namespace. The Release object includes a reference to the application snapshot that the development team wants to release, along with release plan that will be used to release the application.

Prerequisites
  • You have an existing Development tenant namespace.

  • You have completed the steps listed in the Getting started in the CLI page.

  • You have completed the steps for creating a ReleasePlanAdmission and a matching ReleasePlan.

Procedures
  1. Create a Release.yaml object locally.

    Example Release.yaml object for a manually created release

    apiVersion: appstudio.redhat.com/v1alpha1
    kind: Release
    metadata:
     generateName: <name-of-this-release-prefix> (1)
     namespace: dev-tenant-namespace (2)
     labels:
       release.appstudio.openshift.io/automated: "false" (3)
       release.appstudio.openshift.io/author: my-userid (4)
    spec:
     releasePlan: <release-plan-name> (5)
     snapshot: <application-snapshot-name> (6)
     data: <key> (7)
    1 The prefix of the release’s name. Konflux will append a unique suffix when the Release object is created.
    2 The development team’s tenant namespace.
    3 Label indicating that the release was not automatically created by Konflux. This value must be set to "false" using quotation marks.
    4 The ID of the user who created the release. This is required for manually created releases.
    5 The name of the release plan specifying the pipeline to run.
    6 The name of the application snapshot that you want to release.
    7 Optional: An unstructured key used for providing data for the managed release Pipeline.
  2. In the development tenant namespace, create the Release object using the kubectl command line:

    $ kubectl create -f Release.yaml
Verification
  1. In the Konflux UI, select the Applications tab

  2. Click on the application that is being released

  3. Click on the Releases tab

  4. See the recent releases that have been created for the application.

  5. You can find a link to the release pipeline run by clicking on the name of the release that you created.

"Re-triggering" a Release

Release objects create workloads with a finite lifecycle. Once created, a Release object’s spec field cannot be modified. To "re-trigger" a release, create a new instance of the desired Release object using the same values in the spec field.

Creating multiple Release objects for the same snapshot can result in duplicate actions taken during the release process. Consult with the team managing the release pipeline before creating a new Release object for a given snapshot.
Procedures
  1. Create a new Release.yaml object locally, using similar values to the original Release object.

    1. Use kubectl to obtain the data of an existing Release object:

      $ kubectl get release <release-name> -n <dev-tenant-namespace> -o yaml > Release.yaml
    2. Alternatively, use kubectl-neat to remove unnecessary fields from the Release object:

      $ kubectl neat get release <release-name> -n <dev-tenant-namespace> -o yaml > Release.yaml
  2. Remove the following fields from the Release.yaml object:

    1. metadata fields:

      1. annotations

      2. creationTimestamp

      3. finalizers

      4. generation

      5. name

      6. ownerReferences

      7. resourceVersion

      8. uid

    2. status - remove entirely or set its value to {}

  3. Verify that the Release.yaml object is valid:

    Example Release.yaml object for a manually created release

    apiVersion: appstudio.redhat.com/v1alpha1
    kind: Release
    metadata:
     generateName: <name-of-this-release-prefix> (1)
     namespace: dev-tenant-namespace (2)
     labels:
       release.appstudio.openshift.io/automated: "false" (3)
       release.appstudio.openshift.io/author: my-userid (4)
    spec:
     releasePlan: <release-plan-name> (5)
     snapshot: <application-snapshot-name> (6)
     data: <key> (7)
    1 The prefix of the release’s name. Konflux will append a unique suffix when the Release object is created.
    2 The development team’s tenant namespace.
    3 Label indicating that the release was not automatically created by Konflux. This value must be set to "false" using quotation marks.
    4 The ID of the user who created the release. This is required for manually created releases.
    5 The name of the release plan specifying the pipeline to run.
    6 The name of the application snapshot that you want to release.
    7 Optional: An unstructured key used for providing data for the managed release Pipeline.
  4. Create the new Release object using the data in Release.yaml:

    $ kubectl create -f Release.yaml
Verification
  1. In the Konflux UI, select the Applications tab

  2. Click the released application

  3. Click the Releases tab

  4. View the recent releases created for the application

  5. Click the name of the release to view the results of its release pipeline