This is a cache of https://docs.openshift.com/container-platform/4.16/operators/operator_sdk/helm/osdk-helm-updating-projects.html. It is a snapshot of the page at 2024-11-21T09:45:43.264+0000.
Updating <strong>helm</strong>-based projects - Developing Operators | Operators | OpenShift Container Platform 4.16
×

OpenShift Container Platform 4.16 supports Operator SDK 1.31.0. If you already have the 1.28.0 CLI installed on your workstation, you can update the CLI to 1.31.0 by installing the latest version.

The Red Hat-supported version of the Operator SDK CLI tool, including the related scaffolding and testing tools for Operator projects, is deprecated and is planned to be removed in a future release of OpenShift Container Platform. Red Hat will provide bug fixes and support for this feature during the current release lifecycle, but this feature will no longer receive enhancements and will be removed from future OpenShift Container Platform releases.

The Red Hat-supported version of the Operator SDK is not recommended for creating new Operator projects. Operator authors with existing Operator projects can use the version of the Operator SDK CLI tool released with OpenShift Container Platform 4.16 to maintain their projects and create Operator releases targeting newer versions of OpenShift Container Platform.

The following related base images for Operator projects are not deprecated. The runtime functionality and configuration APIs for these base images are still supported for bug fixes and for addressing CVEs.

  • The base image for Ansible-based Operator projects

  • The base image for helm-based Operator projects

For the most recent list of major functionality that has been deprecated or removed within OpenShift Container Platform, refer to the Deprecated and removed features section of the OpenShift Container Platform release notes.

For information about the unsupported, community-maintained, version of the Operator SDK, see Operator SDK (Operator Framework).

However, to ensure your existing Operator projects maintain compatibility with Operator SDK 1.31.0, update steps are required for the associated breaking changes introduced since 1.28.0. You must perform the update steps manually in any of your Operator projects that were previously created or maintained with 1.28.0.

Updating helm-based Operator projects for Operator SDK 1.31.0

The following procedure updates an existing helm-based Operator project for compatibility with 1.31.0.

Prerequisites
  • Operator SDK 1.31.0 installed

  • An Operator project created or maintained with Operator SDK 1.28.0

Procedure
  1. Edit your Operator project’s Makefile to update the Operator SDK version to v1.31.0-ocp, as shown in the following example:

    Example Makefile
    # Set the Operator SDK version to use. By default, what is installed on the system is used.
    # This is useful for CI or a project to utilize a specific version of the operator-sdk toolkit.
    OPERATOR_SDK_VERSION ?= v1.31.0-ocp
  2. Find the ose-kube-rbac-proxy pull spec in the following files, and update the image tag to v4.16:

    • config/default/manager_auth_proxy_patch.yaml

    • bundle/manifests/memcached-operator.clusterserviceversion.yaml

    Example ose-kube-rbac-proxy pull spec with v4.16 image tag
    # ...
          containers:
          - name: kube-rbac-proxy
            image: registry.redhat.io/openshift4/ose-kube-rbac-proxy:v4.16
    # ...
  3. Edit your Operator’s Dockerfile to update the helm Operator version to v4.16, as shown in the following example:

    Example Dockerfile
    FROM registry.redhat.io/openshift4/ose-helm-operator:v4.16
  4. If you use a custom service account for deployment, define the following role to require a watch operation on your secrets resource, as shown in the following example:

    Example config/rbac/role.yaml file
    apiVersion: rbac.authorization.k8s.io/v1
    kind: ClusterRoleBinding
    metadata:
      name: <operator_name>-admin
    subjects:
    - kind: ServiceAccount
      name: <operator_name>
      namespace: <operator_namespace>
    roleRef:
      kind: ClusterRole
      name: cluster-admin
      apiGroup: ""
    rules: (1)
      - apiGroups:
          - ""
        resources:
          - secrets
        verbs:
          - watch
    1 Add the rules stanza to create a watch operation for your secrets resource.