Skip to content
This repository has been archived by the owner on Dec 11, 2023. It is now read-only.

Pass VM POD name & namespace to shutdown-deferrer (and update images) #592

Merged
merged 45 commits into from
Nov 6, 2018

Conversation

tuommaki
Copy link
Contributor

@tuommaki tuommaki commented Oct 17, 2018

In order to find the right DrainerConfig for node drainage status,
shutdown-deferrer needs to know the POD name and namespace it's running
in. This is passed via Downward API as environment parameter.

Also prevent Endpoint to be deleted before corresponding node is shut down.

In order to find the right DrainerConfig for node drainage status,
shutdown-deferrer needs to know the POD name and namespace it's running
in. This is passed via Downward API as environment parameter.
@tuommaki tuommaki self-assigned this Oct 17, 2018
@tuommaki tuommaki changed the title Pass VM POD name & namespace to shutdown-deferrer Pass VM POD name & namespace to shutdown-deferrer (and update images) Oct 18, 2018
@tuommaki tuommaki deployed to gorgoth October 18, 2018 11:27 Active
@tuommaki tuommaki deployed to gorgoth October 18, 2018 13:54 Active
@tuommaki tuommaki had a problem deploying to gorgoth October 19, 2018 11:05 Failure
@tuommaki tuommaki had a problem deploying to gorgoth October 19, 2018 11:09 Failure
@tuommaki tuommaki deployed to gorgoth October 19, 2018 11:26 Active
Because of node POD running with host network, bind to loopback address
fails when using same port for all pods (when there's more than one
tenant node on physical control plane machine).

Use the same trick as for flannel health and calculate listen port from
flannel VNI.
@tuommaki tuommaki deployed to gorgoth October 19, 2018 13:03 Active
@tuommaki tuommaki deployed to gorgoth October 22, 2018 06:44 Active
@tuommaki tuommaki deployed to gorgoth October 22, 2018 07:10 Active
@tuommaki tuommaki deployed to gorgoth October 22, 2018 08:21 Active
@tuommaki tuommaki deployed to gorgoth October 22, 2018 10:49 Active
@tuommaki tuommaki deployed to gorgoth October 22, 2018 13:09 Active
@tuommaki tuommaki deployed to gorgoth October 24, 2018 05:45 Active
@tuommaki tuommaki had a problem deploying to gorgoth October 24, 2018 07:07 Failure
@tuommaki tuommaki had a problem deploying to gorgoth October 24, 2018 07:13 Failure
@tuommaki tuommaki deployed to gorgoth October 25, 2018 09:19 Active
@tuommaki tuommaki deployed to gorgoth October 25, 2018 10:26 Active
@tuommaki tuommaki deployed to gorgoth October 31, 2018 13:34 Active
@tuommaki tuommaki requested review from a team November 5, 2018 14:26
@MarcelMue
Copy link
Contributor

Are e2e tests failing because of this change? How did manual testing go? Would be nice to have this info while reviewing.

service/controller/v15/key/key.go Outdated Show resolved Hide resolved
r.logger.LogCtx(ctx, "level", "debug", "message", "keeping finalizers")
finalizerskeptcontext.SetKept(ctx)

return nil, nil
Copy link
Contributor

Choose a reason for hiding this comment

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

This code here is nice.

@tuommaki tuommaki deployed to gorgoth November 5, 2018 15:01 Active
service/controller/v16/resource/endpoint/delete.go Outdated Show resolved Hide resolved
Lifecycle: &apiv1.Lifecycle{
PreStop: &apiv1.Handler{
Exec: &apiv1.ExecAction{
Command: []string{"/pre-shutdown-hook", fmt.Sprintf("%s/v1/defer/", key.ShutdownDeferrerListenAddress(customObject))},
Copy link
Member

Choose a reason for hiding this comment

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

Now I see the whole picture. In a hindsight I think this whole shutdown-deferer repo could be put as another kvm-operator endpoint. We wouldn't have to maintain separate docker image.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Original idea was to have reusable container that can be used for this purpose, but now that you say it, it is a bit dependent on the use case here so could make sense.

service/controller/v15/resource/endpoint/delete.go Outdated Show resolved Hide resolved
service/controller/v15/resource/endpoint/delete.go Outdated Show resolved Hide resolved
service/controller/v16/resource/endpoint/delete.go Outdated Show resolved Hide resolved
service/controller/v16/resource/endpoint/delete.go Outdated Show resolved Hide resolved
service/controller/v16/resource/endpoint/delete.go Outdated Show resolved Hide resolved
service/controller/v15/resource/endpoint/delete.go Outdated Show resolved Hide resolved
kopiczko and others added 13 commits November 6, 2018 10:23
Co-Authored-By: tuommaki <1947505+tuommaki@users.noreply.github.com>
Co-Authored-By: tuommaki <1947505+tuommaki@users.noreply.github.com>
Co-Authored-By: tuommaki <1947505+tuommaki@users.noreply.github.com>
Co-Authored-By: tuommaki <1947505+tuommaki@users.noreply.github.com>
Co-Authored-By: tuommaki <1947505+tuommaki@users.noreply.github.com>
Co-Authored-By: tuommaki <1947505+tuommaki@users.noreply.github.com>
Co-Authored-By: tuommaki <1947505+tuommaki@users.noreply.github.com>
Co-Authored-By: tuommaki <1947505+tuommaki@users.noreply.github.com>
Co-Authored-By: tuommaki <1947505+tuommaki@users.noreply.github.com>
Co-Authored-By: tuommaki <1947505+tuommaki@users.noreply.github.com>
…/giantswarm/kvm-operator into pass-pod-info-to-shutdown-deferrer
@tuommaki
Copy link
Contributor Author

tuommaki commented Nov 6, 2018

Unsure about e2e but I'm pretty sure it's about environments. We agreed with @teemow that he'll test this manually in order to proceed with upcoming release.

@tuommaki
Copy link
Contributor Author

tuommaki commented Nov 6, 2018

Oh, but approvals are not there. Waiting for them :) PTAL 😄

Copy link
Contributor

@xh3b4sd xh3b4sd left a comment

Choose a reason for hiding this comment

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

Fine with iterating here. Since you tested this manually let's go. KVM e2e is not really a usable thing yet IMO.

@@ -370,6 +377,18 @@ func ServiceAccountName(customObject v1alpha1.KVMConfig) string {
return ClusterID(customObject)
}

func ShutdownDeferrerListenPort(customObject v1alpha1.KVMConfig) int {
return int(shutdownDeferrerPortBase + customObject.Spec.KVM.Network.Flannel.VNI)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return int(shutdownDeferrerPortBase + customObject.Spec.KVM.Network.Flannel.VNI)
// per tenant cluster we run one vm per host. the pod of the vm uses the host network. so this makes sure the port of the shutdown deferrer is unique per tenant vm.
return int(shutdownDeferrerPortBase + customObject.Spec.KVM.Network.Flannel.VNI)

@tuommaki tuommaki merged commit 61da9c6 into master Nov 6, 2018
@tuommaki tuommaki deleted the pass-pod-info-to-shutdown-deferrer branch November 6, 2018 09:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants