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

Extract config/base plugin valid for any language/type from Golang #2015

Closed
camilamacedo86 opened this issue Feb 13, 2021 · 7 comments · Fixed by #2106
Closed

Extract config/base plugin valid for any language/type from Golang #2015

camilamacedo86 opened this issue Feb 13, 2021 · 7 comments · Fixed by #2106
Labels
kind/feature Categorizes issue or PR as related to a new feature. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Milestone

Comments

@camilamacedo86
Copy link
Member

camilamacedo86 commented Feb 13, 2021

What do you want to happen?

A plugin base which would be responsible to scaffold what is common for any kind of plugin no matter the language and what be integrated with KB and use it's as a consumer. ( basically, it is the hack and config directory since the PROJECT file is scaffold by the CLI )

It would allow the community to create any language/type plugin using the same base/config defined by KB in order to ensure its compatibility and maintainability see operator-framework/operator-sdk#2745 the requirements/problems that also could be addressed with:

  • Make SDK use the real plugin system instead of having to do “hacky” wrappers around the go.kubebuilder.io plugin. To SDK Helm/Ansible plugins it would actually mean only implement what which is specifically for its types which means that SDK project would no longer need to copy and paste the config directory boilerplates from kubebuilder in order to do the same.
  • It could allow we init hybrid operators such as; layout: config/v1,helm/v1,go/v3 which would have the init scaffold of all plugins. See: Support hybrid operators operator-framework/operator-sdk#670
  • Solve the concerns issues raised in the WIP [SDK] - Proposal to split Helm/Ansible on their repos operator-framework/enhancements#44 regarding the risks of the language plugins deviated too much from the upstream base and to keep they maintainable.

Is there currently another issue associated with this?

This issue would be a follow up of #1991 and #1941

backwords compatibility

In order to ensure the backwords compatibility if we call the init command by informing only a plugin that is not the base config, the CLI needs to scaffold the base + the config as it is done currently. E.g operator-sdk init --plugins=helm/v2 will scaffold the base+helm

@camilamacedo86 camilamacedo86 added the kind/feature Categorizes issue or PR as related to a new feature. label Feb 13, 2021
@camilamacedo86
Copy link
Member Author

Hi @Adirio,

I tracked the issue regarding the scenario that we spoke about.

wdyt @estroz @DirectXMan12

@camilamacedo86 camilamacedo86 changed the title Extract config/base plugin valid for any type from Golang Extract config/base plugin valid for any language/type from Golang Feb 13, 2021
@camilamacedo86
Copy link
Member Author

The idea proposed regarding the project has a config-gen that also might able to address these requirements. See: #1831. We probably also might able to replace the base/config with the config-gen when it is stable. c/c @pwittrock

@camilamacedo86
Copy link
Member Author

camilamacedo86 commented Feb 23, 2021

As we discussed today; before we decide to move forward with this or not we need first have a better position over #1831:

  • shows that @pwittrock like the idea of adding a sample ( e.g project-v3-config-gen in the testdata which would be == project-v3 but using config-gen for we have better clarity of how it will work, what is covered or not by it and etc)
  • my (@camilamacedo86) concerns is regarding the UX to apply customizations on the file. However, maybe config-gen also can write them in the disk instead of only allow patches.

So, it is blocked by we check out the config-gen final stage in KB to address all concerns about it first.

@camilamacedo86
Copy link
Member Author

camilamacedo86 commented Feb 27, 2021

After the controller-tool meeting, this topic was discussed with @pwittrock, @DirectXMan12 and @Adirio, where I understand that we reach a consensus that:

The config-gen(#1831) shows a great idea and has the potential to address these needs. @pwittrock idea is to add the config-gen as alpha to allow it to be tested, used and improved until it reaches the desired maturity. However, it still in the initial phase, and we cannot know how long it will take.

IMO:

Decouple the config/ dir (kustomize) as suggested here is a good strategy for we can indeed try to replace it in the golang plugins in the future by the config-gen.

We need to define if we will release 3.0.0 before or after the changes: #2043. However, after these changes, this option shows be able to be achieved with a low effort.

So, it still the best approach discussed so far to allow us to move forward, make it easier for the other tools which consume KB as lib keep their many plugins maintained, as to allow others create plugins that are compatible with SDK/KB for any language/stack or indeed which are only "wrappers" as please them and also to try to find a way to use config-gen in the future and try to keep the backwards compatibility.

@camilamacedo86
Copy link
Member Author

Just to clarify it is blocked by 1.5.

@camilamacedo86
Copy link
Member Author

camilamacedo86 commented Mar 10, 2021

Following the result of a PR made in the past to check if would be possible try to centralize the config for the language types in SDK.

PR: https://github.com/operator-framework/operator-sdk/pull/3815/files

What are the caveats?

For Ansible:

The idea here would be addressed the caveats for the languages in the language plugins. After scaffold, the default config, just runs in the ansible/helm init plugin the customs on top which are what is very specific for them. So, it would show similar to the approach that we might need to address in the future with config-gen.

@camilamacedo86
Copy link
Member Author

It also solves the scenario: operator-framework/operator-sdk#4542 for example.

camilamacedo86 added a commit to operator-framework/operator-sdk that referenced this issue Mar 18, 2021
**Description of the change:**
- create and bind to a non-default service account
- follow up : kubernetes-sigs/kubebuilder#2070 and #4626

**Motivation for the change:**

- fix: Scorecard docs instructions are wrong now for Ansible/Helm
- rfe: apply the same go behaviour of Go default config for Ansible/Helm
- Reduce the complexities for we address kubernetes-sigs/kubebuilder#2015
- Keep Ansible/Helm/Go aligned (Align Helm/Ansible plugins with the changes made for Golang ( go/v3 ))
Closes: #4644
camilamacedo86 added a commit to operator-framework/operator-sdk that referenced this issue Mar 18, 2021
**Description of the change:**
- Deprecated the flags which were removed in the Golang project in order to keep it better aligned with K8S
- Add the new flags
- Ensure that that metrics port is passed to the proxy. 

**Motivation for the change:**

- Reduce the complexities for we address kubernetes-sigs/kubebuilder#2015
- Fix docs that were not updated.
- Keep Ansible/Helm/Go aligned (Align Helm/Ansible plugins with the changes made for Golang ( go/v3 ))
- Closes: Ansible/Helm providing the same flags as Go #4627
@camilamacedo86 camilamacedo86 added the triage/accepted Indicates an issue or PR is ready to be actively worked on. label Mar 23, 2021
@camilamacedo86 camilamacedo86 added this to the 3.1.0 milestone Mar 23, 2021
@Adirio Adirio modified the milestones: 3.1.0, 3.* Mar 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants