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

copy CNI plugin and config in entrypoint not agent #735

Merged
merged 1 commit into from
Dec 9, 2019

Conversation

jaypipes
Copy link
Contributor

Replaces the hard-coded copying of the CNI plugin binary and
configuration file from the main.go of the aws-k8s-agent (the IPAMd
daemon) into a new entrypoint.sh script that backgrounds the IPAM
daemon, waits for it to listen on port 50051 and then proceeds to copy
the CNI plugin binaries and configuration files into the well-known
directory for Kubelet to see them as ready.

Issue #706

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link
Contributor

@nithu0115 nithu0115 left a comment

Choose a reason for hiding this comment

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

@jaypipes, some things to address inline...

scripts/entrypoint.sh Outdated Show resolved Hide resolved
scripts/dockerfiles/Dockerfile.release Outdated Show resolved Hide resolved
@@ -98,6 +98,10 @@ spec:
env:
- name: AWS_VPC_K8S_CNI_LOGLEVEL
value: DEBUG
- name: AWS_VPC_K8S_CNI_VETHPREFIX
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO, I would like to move these variables into a configMap so that they persisted upon upgrades. May be a separate PR and add //To do here ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ack. good idea.

@nithu0115
Copy link
Contributor

LGTM! Thanks @jaypipes

Between, what are your thoughts on adding sleep 10 for IPamD daemon to pre-warm/reconcile before copying the net plugin binaries to avoid kubelet errors:failed to assign an IP address to container ?

@jaypipes
Copy link
Contributor Author

jaypipes commented Dec 3, 2019

LGTM! Thanks @jaypipes

Between, what are your thoughts on adding sleep 10 for IPamD daemon to pre-warm/reconcile before copying the net plugin binaries to avoid kubelet errors:failed to assign an IP address to container ?

For my thoughts on that, see https://github.com/aws/amazon-vpc-cni-k8s/pull/738/files :) Basically, I believe we should get rid of the async loading and just make the ipamd.NewController function return a properly-constructed object with a populated SharedInformer cache and don't use a separate goroutine for the cache-loading operation.

@mogren
Copy link
Contributor

mogren commented Dec 3, 2019

@jaypipes Yes, starting up synchronously sounds a lot cleaner to me.


# bring the aws-k8s-agent process back into the foreground
echo -n "foregrounding IPAM daemon ... "
fg %1
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Normally I would store the job ID when planning to move a background to to foreground again, but not really needed in this script.

scripts/entrypoint.sh Show resolved Hide resolved
scripts/entrypoint.sh Outdated Show resolved Hide resolved
Replaces the hard-coded copying of the CNI plugin binary and
configuration file from the main.go of the aws-k8s-agent (the IPAMd
daemon) into a new entrypoint.sh script that backgrounds the IPAM
daemon, waits for it to listen on port 50051 and then proceeds to copy
the CNI plugin binaries and configuration files into the well-known
directory for Kubelet to see them as ready.
Copy link
Contributor

@mogren mogren left a comment

Choose a reason for hiding this comment

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

Thanks Jay, LGTM!

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.

3 participants