This example showcases one of the many possible approaches for automating the deployment of the first NKP management cluster using Terraform.
- Terraform installed (OpenTofu as an alternative)
- Internet connectivity
- URL for the Rocky Linux OS image available in the Nutanix Support Portal
- URL for the NKP CLI available in the Nutanix Support Portal
- Static IP address for the Kubernetes control plane VIP
- One or more IP addresses for the NKP dashboard and load-balancing service
This automation manifest will upload the Rocky Linux image to Prism Central if it doesn't already exist and then create the NKP management cluster.
Note: Destroying the deployment will destroy the bastion VM and the NKP management cluster.
-
Clone this repository
git clone https://github.com/nutanixdev/nkp-tutorials.git
-
Move into the tutorial folder
cd nkp-tutorials/deploying-nkp-with-terraform
-
Rename the
nkp-cluster-config.auto.tfvars.example
tonkp-cluster-config.auto.tfvars
and update its valuesmv nkp-cluster-config.auto.tfvars.example nkp-cluster-config.auto.tfvars vi nkp-cluster-config.auto.tfvars # update values
-
Apply the manifest and confirm
terraform init terraform apply # enter "yes", if ready
-
A successful deployment will show a message like:
[...] Run the following command to retrieve the NKP dashboard access: ssh <bastion_username>@<your_bastion_vm_ip> nkp get dashboard [...]
Execute the output command to get the connection details for the NKP dashboard. Replace the bastion_username
and your_bastion_vm_ip
with the output from the deployment.
ssh <bastion_username>@<your_bastion_vm_ip> nkp get dashboard
The connection details will look something similar to the following:
Username: hopeful_proskuriakova
Password: umlTEP1bxCcpjVRjlMiGn89w8009MMx6aMJVZOhVtz5LuPYgYbbmEtuu8VLPgpGt
URL: https://192.168.0.12/dkp/kommander/dashboard