Created
May 27, 2020 16:54
-
-
Save guillaumedossantos/c1c4678149e6ad0b6dd8fb398d8bbbb6 to your computer and use it in GitHub Desktop.
SSO for Kubectl with Azure AD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kubectl config set-cluster {{ cluster_name }} \ | |
--server=https://{{ Master1 IP address }}:{{ k8s apiserver port }} \ | |
--certificate-authority={{ /path/to/kube-CA.pem }} | |
kubectl config set-credentials {{ user@domain }} \ | |
--auth-provider=azure \ | |
--auth-provider-arg=environment=AzurePublicCloud \ | |
--auth-provider-arg=client-id={{ azure_clientapp_ID }}\ | |
--auth-provider-arg=tenant-id={{ azure_tenant_ID }} \ | |
--auth-provider-arg=apiserver-id={{ azure_webapp_ID }} | |
kubectl config set-context {{ cluster_name }} \ | |
--cluster={{ cluster_name }} \ | |
--namespace=default \ | |
--user={{ user@domain }} | |
kubectl config use-context {{ cluster_name }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment