Tuesday, December 21, 2021

Azure kubernetes terraform - create ssh public key for linux vms and windows credentials for windows vms

 

create ssh public key for linux vms:
mkdir $HOME/.ssh/aks-prod-sshkeys-terraform
ssh-keygen \
  -m PEM \
  -t rsa \
  -b 4096 \
  -C "azureuser@myserver" \
  -f ~/.ssh/aks-prod-sshkeys-terraform/aksprodsshkey \
  -N mypassphrase

ls -lrt $HOME/.ssh/aks-prod-sshkeys-terraform

create variables:
variable "ssh_public_key"{
 default = "~/.ssh/aks-prod-sshkeys-terraform/aksprodsshkey.pub"
 description = "for linux worker nodes"
}

variable "windows_admin_username"{
 type = string
 default = "azureuser"
 description = "windows nodes admin username"
}

variable "windows_admin_password"{
 type = string
 default = "P@ssw0rd1234"
 description = "windows nodes admin password"
}

No comments:

Post a Comment