Project: Operator Framework (App Definition and Development / Application Definition & Image Build)
File: v1.0.0.md

title: v1.0.0 weight: 999000000 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 ). Each project type has an appropriate migration guide, which we recommend following before reading this guide: The following subcommands were removed: | Command | Guidance | PR(s) |-|-|- | `operator-sdk new` | Use `operator-sdk init` | , , | `operator-sdk add api` | Use `operator-sdk create api` | , , | `operator-sdk add controller` | Use `operator-sdk create api` | | `operator-sdk add crd` | Use `operator-sdk create api` | | `operator-sdk build` | Use `make docker-build` | | `operator-sdk bundle create` | Use `make bundle` | | `operator-sdk generate k8s` | Use `make generate` | | `operator-sdk generate crds` | Use `make manifests` | | `operator-sdk generate csv` | Use `operator-sdk generate kustomize manifests` | | `operator-sdk migrate` | Removed support for hybrid operators, no migration | | `operator-sdk print-deps` | Removed, no migration | | `operator-sdk run local` | Use `make run` | | `operator-sdk test` | Use controller-runtime's framework | Subpackages of the `pkg/` directory have either been removed or moved from the `operator-sdk` repo to the . 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: ```go import ( crpredicate "sigs.k8s.io/controller-runtime/pkg/predicate" libpredicate "github.com/operator-framework/operator-lib/predicate" ) ... crpredicate.Or( crpredicate.GenerationChangedPredicate{}, libpredicate.NoGenerationPredicate{}, ) ``` 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: 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: ```yaml version: "3-alpha" # Updated from "2" projectName: <output of "$(basename $(pwd))"> layout: go.kubebuilder.io/v2 plugins: go.sdk.operatorframework.io/v2-alpha: {} ``` See and for more details. Add the `+kubebuilder:scaffold:manifestskustomizesamples` to your `config/samples/kustomization.yaml` file like so (using an example sample file): ```yaml resources: cachev1alpha1memcached.yaml ``` See for more details. Make the following update to your Makefile's `bundle` recipe, which will allow you to set `make bundle IMG=<tag>`: ```make bundle: ... operator-sdk generate kustomize manifests -q cd config/manager && $(KUSTOMIZE) edit set image controller=$(IMG) # Add this line ... ``` See for more details. 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

See for more details. 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 for more details. 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 for more details. 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 for more details. 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 for more details. 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 for more details. This flag has been renamed to account for all objects that can be written to the package directory, ex. Roles. See for more details. The scorecard v1alpha3 API has been moved to a separate repo. Update your Go import paths: Old: ```go import "github.com/operator-framework/operator-framework/pkg/apis/scorecard/v1alpha3" ``` New: ```go import "github.com/operator-framework/api/pkg/apis/scorecard/v1alpha3" ``` See for more details. It is no longer possible to import package `version`. To determine the version of operator-sdk, run `operator-sdk version`. See for more details. 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 for more details. 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 for more details. `--operator-version` is now `--version`. See for more details. OLM namespace is no longer required by this command. See for more details. `--operator-namespace` is now `--namespace`. See for more details. Migrate to the upstream controller-runtime implementation in . See for more details. To continue using port 8383, specify `--metrics-bind-address=:8383` when you start the operator. See and for more details. Update various usages of domains in plugin keys and annotations: In Kubebuilder-style projects, change the `.operator-sdk.io` suffix to

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: Patch all existing CRs that use a legacy annotation to ADD the new equivalent annotations alongside the legacy annotations. Upgrade the operator Patch all existing CRs that used a legacy annotation to REMOVE the legacy annotations. | Location | Legacy | New | |||| | `PROJECT` file | `go.operator-sdk.io` | `go.sdk.operatorframework.io` | | Custom resources | `ansible.operator-sdk/reconcile-period` | `ansible.sdk.operatorframework.io/reconcile-period` | | Custom resources | `ansible.operator-sdk/max-runner-artifacts` | `ansible.sdk.operatorframework.io/max-runner-artifacts` | | Custom resources | `ansible.operator-sdk/verbosity` | `ansible.sdk.operatorframework.io/verbosity` | | Custom resources | `helm.operator-sdk/upgrade-force` | `helm.sdk.operatorframework.io/upgrade-force` | See for more details. There is no migration path that enables continued use of the Ansible-based or Helm-based operator Go libraries. See and for more details. 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 `MAXCONCURRENTRECONCILES<Kind><Group>`. See , , and for more details. All existing references to the `meta` variable in your Ansible content will no longer work. Instead, your Ansible content should reference the `ansibleoperatormeta` variable. Alternatively, you can use the `vars` keyword in your `watches.yaml` in order to map the new `ansibleoperatormeta` variable to `meta`. Below is a sample `watches.yaml` that has made this change: ```yaml version: v1alpha1 group: test.example.com kind: Example role: test vars: meta: '{{ ansibleoperatormeta }}' ``` See for more details. Replaced kube-state-metrics style metrics on port `:8686` with a similar `resourcecreatedat` metric registered with the controller-runtime metrics registry Replace runtime creation of the metrics `Service` and `ServiceMonitor` with deploy-time kustomize manifests See and for more details. 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 for more details. 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 for more details. Use `controller-runtime`'s readyz server that supports custom http handlers. Add a `healthz.Checker` (e.g. [`healthz.Ping`]( https://github.com/kubernetes-sigs/controller-runtime/blob/229c3c357d9e6b07c3d6774010c35161a82b08f9/pkg/healthz/healthz.go#L187-L188)) using . See for more details. See the on how to deploy and manage TLS certificates with cert-manager. See for more details. See the updated scorecard for details. _See and for more details._ 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 . See for more details. Update any scripts interpretting the scorecard output to understand the `v1alpha3.TestList` format. See the and format descriptions for details. See for more details.