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

peerpod ctrl #283

Merged
merged 4 commits into from May 5, 2023
Merged

Conversation

snir911
Copy link
Contributor

@snir911 snir911 commented Apr 4, 2023

This is integration of peerpod-ctrl in this controller

* This is rebased on top of #282 * currently supports only aws (waiting for azure upstream merge)

To install:

  1. build and install controller normally, and KataConfig with enablePeerPods: true
  2. make sure caa pods are up and running
  3. run kubectl apply -f hack/caa-rbac.yaml workaround to set rbac for the caa pods (I'm not sure if they require to be restarted)
  4. change the caa pod images from quay.io/confidential-containers/cloud-api-adaptor-aws to quay.io/confidential-containers/cloud-api-adaptor to make sure the peerpod-ctrl caa changes included (related also to make caa image url configurable #284)
  5. then you should be able to run a (peer)pod and see PeerPod object created (it owned by the pod) and managed by the controller in case of deletion failure

TODOs:

  • make caa pod to be deployed with the correct rbac permissions
  • controller rbac for PeerPod modified manually, generate it using kubebuilder instead
  • remove hack patch
  • make sure it's rebased correctly once

This is all fixed, just build and test

  • azure is enabled but not tested

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 4, 2023
@openshift-ci openshift-ci bot requested review from jensfr and littlejawa April 4, 2023 13:28
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 7, 2023
@openshift-merge-robot openshift-merge-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Apr 20, 2023
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 23, 2023
@snir911
Copy link
Contributor Author

snir911 commented Apr 23, 2023

Removing WIP, I added a commit to keep up with #286 however, I'm not sure it's correct as locally i'm failing to build after this change
cc @bpradipt @jensfr @cpmeadors

@snir911 snir911 changed the title WIP: peerpod ctrl peerpod ctrl Apr 23, 2023
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 23, 2023
@snir911
Copy link
Contributor Author

snir911 commented Apr 24, 2023

removed the controller-tools patch as it will be fixed by:
#295

Makefile Outdated Show resolved Hide resolved
@@ -30,6 +30,7 @@ spec:
labels:
control-plane: controller-manager
spec:
hostNetwork: true
Copy link
Contributor

Choose a reason for hiding this comment

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

Is hostNetwork=true due to peerpod-ctrl and is this really needed ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, AFAIR for it's needed in order to use Instance Metadata Service

main.go Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
@cpmeadors
Copy link
Contributor

The PR description is really confusing. What does this PR actually implement/change? Is there a jira issue for this?

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 26, 2023
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 27, 2023
@snir911
Copy link
Contributor Author

snir911 commented Apr 27, 2023

This is the downstream integration part of the dangling resources controller in the sandboxed-container-operator, IIRC it's referred under the same Jira.
Also updated the commit msg to point to the upstream controller doc to make it clearer

Dockerfile Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
@bpradipt bpradipt added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 27, 2023
to avoid:
        vbom.ml/util@v0.0.0-20180919145318-efcd4e0f9787: unrecognized
import path "vbom.ml/util": https fetch: Get
"https://vbom.ml/util?go-get=1": dial tcp: lookup vbom.ml: no such host

Signed-off-by: Snir Sheriber <ssheribe@redhat.com>
@bpradipt bpradipt removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 2, 2023
go.mod Outdated Show resolved Hide resolved
go.mod Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
@snir911 snir911 force-pushed the peerpod-ctrl branch 2 times, most recently from 05ff1bc to 77a44d2 Compare May 4, 2023 12:38
main.go Outdated Show resolved Hide resolved
@gkurz
Copy link
Member

gkurz commented May 4, 2023

I don't feel like I'm qualified to do a thorough review of this PR, but I did not noticed anything that looked obviously wrong.

@bpradipt
Copy link
Contributor

bpradipt commented May 4, 2023

Just tested this on my Azure setup by following this sequence

  1. Create a sample pod and watch the cloud-api-adaptor logs
  2. Once VM is created, deleted the cloud-api-adaptor pod
  3. Delete the sample pod
  4. See all peerpod resources are deleted and verify from the admin console as well

Copy link
Contributor

@bpradipt bpradipt left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label May 4, 2023
to support peerpod-ctrl:
- peerpod-ctrl rbac (for manager itself) added using kubebuilder markers
- peerpodconfig-ctrl rbac (for CAA DA) added using caa_rbac.yaml

Signed-off-by: Snir Sheriber <ssheribe@redhat.com>
Signed-off-by: Snir Sheriber <ssheribe@redhat.com>
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label May 4, 2023
@openshift-ci
Copy link

openshift-ci bot commented May 4, 2023

New changes are detected. LGTM label has been removed.

Copy link
Contributor

@jensfr jensfr left a comment

Choose a reason for hiding this comment

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

lgtm, thank you @snir911

@jensfr jensfr merged commit e3a2b0e into openshift:peer-pods-tech-preview May 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants