Skip to content

Instantly share code, notes, and snippets.

@PatrickLang
Last active August 13, 2018 19:03
Show Gist options
  • Save PatrickLang/1641665de00b1bf146a65b0bd4752a80 to your computer and use it in GitHub Desktop.
Save PatrickLang/1641665de00b1bf146a65b0bd4752a80 to your computer and use it in GitHub Desktop.
Get a shell to a Windows host in acs-engine deployments

Assuming WinRM already enabled

kubectl run psh --image=mcr.microsoft.com/powershell -i -t --overrides='{ "apiVersion": "extensions/v1beta1", "spec":{"template":{"spec": {"nodeSelector":{"beta.kubernetes.io/os":"linux"}}}}}'


# or maybe
kubectl run psh --image=mcr.microsoft.com/powershell -i -t --overrides='{ "apiVersion": "apps/v1beta1", "spec":{"template":{"spec": {"nodeSelector":{"beta.kubernetes.io/os":"linux"}}}}}'
$cred = get-credential

PowerShell credential request
Enter your credentials.
User: ...
Password for user azureuser: ...

PS /> enter-pssession .. -Credential $cred -Authentication basic -UseSSL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment