Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Epic: rebuild the Submariner operator using current best practices #81

Closed
8 of 9 tasks
skitt opened this issue Mar 17, 2022 · 6 comments · Fixed by #105
Closed
8 of 9 tasks

Epic: rebuild the Submariner operator using current best practices #81

skitt opened this issue Mar 17, 2022 · 6 comments · Fixed by #105

Comments

@skitt
Copy link
Member

skitt commented Mar 17, 2022

Epic Description

The operator was built using an old version of the Operator SDK. This causes a number of problems:

  • our code (in particular, metrics setup) relies on an old version of the Operator framework, which is incompatible with current versions of the Kubernetes libraries
  • we’re missing out on features supported by newer versions of the SDK (such as healthchecks)

We need to upgrade our operator to use the current Operator SDK, following the migration guide.

Depends on #89

Related changes

stolostron/submariner-addon#318
submariner-io/submariner-operator#1105
submariner-io/submariner-operator#1415
submariner-io/submariner-operator#1824

Acceptance Criteria

The operator’s Operator framework dependencies are up-to-date, and all tests pass.

Definition of Done (Checklist)

  • Code complete
  • The acceptance criteria met
  • Unit/e2e test added & pass
  • CI jobs pass
  • Deployed using cloud-prepare+subctl
  • Deployed using ACM/OCM addon
  • Deploy using Helm
  • Deployed on supported platforms (for e.g kind, OCP on AWS, OCP on GCP)
  • Run subctl verify, diagnose and gather
  • [ ] Uninstall
  • [ ] Troubleshooting (gather/diagnose) added
  • [ ] Documentation added
  • [ ] Release notes added

Work Items

An operator was written from scratch following the official operator tutorial. The code was pushed on a fork as a PR. This PR was then used as a reference to make required changes.

The operator-sdk version is upgraded to 1.23.0. Migration guide was followed to pin versions for dependencies.

  1. Depends on Make APIs in-line with operator-sdk 1.21.0 submariner-operator#2158
  2. Update versions of various dependencies used
    1. Depends on Update operator-lib to 0.11.0 submariner-operator#2210
    2. Depends on Update k8s, prometheus-operator & few other version submariner-operator#2179
  3. Depends on Adjust controller logic submariner-operator#2178
  4. Depends on Update PROJECT in accordance with operator-sdk 1.23.0 submariner-operator#2211
  5. Depends on Remove use of obsolete operator-sdk submariner-operator#2204
  6. Depends on Use current operator SDK-style metrics setup submariner-operator#2199
  7. Depends on Create all CRDs before initialising the scheme submariner-operator#2180
  8. Depends on Add health and readyness probes submariner-operator#2230
  9. Update bundle in `operatorHub'(https://github.com/k8s-operatorhub/community-operators)
  10. and here? https://github.com/redhat-openshift-ecosystem/community-operators-prod/tree/main/operators
@Jaanki
Copy link
Contributor

Jaanki commented Mar 22, 2022

NOTE: if #89 is approved, it should be done first.

skitt added a commit to skitt/enhancements that referenced this issue Apr 11, 2022
This is the PR for submariner-io#81

Signed-off-by: Stephen Kitt <[email protected]>
skitt added a commit to skitt/enhancements that referenced this issue Apr 11, 2022
This is the PR for submariner-io#81

Signed-off-by: Stephen Kitt <[email protected]>
skitt added a commit to skitt/enhancements that referenced this issue Apr 11, 2022
This is the PR for submariner-io#81

Signed-off-by: Stephen Kitt <[email protected]>
skitt added a commit to skitt/enhancements that referenced this issue Apr 11, 2022
This is the PR for submariner-io#81

Signed-off-by: Stephen Kitt <[email protected]>
skitt added a commit to skitt/enhancements that referenced this issue Apr 11, 2022
This is the PR for submariner-io#81

Signed-off-by: Stephen Kitt <[email protected]>
mkolesnik pushed a commit that referenced this issue Apr 18, 2022
This is the PR for #81

Signed-off-by: Stephen Kitt <[email protected]>
@Jaanki Jaanki linked a pull request Apr 22, 2022 that will close this issue
@Jaanki Jaanki self-assigned this Apr 25, 2022
@tpantelis tpantelis self-assigned this May 2, 2022
@dfarrell07
Copy link
Member

As Andrew McNamara pointed out on Slack, this will have implications downstream that we shouldn't forget.

@arewm
Copy link

arewm commented May 12, 2022

I was about to make some changes to this in order to remove the need for a workaround for operator-framework/operator-sdk#5760, but stopped when I realized there may be additional implications of an update in one place.

One change that I was going to make was with PROJECT to have the following contents:

domain: submariner.io
repo: github.com/submariner-io/submariner-operator
projectName: submariner
layout:
- go.kubebuilder.io/v2
plugins:
  go.sdk.operatorframework.io/v2-alpha: {}
version: "3"
multigroup: true

@nyechiel
Copy link
Member

@tpantelis @Jaanki so this is no longer planned for 0.13?

@tpantelis
Copy link
Contributor

@tpantelis @Jaanki so this is no longer planned for 0.13?

No there's not enough time to get the PRs pushed and reviewed by Fri.

Jaanki added a commit to Jaanki/submariner-operator that referenced this issue Sep 6, 2022
and use the new ctrl.NewManager, which is an alias of manager.Manager to
create the manager.

Various options are defined at
https://godocs.io/sigs.k8s.io/controller-runtime/pkg/manager#Options.

Health and readyness logic is not implemented yet but are added for
future usage.

Part of epic: submariner-io/enhancements#81

Signed-off-by: Janki Chhatbar <[email protected]>
Jaanki added a commit to Jaanki/submariner-operator that referenced this issue Sep 6, 2022
and use the new ctrl.NewManager, which is an alias of manager.Manager to
create the manager.

Various options are defined at
https://godocs.io/sigs.k8s.io/controller-runtime/pkg/manager#Options.

Health and readyness logic is not implemented yet but are added for
future usage.

Part of epic: submariner-io/enhancements#81

Signed-off-by: Janki Chhatbar <[email protected]>
Jaanki added a commit to Jaanki/submariner-addon that referenced this issue Sep 7, 2022
to accommodate changes after operator-sdk upgrade.

1. api/submariner/v1alpha1 -> api/v1alpha1
2. pkg/client usage removed
3. other submariner projects are also updated.

Fixes: stolostron#481
Part of epic: submariner-io/enhancements#81

Signed-off-by: Janki Chhatbar <[email protected]>
Jaanki added a commit to Jaanki/submariner-addon that referenced this issue Sep 7, 2022
to accommodate changes after operator-sdk upgrade.

1. api/submariner/v1alpha1 -> api/v1alpha1
2. pkg/client usage removed
3. other submariner projects are also updated.

Fixes: stolostron#481
Part of epic: submariner-io/enhancements#81

Signed-off-by: Janki Chhatbar <[email protected]>
Jaanki added a commit to Jaanki/submariner-addon that referenced this issue Sep 7, 2022
to accommodate changes after operator-sdk upgrade.

1. api/submariner/v1alpha1 -> api/v1alpha1
2. pkg/client usage removed
3. other submariner projects are also updated.

Fixes: stolostron#481
Part of epic: submariner-io/enhancements#81

Signed-off-by: Janki Chhatbar <[email protected]>
Jaanki added a commit to Jaanki/submariner-operator that referenced this issue Sep 7, 2022
and use the new ctrl.NewManager, which is an alias of manager.Manager to
create the manager.

Various options are defined at
https://godocs.io/sigs.k8s.io/controller-runtime/pkg/manager#Options.

Health and readyness logic is not implemented yet but are added for
future usage.

Part of epic: submariner-io/enhancements#81

Signed-off-by: Janki Chhatbar <[email protected]>
Jaanki added a commit to Jaanki/submariner-addon that referenced this issue Sep 7, 2022
to accommodate changes after operator-sdk upgrade.

1. api/submariner/v1alpha1 -> api/v1alpha1
2. pkg/client usage removed
3. other submariner projects are also updated.

Fixes: stolostron#481
Part of epic: submariner-io/enhancements#81

Signed-off-by: Janki Chhatbar <[email protected]>
Jaanki added a commit to Jaanki/submariner-operator that referenced this issue Sep 7, 2022
and use the new ctrl.NewManager, which is an alias of manager.Manager to
create the manager.

Various options are defined at
https://godocs.io/sigs.k8s.io/controller-runtime/pkg/manager#Options.

Health and readyness logic is not implemented yet but are added for
future usage.

Part of epic: submariner-io/enhancements#81

Signed-off-by: Janki Chhatbar <[email protected]>
tpantelis pushed a commit to submariner-io/submariner-operator that referenced this issue Sep 8, 2022
and use the new ctrl.NewManager, which is an alias of manager.Manager to
create the manager.

Various options are defined at
https://godocs.io/sigs.k8s.io/controller-runtime/pkg/manager#Options.

Health and readyness logic is not implemented yet but are added for
future usage.

Part of epic: submariner-io/enhancements#81

Signed-off-by: Janki Chhatbar <[email protected]>
Jaanki added a commit to Jaanki/submariner-operator that referenced this issue Sep 12, 2022
Part of epic: submariner-io/enhancements#81

Signed-off-by: Janki Chhatbar <[email protected]>
Jaanki added a commit to Jaanki/submariner-operator that referenced this issue Sep 12, 2022
to use kubebuilder v3. This is in line with the config new operator-sdk
framework autogenerates as evident from

https://github.com/Jaanki/submariner-operator/pull/10/files#diff-d1fb402f1269ba7396dca9cbd03b44ac055874669bce1d0f239fa2f54ea3584b

This also requires updating operator-sdk and kustomize versions. Other
changes made are:

1. Install KUSTOMIZE only if it is not locally present using the install
   script provided at its repo. Remove our own provided script.
2. Install controller tools only if it is not locally present.
3. Add make targets to install kustomize, operator-sdk and controller
   tools. This will allow users to install these versions easily.
4. Don't create packagemanifests as bundle is the recommended way to
   ship the operator.

Part of epic: submariner-io/enhancements#81

Signed-off-by: Janki Chhatbar <[email protected]>
Jaanki added a commit to Jaanki/submariner-operator that referenced this issue Sep 12, 2022
to use kubebuilder v3. This is in line with the config new operator-sdk
framework autogenerates as evident from

https://github.com/Jaanki/submariner-operator/pull/10/files#diff-d1fb402f1269ba7396dca9cbd03b44ac055874669bce1d0f239fa2f54ea3584b

This also requires updating operator-sdk and kustomize versions. Other
changes made are:

1. Install KUSTOMIZE only if it is not locally present using the install
   script provided at its repo. Remove our own provided script.
2. Install controller tools only if it is not locally present.
3. Add make targets to install kustomize, operator-sdk and controller
   tools. This will allow users to install these versions easily.
4. Don't create packagemanifests as bundle is the recommended way to
   ship the operator.

Part of epic: submariner-io/enhancements#81

Signed-off-by: Janki Chhatbar <[email protected]>
Jaanki added a commit to Jaanki/submariner-operator that referenced this issue Sep 12, 2022
to use kubebuilder v3. This is in line with the config new operator-sdk
framework autogenerates as evident from

https://github.com/Jaanki/submariner-operator/pull/10/files#diff-d1fb402f1269ba7396dca9cbd03b44ac055874669bce1d0f239fa2f54ea3584b

This also requires updating operator-sdk and kustomize versions. Other
changes made are:

1. Install KUSTOMIZE only if it is not locally present using the install
   script provided at its repo. Remove our own provided script.
2. Install controller tools only if it is not locally present.
3. Add make targets to install kustomize, operator-sdk and controller
   tools. This will allow users to install these versions easily.

Part of epic: submariner-io/enhancements#81

Signed-off-by: Janki Chhatbar <[email protected]>
Jaanki added a commit to Jaanki/submariner-operator that referenced this issue Sep 12, 2022
to use kubebuilder v3. This is in line with the config new operator-sdk
framework autogenerates as evident from

https://github.com/Jaanki/submariner-operator/pull/10/files#diff-d1fb402f1269ba7396dca9cbd03b44ac055874669bce1d0f239fa2f54ea3584b

This also requires updating operator-sdk and kustomize versions. Other
changes made are:

1. Install KUSTOMIZE only if it is not locally present using the install
   script provided at its repo. Remove our own provided script.
2. Install controller tools only if it is not locally present.
3. Add make targets to install kustomize, operator-sdk and controller
   tools. This will allow users to install these versions easily.

Part of epic: submariner-io/enhancements#81

Signed-off-by: Janki Chhatbar <[email protected]>
Jaanki added a commit to Jaanki/submariner-operator that referenced this issue Sep 12, 2022
to use kubebuilder v3. This is in line with the config new operator-sdk
framework autogenerates as evident from

https://github.com/Jaanki/submariner-operator/pull/10/files#diff-d1fb402f1269ba7396dca9cbd03b44ac055874669bce1d0f239fa2f54ea3584b

This also requires updating operator-sdk and kustomize versions. Other
changes made are:

1. Install KUSTOMIZE only if it is not locally present using the install
   script provided at its repo. Remove our own provided script.
2. Install controller tools only if it is not locally present.
3. Add make targets to install kustomize, operator-sdk and controller
   tools. This will allow users to install these versions easily.
4. Don't create packagemanifests as bundle is the recommended way to
   ship the operator.

Part of epic: submariner-io/enhancements#81

Signed-off-by: Janki Chhatbar <[email protected]>
Jaanki added a commit to Jaanki/submariner-addon that referenced this issue Sep 13, 2022
to accommodate changes after operator-sdk upgrade.

1. api/submariner/v1alpha1 -> api/v1alpha1
2. pkg/client usage removed
3. other submariner projects are also updated.

Fixes: stolostron#481
Part of epic: submariner-io/enhancements#81

Signed-off-by: Janki Chhatbar <[email protected]>
Jaanki added a commit to Jaanki/submariner-operator that referenced this issue Sep 24, 2022
to use kubebuilder v3. This is in line with the config new operator-sdk
framework autogenerates as evident from

https://github.com/Jaanki/submariner-operator/pull/10/files#diff-d1fb402f1269ba7396dca9cbd03b44ac055874669bce1d0f239fa2f54ea3584b

This also requires updating operator-sdk and kustomize versions. Other
changes made are:

1. Install KUSTOMIZE only if it is not locally present using the install
   script provided at its repo. Remove our own provided script.
2. Install controller tools only if it is not locally present.
3. Add make targets to install kustomize, operator-sdk and controller
   tools. This will allow users to install these versions easily.
4. Don't create packagemanifests as bundle is the recommended way to
   ship the operator.

Part of epic: submariner-io/enhancements#81

Signed-off-by: Janki Chhatbar <[email protected]>
Jaanki added a commit to Jaanki/submariner-addon that referenced this issue Sep 24, 2022
to accommodate changes after operator-sdk upgrade.

1. api/submariner/v1alpha1 -> api/v1alpha1
2. pkg/client usage removed
3. other submariner projects are also updated.

Fixes: stolostron#481
Part of epic: submariner-io/enhancements#81

Signed-off-by: Janki Chhatbar <[email protected]>
Jaanki added a commit to Jaanki/submariner-addon that referenced this issue Sep 24, 2022
to accommodate changes after operator-sdk upgrade.

1. api/submariner/v1alpha1 -> api/v1alpha1
2. pkg/client usage removed
3. other submariner projects are also updated.

Fixes: stolostron#481
Part of epic: submariner-io/enhancements#81

Signed-off-by: Janki Chhatbar <[email protected]>
skitt pushed a commit to submariner-io/submariner-operator that referenced this issue Sep 26, 2022
to use kubebuilder v3. This is in line with the config new operator-sdk
framework autogenerates as evident from

https://github.com/Jaanki/submariner-operator/pull/10/files#diff-d1fb402f1269ba7396dca9cbd03b44ac055874669bce1d0f239fa2f54ea3584b

This also requires updating operator-sdk and kustomize versions. Other
changes made are:

1. Install KUSTOMIZE only if it is not locally present using the install
   script provided at its repo. Remove our own provided script.
2. Install controller tools only if it is not locally present.
3. Add make targets to install kustomize, operator-sdk and controller
   tools. This will allow users to install these versions easily.
4. Don't create packagemanifests as bundle is the recommended way to
   ship the operator.

Part of epic: submariner-io/enhancements#81

Signed-off-by: Janki Chhatbar <[email protected]>
Jaanki added a commit to Jaanki/submariner-operator that referenced this issue Nov 3, 2022
Jaanki added a commit to Jaanki/submariner-operator that referenced this issue Nov 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants