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

docs: how to change Service Principal credentials? #724

Closed
JoseAntonioRodriguez opened this issue Jun 19, 2018 · 6 comments
Closed

docs: how to change Service Principal credentials? #724

JoseAntonioRodriguez opened this issue Jun 19, 2018 · 6 comments
Labels
area/docs question Further information is requested stale

Comments

@JoseAntonioRodriguez
Copy link

Is this a request for help?: YES


Is this an ISSUE or FEATURE REQUEST? (choose one): QUESTION


What version of acs-engine?: 0.16.2


Orchestrator and version (e.g. Kubernetes, DC/OS, Swarm): Kubernetes 1.9.7


  • I've created a Service Principal and then deployed a K8S cluster providing --client-id and --client-secret to set the Service Principal credentials.
  • Everything goes well, but now I need to change the Service Principal password. I used az ad sp credential reset ... to set a new password and I can login using the new password.
  • Operations in the cluster that need to talk to the Azure API eventually start to fail (as I expected, because I've changed the SP password).
  • The question is: How can I use acs-engine to set the new Service Principal password in a running cluster?

I've tried to use acs-engine deploy again with the new password in the --client-secret argument, but it fails with the error Changing property 'customData' is not allowed.

@CecileRobertMichon
Copy link
Contributor

I think you might need to update the aadClientSecret in /etc/kubernetes/azure.json

@javierprovecho
Copy link

Hi @CecileRobertMichon,

Apart from modifying the credentials on each master, it would be also necessary to update apiModel.json in the output directory, in case of upgrading K8S through acs-engine cli.

There isn't an automated way to renew these credentials from acs-engine?


If so, clusters lifecycle would only last until the default expiration of the service principal password, and manual maintenance would be needed to keep the cluster working with Azure.

Kops for example, allows to manage credentials for the cluster and rotate them if necessary although some downtime may exist.

This kind of cluster rolling update could be a useful feature for acs engine, and also enable other types of features like switching instance type.

@andyzhangx
Copy link
Contributor

andyzhangx commented Jul 7, 2018

paste my practice about how to update service principal secret in an existing k8s cluster:

# update service principle (aadClientSecret)
sudo vi /etc/kubernetes/azure.json

# on master node
docker restart $(docker ps  -q)

# on Linux agent node
sudo systemctl daemon-reload
sudo systemctl restart kubelet

# on Windows agent node
notepad c:\k\azure.json  #update aadClientSecret and save
start powershell
stop-service kubeproxy
stop-service kubelet
start-service kubeproxy
start-service kubelet

To automate this, you may use custom extension to run these scripts in VM, refer to https://docs.microsoft.com/en-us/azure/virtual-machines/extensions/custom-script-linux

@stale
Copy link

stale bot commented Mar 9, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution. Note that acs-engine is deprecated--see https://github.com/Azure/aks-engine instead.

@CecileRobertMichon CecileRobertMichon transferred this issue from Azure/acs-engine Mar 11, 2019
@welcome
Copy link

welcome bot commented Mar 11, 2019

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it.

@CecileRobertMichon CecileRobertMichon changed the title How to change Service Principal credentials? docs: how to change Service Principal credentials? Mar 11, 2019
@CecileRobertMichon CecileRobertMichon added area/docs question Further information is requested azure labels Mar 11, 2019
@stale
Copy link

stale bot commented May 10, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/docs question Further information is requested stale
Projects
None yet
Development

No branches or pull requests

4 participants