v1.0.0

This is the first major version release of operator-sdk, which comes with a project structure rewrite and many breaking CLI changes that are incompatible with all prior minor versions (except for Go projects, which changed in v0.19.0).

Each project type has an appropriate migration guide, which we recommend following before reading this guide:

CLI changes

The following subcommands were removed:

CommandGuidancePR(s)
operator-sdk newUse operator-sdk init#3385, #3343, #3531
operator-sdk add apiUse operator-sdk create api#3385, #3343, #3531
operator-sdk add controllerUse operator-sdk create api#3385
operator-sdk add crdUse operator-sdk create api#3547
operator-sdk buildUse make docker-build#3566
operator-sdk bundle createUse make bundle#3414
operator-sdk generate k8sUse make generate#3385
operator-sdk generate crdsUse make manifests#3385
operator-sdk generate csvUse operator-sdk generate kustomize manifests#3414
operator-sdk migrateRemoved support for hybrid operators, no migration#3385
operator-sdk print-depsRemoved, no migration#3385
operator-sdk run localUse make run#3406
operator-sdk testUse controller-runtime’s [envtest]https://book.kubebuilder.io/reference/envtest.html) framework#3409

Library changes

Subpackages of the pkg/ directory have either been removed or moved from the operator-sdk repo to the operator-lib repo.

Removed packages:

Packages that have been moved can be used by making the following changes:

  • The EnqueueRequestForAnnotation watch handler is now available in package github.com/operator-framework/operator-lib/handler

  • The GenerationChangedPredicate was refactored and moved. Rewrite it as a composite predicate like the following:

    1. import (
    2. crpredicate "sigs.k8s.io/controller-runtime/pkg/predicate"
    3. libpredicate "github.com/operator-framework/operator-lib/predicate"
    4. )
    5. ...
    6. crpredicate.Or(
    7. crpredicate.GenerationChangedPredicate{},
    8. libpredicate.NoGenerationPredicate{},
    9. )
  • The leader-for-life leader election library at pkg/leader was moved to github.com/operator-framework/operator-lib/leader.

  • The pkg/status library with status conditions helpers was moved to github.com/operator-framework/operator-lib/status.

See the following PRs for details:

Upgrade your project from version “2” to “3-alpha”

The SDK’s default Go plugin no longer supports OLM- or scorecard-related project files nor writes a plugins PROJECT field for projects scaffolded previously with operator-sdk init --project-version=2, Please migrate to project version “3-alpha” for support of these features by adding the following to your PROJECT file:

  1. version: "3-alpha" # Updated from "2"
  2. projectName: <output of "$(basename $(pwd))">
  3. layout: go.kubebuilder.io/v2
  4. plugins:
  5. go.sdk.operatorframework.io/v2-alpha: {}

See #3438 and #3697 for more details.

Add the samples scaffold marker to your config/samples/kustomization.yaml

Add the +kubebuilder:scaffold:manifestskustomizesamples to your config/samples/kustomization.yaml file like so (using an example sample file):

  1. resources:
  2. - cache_v1alpha1_memcached.yaml
  3. # +kubebuilder:scaffold:manifestskustomizesamples

See #3645 for more details.

Update your Makefile’s bundle recipe to inject an operator image tag.

Make the following update to your Makefile’s bundle recipe, which will allow you to set make bundle IMG=<tag>:

  1. bundle:
  2. ...
  3. operator-sdk generate kustomize manifests -q
  4. cd config/manager && $(KUSTOMIZE) edit set image controller=$(IMG) # Add this line
  5. ...

See #3634 for more details.

Update usage of operator-sdk cleanup

The operator-sdk cleanup packagemanifests command has been removed and replaced with a simpler operator-sdk cleanup command.

Update usages of operator-sdk cleanup packagemanifests to use operator-sdk cleanup <packageName>.

The value for <packageName> can be found in the *.package.yaml file in the root of your packagemanifests folder. It is typically your project name.

See #3644 for more details.

Remove olm-namespace flag from operator-sdk olm install command

The olm-namespace flag has been removed from operator-sdk olm install command, as the olm manifests published in github have a hardcoded namespace value. Hence, the olm operators can only be installed in olm namespace using this command.

See #3670 for more details.

Docker images for s390x are no longer created automatically

If you require an s390x image for a particular release, please open an issue in the operator-sdk GitHub project, and the maintainers will manually build and push an s390x image for supported versions

See #3710 for more details.

Default install mode for run packagemanifests changed from OwnNamespace to AllNamespaces

By default all operators are scaffolded to run at the cluster scope and watch all namespaces. However, if you are relying on the default behavior of the run packagemanifests command to use the default OwnNamespace install mode, you must now specify it explicitly with --install-mode=OwnNamespace.

See #3663 for more details.

Use new logging flags when running the Ansible and Helm operators

The Ansible and Helm operators now use controller-runtime’s zap package to define logging flags.

The --zap-sample and --zap-time-encoding flag have been removed since they are not present in controller-runtime’s flagset. These flags are no longer supported.

The --zap-level flag is called --zap-log-level now. Rename any usage of --zap-level to --zap-log-level

See #3596 for more details.

Core Ansible and Helm operator logic moved to <ansible-operator|helm-operator> run subcommand

If you are using the ansible-operator and helm-operator binaries directly, update your usage to call ansible-operator run and helm-operator run (e.g. in your Makefile’s make run target).

If you are using the base image and you are not overriding the operator entrypoint, no change is necessary because the base image has been updated to call the run subcommand by default.

See #3596 for more details.

Rename --update-crds flag to --update-objects in generate packagemanifests invocations

This flag has been renamed to account for all objects that can be written to the package directory, ex. Roles.

See #3610 for more details.

Update scorecard API Go import paths

The scorecard v1alpha3 API has been moved to a separate repo. Update your Go import paths:

Old:

  1. import "github.com/operator-framework/operator-framework/pkg/apis/scorecard/v1alpha3"

New:

  1. import "github.com/operator-framework/api/pkg/apis/scorecard/v1alpha3"

See #3622 for more details.

Package version is no longer public

It is no longer possible to import package version. To determine the version of operator-sdk, run operator-sdk version.

See #3617 for more details.

Remove --operator-name from scripts

The --operator-name flag has been removed from generate bundle and generate packagemanifests subcommands. Remove this flag from your scripts, and make sure the projectName key is set in your PROJECT file. If this key is not set, the current working directory’s base name will be used.

See #3530 for more details.

Create resources manually that were passed to run packagemanifests --include-paths

The run packagemanifests subcommand no longer has the --include-paths flag to create additional resources. Instead, use kubectl apply -f <paths> before invoking run packagemanifests.

See #3599 for more details.

Change the run packagemanifests flag --operator-version to --version

--operator-version is now --version.

See #3599 for more details.

Remove --olm-namespace from run packagemanifests invocations

OLM namespace is no longer required by this command.

See #3601 for more details.

Change the run packagemanifests flag --operator-namespace to --namespace

--operator-namespace is now --namespace.

See #3601 for more details.

pkg/log/zap is no longer a public API

Migrate to the upstream controller-runtime implementation in sigs.k8s.io/controller-runtime/pkg/log/zap.

See #3525 for more details.

Default Ansible and Helm operator metrics port has changed

To continue using port 8383, specify --metrics-addr=:8383 when you start the operator.

See #3489 and #3440 for more details.

Update references to legacy operator-sdk domain strings

Update various usages of domains in plugin keys and annotations:

  • In Kubebuilder-style projects, change the .operator-sdk.io suffix to .sdk.operatorframework.io in the PROJECT file.

  • In Ansible and Helm projects, change legacy annotation keys to new annotation keys in sample CR files in your repository.

  • In live clusters containing CRs for Ansible and Helm-based operators:

    1. Patch all existing CRs that use a legacy annotation to ADD the new equivalent annotations alongside the legacy annotations.
    2. Upgrade the operator
    3. Patch all existing CRs that used a legacy annotation to REMOVE the legacy annotations.
LocationLegacyNew
PROJECT filego.operator-sdk.iogo.sdk.operatorframework.io
Custom resourcesansible.operator-sdk/reconcile-periodansible.sdk.operatorframework.io/reconcile-period
Custom resourcesansible.operator-sdk/max-runner-artifactsansible.sdk.operatorframework.io/max-runner-artifacts
Custom resourcesansible.operator-sdk/verbosityansible.sdk.operatorframework.io/verbosity
Custom resourceshelm.operator-sdk/upgrade-forcehelm.sdk.operatorframework.io/upgrade-force

See #3527 for more details.

Hybrid Ansible and Helm operator use cases are not supported

There is no migration path that enables continued use of the Ansible-based or Helm-based operator Go libraries.

See #3560 and #3537 for more details.

Changes to Ansible and Helm configuration of max workers

  • Flag max-workers was renamed to max-concurrent-reconciles in Ansible and Helm operators. Change all usage of --max-workers to --max-concurrent-reconciles. Functionality is identical; this is just a name change to align more with controller runtime terminology.

  • The WORKERS_<Kind>_<Group> environment variable was deprecated. Change all usage of these environment variables to MAX_CONCURRENT_RECONCILES_<Kind>_<Group>.

See #3435, #3452, and #3456 for more details.

Ansible Operator meta variable renamed to ansible_operator_meta

All existing references to the meta variable in your Ansible content will no longer work. Instead, your Ansible content should reference the ansible_operator_meta variable.

Alternatively, you can use the vars keyword in your watches.yaml in order to map the new ansible_operator_meta variable to meta. Below is a sample watches.yaml that has made this change:

  1. - version: v1alpha1
  2. group: test.example.com
  3. kind: Example
  4. role: test
  5. vars:
  6. meta: '{{ ansible_operator_meta }}'

See #3562 for more details.

Migrated Ansible and Helm operators to use new Kubebuilder-style metrics

  • Replaced kube-state-metrics style metrics on port :8686 with a similar resource_created_at metric registered with the controller-runtime metrics registry

  • Replace runtime creation of the metrics Service and ServiceMonitor with deploy-time kustomize manifests

See #3466 and #3451 for more details.

Removed package pkg/k8sutil

With the transition to Kubebuilder-style projects, pkg/k8sutil is no longer used in the default scaffolding for Go operators. Migrate your project to the new Kubebuilder-style layout to remove the need for this package.

See #3475 for more details.

Removed packages pkg/kube-metrics and pkg/metrics

Remove the call to addMetrics in your main.go file and begin using the InstrumentedEnqueueRequestForObject handler when setting up controller-runtime watches for your primary CRs.

InstrumentedEnqueueRequestForObject can be imported from github.com/operator-framework/operator-lib/handler.

See #3484 for more details.

Removed package pkg/ready

Use controller-runtime‘s readyz server that supports custom http handlers. Add add a healthz.Checker (e.g. healthz.Ping) using manager.AddReadyzCheck.

See #3476 for more details.

Removed package pkg/tls

See the Kubebuilder docs on how to deploy and manage TLS certificates with cert-manager.

See #3468 for more details.

Update your scorecard config file to the new format

See the updated scorecard config documentation for details.

See #3434 and #3490 for more details.

Use scorecard instead of alpha scorecard

If you have been using operator-sdk alpha scorecard, update to use operator-sdk scorecard. If you have been using operator-sdk scorecard, migrate to the new scorecard. See the new scorecard documentation.

See #3444 for more details.

Scorecard output formatting has changed

Update any scripts interpretting the scorecard output to understand the v1alpha3.TestList format.

See the json and text format descriptions for details.

See #3427 for more details.

Last modified September 21, 2020: fix upgrade version menu (#3926) (eccc0ac2)