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

let standalone npd use kubelet credentials #85014

Merged
merged 1 commit into from Nov 15, 2019

Conversation

dekkagaijin
Copy link
Contributor

@dekkagaijin dekkagaijin commented Nov 8, 2019

This will allow for the NODE_PROBLEM_DETECTOR_TOKEN to be removed from GCE metadata, while retaining the increased visibility offered by a standalone NPD.

/kind feature
/kind cleanup
/sig cloud-provider
/area provider/gcp
/release-note-none
/priority important-soon

NONE

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. labels Nov 8, 2019
@k8s-ci-robot
Copy link
Contributor

@dekkagaijin: The label(s) sig/gcp cannot be applied. These labels are supported: api-review, community/discussion, community/maintenance, community/question, cuj/build-train-deploy, cuj/multi-user, platform/aws, platform/azure, platform/gcp, platform/minikube, platform/other

In response to this:

This will allow for the NODE_PROBLEM_DETECTOR_TOKEN to be removed from GCE metadata, while retaining the increased visibility offered by a standalone NPD.

/kind feature
/sig gcp
/release-note-none
/priority important-soon

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 do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Nov 8, 2019
@k8s-ci-robot
Copy link
Contributor

@dekkagaijin: The label(s) sig/platform/gcp cannot be applied. These labels are supported: api-review, community/discussion, community/maintenance, community/question, cuj/build-train-deploy, cuj/multi-user, platform/aws, platform/azure, platform/gcp, platform/minikube, platform/other

In response to this:

This will allow for the NODE_PROBLEM_DETECTOR_TOKEN to be removed from GCE metadata, while retaining the increased visibility offered by a standalone NPD.

/kind feature
/sig platform/gcp
/release-note-none
/priority important-soon

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 sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Nov 8, 2019
@k8s-ci-robot k8s-ci-robot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. labels Nov 8, 2019
@k8s-ci-robot
Copy link
Contributor

@dekkagaijin: The label(s) area/platform/gcp cannot be applied. These labels are supported: api-review, community/discussion, community/maintenance, community/question, cuj/build-train-deploy, cuj/multi-user, platform/aws, platform/azure, platform/gcp, platform/minikube, platform/other

In response to this:

This will allow for the NODE_PROBLEM_DETECTOR_TOKEN to be removed from GCE metadata, while retaining the increased visibility offered by a standalone NPD.

/kind feature
/kind cleanup
/sig cloud-provider
/area platform/gcp
/release-note-none
/priority important-soon

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 release-note-none Denotes a PR that doesn't merit a release note. label Nov 8, 2019
@k8s-ci-robot
Copy link
Contributor

@dekkagaijin: The label(s) area/platform/gcp cannot be applied. These labels are supported: api-review, community/discussion, community/maintenance, community/question, cuj/build-train-deploy, cuj/multi-user, platform/aws, platform/azure, platform/gcp, platform/minikube, platform/other

In response to this:

This will allow for the NODE_PROBLEM_DETECTOR_TOKEN to be removed from GCE metadata, while retaining the increased visibility offered by a standalone NPD.

/kind feature
/kind cleanup
/sig cloud-provider
/area platform/gcp
/priority important-soon

NONE

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 area/provider/gcp Issues or PRs related to gcp provider do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. release-note-none Denotes a PR that doesn't merit a release note. labels Nov 8, 2019
@dekkagaijin
Copy link
Contributor Author

/assign awly

roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: system:node-problem-detector
Copy link
Contributor

Choose a reason for hiding this comment

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

where is this role defined?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

in the parent directory's npd.yaml

@@ -1245,6 +1245,12 @@ current-context: service-account-context
EOF
}

function setup-kubelet-user-npd-creds {
Copy link
Contributor

Choose a reason for hiding this comment

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

how about create-node-problem-detector-kubeconfig-from-kubelet

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

@wangzhen127
Copy link
Member

/assign @cheftako

Signed-off-by: Jake Sanders <jsand@google.com>
@awly
Copy link
Contributor

awly commented Nov 8, 2019

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 8, 2019
@dekkagaijin
Copy link
Contributor Author

/test pull-kubernetes-integration

@dekkagaijin
Copy link
Contributor Author

dekkagaijin commented Nov 11, 2019

@cheftako any concerns? would be helpful to get this merged in 1.17

@cjcullen
Copy link
Member

/approve

@dekkagaijin
Copy link
Contributor Author

Ping @wangzhen127 @cheftako

subjects:
- apiGroup: rbac.authorization.k8s.io
kind: User
name: kubelet
Copy link
Member

Choose a reason for hiding this comment

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

Why is this needed? What did it fix?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It makes sure that the kubelet user has all the permissions that NPD requires

function create-node-problem-detector-kubeconfig-from-kubelet {
echo "Creating node-problem-detector kubeconfig from /var/lib/kubelet/kubeconfig"
mkdir -p /var/lib/node-problem-detector
cp /var/lib/kubelet/kubeconfig /var/lib/node-problem-detector/kubeconfig
Copy link
Member

Choose a reason for hiding this comment

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

Why copy? Why not just configure NPD to read the kubelet's kubeconfig directly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I figured that it'd be a larger, more confusing/fragile change. This way the used kubeconfig is always in the same location, regardless of NPD configuration

@@ -2781,7 +2790,14 @@ function main() {
create-kubeproxy-user-kubeconfig
fi
if [[ "${ENABLE_NODE_PROBLEM_DETECTOR:-}" == "standalone" ]]; then
create-node-problem-detector-kubeconfig ${KUBERNETES_MASTER_NAME}
if [[ -n "${NODE_PROBLEM_DETECTOR_TOKEN:-}" ]]; then
Copy link
Member

Choose a reason for hiding this comment

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

I'm pro just removing NODE_PROBLEM_DETECTOR_TOKEN in one swoosh and not supporting both.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

IIUC that'd break this script on plain GCE

@mikedanese
Copy link
Member

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cjcullen, dekkagaijin, mikedanese

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

The pull request process is described 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 the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 14, 2019
@mikedanese mikedanese added this to the v1.17 milestone Nov 14, 2019
@k8s-ci-robot k8s-ci-robot merged commit c213196 into kubernetes:master Nov 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/provider/gcp Issues or PRs related to gcp provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note-none Denotes a PR that doesn't merit a release note. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants