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

instance metadata issue fix #846

Closed
wants to merge 0 commits into from
Closed

Conversation

vdhanan
Copy link
Contributor

@vdhanan vdhanan commented Apr 22, 2021

Is this a bug fix or adding new feature?
fixes #474

What is this PR about? / Why do we need it?
uses downward api and k8s api to populate needed metadata fields

What testing is done?
some unit and manual testing - need to add some more unit tests before merge

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 22, 2021
@k8s-ci-robot
Copy link
Contributor

Hi @vdhanan. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot requested review from gnufied and wongma7 April 22, 2021 17:03
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Apr 22, 2021
@AndyXiangLi
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 22, 2021
- name: CSI_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
Copy link
Contributor

Choose a reason for hiding this comment

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

also run make generate-kustomize (definitely we need a CI job for this, same as how we have make verify for keeping vendor dir up to date)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done in new PR #855

}

// get node with k8s API
node, err := clientset.CoreV1().Nodes().Get(context.TODO(), nodeName, metav1.GetOptions{})
Copy link
Contributor

Choose a reason for hiding this comment

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

doesn't the node need RBAC permission to do this? we will need to add clusterrole and clusterrolebinding bound to the node service account.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done in #855

}

awsRegionRegex := "(?<=/)([a-z]{2}(-gov)?)-(central|(north|south)?(east|west)?)-[0-9]"
awsAvailabilityZoneRegex := "(?<=/)([a-z]{2}(-gov)?)-(central|(north|south)?(east|west)?)-[0-9][a-z]"
Copy link
Contributor

Choose a reason for hiding this comment

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

how much do we have to worry about special cases, will this work on an outpost node for example? see https://github.com/kubernetes/kubernetes/pull/99130/files#diff-f20dfc917eee752715e89727d403f28f27220826b73bc67ddcc224effe7d1836R270 by @ayberk.

(does sdk provide something so we dont have to write regex?)

@@ -224,7 +224,7 @@ type EC2 interface {
DescribeAvailabilityZonesWithContext(ctx aws.Context, input *ec2.DescribeAvailabilityZonesInput, opts ...request.Option) (*ec2.DescribeAvailabilityZonesOutput, error)
}

type Cloud interface {
type AWSCloud interface {
Copy link
Contributor

Choose a reason for hiding this comment

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

fair enough. note that i do eventually want to reconcile our cloud implementation with the generic aws cloudprovider implementation https://github.com/kubernetes/cloud-provider-aws/blob/master/pkg/providers/v2/cloud.go#L63 so "Cloud" is not overly ambiguous, the current naming is probably fine. #806 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

my IDE was complaining about Cloud being declared here and in a 3P dependency, but that went away so I don't rename it in PR #855

@wongma7
Copy link
Contributor

wongma7 commented Apr 22, 2021

/hold

i can see unit tests in progress

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 22, 2021
@k8s-ci-robot
Copy link
Contributor

@vdhanan: PR needs rebase.

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.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 22, 2021
@vdhanan vdhanan closed this Apr 23, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: vdhanan

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

Needs approval from an approver in each of these files:

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 added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 23, 2021
@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Apr 23, 2021

@vdhanan: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
pull-aws-ebs-csi-driver-e2e-single-az aa4427a link /test pull-aws-ebs-csi-driver-e2e-single-az

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot Run with IAM Service Account and no metadata service
4 participants