Skip to content

operator: Move CRD registration to operator#13285

Merged
aanm merged 5 commits intocilium:masterfrom
christarazi:pr/christarazi/move-crd-register-to-operator
Sep 29, 2020
Merged

operator: Move CRD registration to operator#13285
aanm merged 5 commits intocilium:masterfrom
christarazi:pr/christarazi/move-crd-register-to-operator

Conversation

@christarazi
Copy link
Copy Markdown
Member

@christarazi christarazi commented Sep 24, 2020

Brief description

This PR is the final piece to move the CRD registration responsibilities to cilium-operator. In the case of new CRDs, an upcoming PR will install the CRDs via Helm. In the case of upgrades, cilium-operator will handle the upgrades if Helm does not upgrade them. This will ensure that we are always running the most up-to-date CRDs.

See commit msgs.

Updates: #12737

Cilium Operator will now handle CRD operations on behalf of Cilium Agent

@christarazi christarazi requested a review from a team September 24, 2020 21:57
@christarazi christarazi requested a review from a team as a code owner September 24, 2020 21:57
@christarazi christarazi added area/k8s Impacts the kubernetes API, or kubernetes -> cilium internals translation layers. release-note/misc This PR makes changes that have no direct user impact. labels Sep 24, 2020
@maintainer-s-little-helper maintainer-s-little-helper Bot added dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. and removed dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. labels Sep 24, 2020
@christarazi christarazi requested review from a team and aanm September 24, 2020 21:57
@christarazi

This comment has been minimized.

Comment thread operator/main.go Outdated
@christarazi christarazi force-pushed the pr/christarazi/move-crd-register-to-operator branch from e164c9b to 23c3578 Compare September 24, 2020 22:53
@christarazi christarazi requested review from a team as code owners September 24, 2020 22:53
@christarazi christarazi force-pushed the pr/christarazi/move-crd-register-to-operator branch 2 times, most recently from 76ee1bb to ba96c7b Compare September 24, 2020 22:57
@christarazi
Copy link
Copy Markdown
Member Author

test-me-please

Copy link
Copy Markdown
Member

@aanm aanm left a comment

Choose a reason for hiding this comment

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

One other item missing. There is, all over the operator code, check methods waiting for a CRD to be available. This should no longer be required and can be removed as part of these changes.

Comment thread install/kubernetes/cilium/charts/agent/templates/clusterrole.yaml Outdated
Comment thread install/kubernetes/cilium/charts/preflight/templates/clusterrole.yaml Outdated
Comment thread operator/main.go Outdated
Copy link
Copy Markdown
Member

@fristonio fristonio left a comment

Choose a reason for hiding this comment

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

Other than the changes requested by @aanm LGTM 🚀

Comment thread operator/main.go Outdated
Comment thread operator/main.go Outdated
@christarazi christarazi force-pushed the pr/christarazi/move-crd-register-to-operator branch 2 times, most recently from 14fdb72 to 55c0cc4 Compare September 25, 2020 18:52
@maintainer-s-little-helper

This comment has been minimized.

@maintainer-s-little-helper maintainer-s-little-helper Bot added the dont-merge/needs-sign-off The author needs to add signoff to their commits before merge. label Sep 25, 2020
@christarazi christarazi force-pushed the pr/christarazi/move-crd-register-to-operator branch from 55c0cc4 to cab6aeb Compare September 25, 2020 18:52
@maintainer-s-little-helper

This comment has been minimized.

@christarazi christarazi force-pushed the pr/christarazi/move-crd-register-to-operator branch from cab6aeb to f1e3d79 Compare September 25, 2020 18:53
@maintainer-s-little-helper maintainer-s-little-helper Bot removed the dont-merge/needs-sign-off The author needs to add signoff to their commits before merge. label Sep 25, 2020
@christarazi christarazi requested a review from aanm September 25, 2020 18:54
@christarazi christarazi force-pushed the pr/christarazi/move-crd-register-to-operator branch from e400b62 to 5648a35 Compare September 25, 2020 20:23
@christarazi

This comment has been minimized.

@christarazi christarazi force-pushed the pr/christarazi/move-crd-register-to-operator branch from 5648a35 to 26d484e Compare September 25, 2020 20:27
@christarazi
Copy link
Copy Markdown
Member Author

test-me-please

Comment thread install/kubernetes/cilium/charts/agent/templates/clusterrole.yaml Outdated
Comment thread install/kubernetes/cilium/charts/preflight/templates/clusterrole.yaml Outdated
Comment thread install/kubernetes/cilium/charts/config/templates/configmap.yaml Outdated
Comment thread operator/flags.go Outdated
@christarazi christarazi force-pushed the pr/christarazi/move-crd-register-to-operator branch 2 times, most recently from d0066a1 to 73ca4bb Compare September 27, 2020 05:06
@christarazi
Copy link
Copy Markdown
Member Author

test-me-please

Copy link
Copy Markdown
Member

@sayboras sayboras left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@christarazi
Copy link
Copy Markdown
Member Author

test-gke

Copy link
Copy Markdown
Member

@aanm aanm left a comment

Choose a reason for hiding this comment

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

One small TODO doesn't require my follow up review

Comment thread install/kubernetes/cilium/charts/agent/templates/clusterrole.yaml Outdated
@christarazi christarazi force-pushed the pr/christarazi/move-crd-register-to-operator branch from 73ca4bb to 488f414 Compare September 28, 2020 21:21
This commit deprecates the permissions for CRD operations and marks them
for removal in v1.10 from the agent. Additionally, this commit grants
them to cilium-operator. This commit is a preparatory for a future
commit to move the CRD operations to the cilium-operator.

Signed-off-by: Chris Tarazi <chris@isovalent.com>
This commit reverts the following two commits, along with the vendored
changes that are no longer needed. The rationale is that we no longer
need cilium-operator to wait for CRDs as cilium-operator will now
register the CRDs (in a future commit), previously done by the agent.

---

Commit 5dbe413 ("operator: Make CRD
availability timeout configurable") was selectively reverted, only
keeping the declarations of the crd-wait-timeout flag, so that they can
be deprecated in a future commit.

---

Revert "operator: Wait for CRDs before running informers"

This reverts commit 8e4f348.

Signed-off-by: Chris Tarazi <chris@isovalent.com>
This commit deprecates the crd-wait-timeout option as the functionality
has been removed in the previous commit. This option will be removed in
1.10. This commit also updates the cmdref accordingly.

Signed-off-by: Chris Tarazi <chris@isovalent.com>
This commit is mostly a refactoring change to ease future commits. It
also removes a duplicated `Update()` call which is already done in
`Init()`.

Signed-off-by: Chris Tarazi <chris@isovalent.com>
In pursuit of delegating all cluster operations to cilium-operator from
the agent, this commit moves the CRD registration under the purview of
cilium-operator.

Signed-off-by: Chris Tarazi <chris@isovalent.com>
@christarazi christarazi force-pushed the pr/christarazi/move-crd-register-to-operator branch from 488f414 to 7de2be6 Compare September 28, 2020 21:23
@christarazi
Copy link
Copy Markdown
Member Author

test-me-please

Copy link
Copy Markdown
Member

@fristonio fristonio left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@aanm aanm merged commit ff3ca77 into cilium:master Sep 29, 2020
@christarazi christarazi deleted the pr/christarazi/move-crd-register-to-operator branch September 29, 2020 16:44
christarazi added a commit to christarazi/cilium that referenced this pull request Dec 16, 2021
Following up on cilium#13285.

Signed-off-by: Chris Tarazi <chris@isovalent.com>
tklauser pushed a commit that referenced this pull request Dec 21, 2021
Following up on #13285.

Signed-off-by: Chris Tarazi <chris@isovalent.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/k8s Impacts the kubernetes API, or kubernetes -> cilium internals translation layers. release-note/misc This PR makes changes that have no direct user impact.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants