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

Remove credentials from azure.json on worker nodes #921

Closed
CecileRobertMichon opened this issue Sep 3, 2020 · 6 comments · Fixed by #955
Closed

Remove credentials from azure.json on worker nodes #921

CecileRobertMichon opened this issue Sep 3, 2020 · 6 comments · Fixed by #955
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/active Indicates that an issue or PR is actively being worked on by a contributor.

Comments

@CecileRobertMichon
Copy link
Contributor

/kind feature

Describe the solution you'd like
[A clear and concise description of what you want to happen.]
From #773 (comment)

Based on my current understanding, we do need this file on all nodes, but they may be different if desired (e.g., it doesn't appear to be required to use any credentials, msi or otherwise, on worker nodes).

We should verify that that assumption is true and only set the credentials on the azure.json secret for control planes in https://github.com/kubernetes-sigs/cluster-api-provider-azure/blob/master/controllers/helpers.go#L164

Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]

Environment:

  • cluster-api-provider-azure version:
  • Kubernetes version: (use kubectl version):
  • OS (e.g. from /etc/os-release):
@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Sep 3, 2020
@gab-satchi
Copy link
Member

/assign

@gab-satchi
Copy link
Member

/lifecycle active

@k8s-ci-robot k8s-ci-robot added the lifecycle/active Indicates that an issue or PR is actively being worked on by a contributor. label Sep 17, 2020
@gab-satchi
Copy link
Member

Hey @CecileRobertMichon. Looking through the code, the common flow is for the machine template to trigger the reconcile of the secret. The AzureMachineTemplate does not (and should not) care about whether the machine is a control plane or worker. Only at the AzureMachine level can we distinguish between control plane and worker but we've actively moved to having the azure.json be shared at the template level. Any ideas on how I can determine worker/control plane at the template stage? cc: @alexeldeib

@alexeldeib
Copy link
Contributor

alexeldeib commented Sep 21, 2020

AzureMachineTemplate doesn't have any labels/ownerRefs to the object which used it, does it? It might be convenient at the CAPI layer if MachineDeployment/MachineSet could apply owner labels to the templatized infra refs, if they don't already. Not sure if that's acceptable.

If that doesn't work, we might have to do something like generate two data fields in the secret -- one for control plane, one for worker -- and differentiate in the worker/control plane manifests themselves which one we want.

@alexeldeib
Copy link
Contributor

alexeldeib commented Sep 21, 2020

Same probably goes for machinepool and kubeadm config (except MachinePool doesn't support control plane yet, I think)

@gab-satchi
Copy link
Member

AzureMachineTemplate doesn't have any labels/ownerRefs to the object which used it, does it?

CAPI does apply a 'cloned-from' label on any infra machines created but that is likely not reliable as you could have a machine template with 0 replicas. I'll explore the second option. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/active Indicates that an issue or PR is actively being worked on by a contributor.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants