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

Operator sdkv1.4.2 #47

Merged

Conversation

ArangoGutierrez
Copy link
Contributor

Update the Operator SDK version used for the operator

currently NFD is under V0.18 this Patch moves it to V1.4.2

Note: this is the first of many patches, but taking into account the amount of change of this patch, other planned things like bug fixes, even typos, will be fixed in a following PR

@ArangoGutierrez ArangoGutierrez requested a review from marquiz March 8, 2021 21:09
@k8s-ci-robot k8s-ci-robot requested a review from zvonkok March 8, 2021 21:09
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Mar 8, 2021
@ArangoGutierrez
Copy link
Contributor Author

/assign marquiz

@ArangoGutierrez ArangoGutierrez force-pushed the operator_sdkv1.4.2 branch 3 times, most recently from dfe43f3 to 5aabd28 Compare March 8, 2021 21:25
@zvonkok
Copy link

zvonkok commented Mar 10, 2021

We (@marquiz implemented it) introduced the master/worker split because we wanted to increase security so that workers cannot label the node. This patch introduces one common SA nfd-operator used by master and worker, which in the end means an nfd-worker will have the same privileges as the master, namely

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: nfd-operator
rules:
- apiGroups:
  - ""
  resources:
  - pods
  - nodes
  verbs:
  - get
  - patch
  - update 

Please keep the RBAC for master and worker separate. A worker does not need get,patch,update on the node. The worker should run with minimal privs.

@ArangoGutierrez
Copy link
Contributor Author

We (@marquiz implemented it) introduced the master/worker split because we wanted to increase security so that workers cannot label the node. This patch introduces one common SA nfd-operator used by master and worker, which in the end means an nfd-worker will have the same privileges as the master, namely

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: nfd-operator
rules:
- apiGroups:
  - ""
  resources:
  - pods
  - nodes
  verbs:
  - get
  - patch
  - update 

Please keep the RBAC for master and worker separate. A worker does not need get,patch,update on the node. The worker should run with minimal privs.

Got it, working on it

@marquiz
Copy link
Contributor

marquiz commented Mar 10, 2021

Please keep the RBAC for master and worker separate. A worker does not need get,patch,update on the node. The worker should run with minimal privs.

Got it, working on it

Yes. The worker does not currently need any privileges/access to the k8s control plane so no rbac configuration should be present for it.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 10, 2021
@ArangoGutierrez
Copy link
Contributor Author

@zvonkok @marquiz Ready for review again, RBAC is now master and worker

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 11, 2021
@ArangoGutierrez
Copy link
Contributor Author

@marquiz @zvonkok PING

@ArangoGutierrez
Copy link
Contributor Author

/honk

@k8s-ci-robot
Copy link
Contributor

@ArangoGutierrez:
goose image

In response to this:

/honk

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@ArangoGutierrez
Copy link
Contributor Author

/woof

@k8s-ci-robot
Copy link
Contributor

@ArangoGutierrez: dog image

In response to this:

/woof

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@zvonkok
Copy link

zvonkok commented Mar 23, 2021

/joke

@k8s-ci-robot
Copy link
Contributor

@zvonkok: Why is no one friends with Dracula? Because he's a pain in the neck.

In response to this:

/joke

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@zvonkok
Copy link

zvonkok commented Mar 23, 2021

Ok looks good, but there are some files without 'newline' at EOF and some empty lines. Please check, after that, I will lgtm.

@zvonkok
Copy link

zvonkok commented Mar 23, 2021

Otherwise most of the diff is based on the new operator-sdk layout and introduction of kustomize

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 23, 2021
@ArangoGutierrez
Copy link
Contributor Author

Ok looks good, but there are some files without 'newline' at EOF and some empty lines. Please check, after that, I will lgtm.

for i in $(sed -ns '${/./F}' ./**/*.yaml); do echo "" >> $i; done

@ArangoGutierrez
Copy link
Contributor Author

now rebase giving trouble again.....fixing

@ArangoGutierrez ArangoGutierrez force-pushed the operator_sdkv1.4.2 branch 2 times, most recently from 46946f6 to 94afbe8 Compare April 7, 2021 12:33
@ArangoGutierrez ArangoGutierrez requested a review from marquiz April 7, 2021 12:33
@ArangoGutierrez
Copy link
Contributor Author

@marquiz ready for review PTAL
CC @zvonkok

@ArangoGutierrez ArangoGutierrez force-pushed the operator_sdkv1.4.2 branch 3 times, most recently from 8d84744 to 6bab5fc Compare April 7, 2021 13:43
@ArangoGutierrez
Copy link
Contributor Author

Fixed the issue preventing the make image to succeed, should be ready for review now

Copy link
Contributor

@marquiz marquiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still a few comments and open questions.

Please also drop the manager binary that appeared in the latest version of the PR

Makefile Outdated Show resolved Hide resolved
Makefile Show resolved Hide resolved
PROJECT Show resolved Hide resolved
@ArangoGutierrez ArangoGutierrez requested a review from marquiz April 7, 2021 19:17
@ArangoGutierrez ArangoGutierrez force-pushed the operator_sdkv1.4.2 branch 3 times, most recently from 5727db9 to 7664023 Compare April 7, 2021 21:44
Copy link
Contributor

@marquiz marquiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, now!

One more nit: could you remove the trailing whitespace from the ends of lines, introduced by this patch. I spotted these files (but there might be others, too):

  • Makefile
  • build/assets/master/0100_service_account.yaml
  • build/assets/master/0200_clusterrole.yaml
  • config/certmanager/kustomizeconfig.yaml
  • config/rbac/nodefeaturediscovery_editor_role.yaml
  • config/samples/nfd.kubernetes.io_v1_nodefeaturediscovery.yaml

listKind: NodeFeatureDiscoveryList
plural: nodefeaturediscoveries
singular: nodefeaturediscovery
scope: Namespaced
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a thought but I was wondering should the CRD be cluster scoped instead of Namespaced.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the same CRD , this patch intention is about the operator framework layout, changes to the CRD will come in a following PR

"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/tools/record"
"k8s.io/cri-api/pkg/errors"
"k8s.io/klog"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

time for k8s.io/klog/v2?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment as the CRD, this patch is big enough like to introduce more changes, I am planning on enhancing logging and adding changes to the CRD but not in this patch that is big enough.
Thanks for the reviews Mythi :)

@ArangoGutierrez
Copy link
Contributor Author

Looks good, now!

One more nit: could you remove the trailing whitespace from the ends of lines, introduced by this patch. I spotted these files (but there might be others, too):

* Makefile

* build/assets/master/0100_service_account.yaml

* build/assets/master/0200_clusterrole.yaml

* config/certmanager/kustomizeconfig.yaml

* config/rbac/nodefeaturediscovery_editor_role.yaml

* config/samples/nfd.kubernetes.io_v1_nodefeaturediscovery.yaml

@marquiz requestes files have been trimmed RFR

@marquiz
Copy link
Contributor

marquiz commented Apr 8, 2021

@marquiz requestes files have been trimmed RFR

Are they? Didn't see any change on the trailing whitespace 🤔 I was referring to the trailing whitespace on the non-empty lines. I did see that now the empty lines from the end of those files were removed, though.

@ArangoGutierrez ArangoGutierrez force-pushed the operator_sdkv1.4.2 branch 2 times, most recently from f7804f0 to 24103e8 Compare April 8, 2021 12:57
Upgrade the operator-framework version we use for the NFD-Operator,
currently uses a very old and deprecated one. this patchs bumps it to
1.4.2 version, adding kustomize as the way to handle the manifests as
  part of the new features of the framwork

Signed-off-by: Carlos Eduardo Arango Gutierrez <carangog@redhat.com>
Copy link
Contributor

@marquiz marquiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ArangoGutierrez, looks good! 🎉 I think we're done with this megalomanian PR 😉
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 8, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ArangoGutierrez, marquiz

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [ArangoGutierrez,marquiz]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit e40ba53 into kubernetes-sigs:master Apr 8, 2021
@marquiz marquiz mentioned this pull request Oct 26, 2021
13 tasks
@ArangoGutierrez ArangoGutierrez deleted the operator_sdkv1.4.2 branch March 13, 2023 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants