This project provides a fully automated installation script for Nutanix Kubernetes Platform (NKP) from a Rocky Linux bastion.
I developed this project to streamline the NKP installation process within my lab environment. While comprehensive, this project may not address every possible scenario and might require customization for different use cases. Please consider it as a foundational reference and adapt it to meet your specific requirements and environment constraints.
The project automates the complete installation process of NKP from a fresh Rocky Linux system, including all dependencies, tools, and cluster creation. It supports both proxy and direct internet environments.
It includes a web-based configuration UI that provides an intuitive interface for setting up environment variables, validating configurations, and executing the NKP installation with real-time progress monitoring and log streaming.
NKP Installation/
βββ nkp-easy-setup.sh # Main installation script
βββ launch-ui.sh # HTTP server launcher for configuration UI
βββ ui/ # Web-based configuration UI
β βββ index.html # Main UI page
β βββ styles.css # UI styling
β βββ script.js # UI functionality
β βββ server.py # Python HTTP server with API endpoints
βββ .env.example # Configuration template
βββ .gitignore # Git ignore patterns
βββ README.md # Detailed installation guide
βββ nkp-easy-setup-ui.png # Screenshot of the configuration UI
Before starting the NKP installation, ensure you have the following requirements in place:
Deploy a Rocky Linux virtual machine on your target Nutanix cluster that will serve as the installation bastion. The nkp-easy-setup UI and/or script will be executed from this VM.
- OS Version: Rocky Linux 9.6+ (this is what I tested)
- VM Resources (that I tested): 4 vCPUs, 16 GiB RAM, 200 GiB Disk (scale up if needed - we'll be pulling down quite a few packages and tools! π¦)
- Network Connectivity: VM requires access to Nutanix Prism Central and internet (supports both direct and proxy configurations)
- Access: Root/sudo privileges required for installation
Connect to Nutanix Support Portal, download the NKP Node OS Image (Rocky Linux) that matches the version of your NKP download link, and upload it to Prism Central before starting the installation.
This image will be used as the base image for NKP nodes created by NKP during cluster deployment.
After deploying the Rocky Linux bastion VM, use SSH to connect to it:
ssh your-username@bastion-vm-ip# Download or clone this project to your Rocky Linux system
git clone https://github.com/alecharn/nkp-easy-setup.git
cd nkp-easy-setupNote : before cloning the repo, you might have to configure a proxy on your terminal if you are behind a corporate proxy:
export http_proxy="http://your-proxy-host.company.com:8080"
export https_proxy="http://your-proxy-host.company.com:8080"
export HTTP_PROXY="http://your-proxy-host.company.com:8080"
export HTTPS_PROXY="http://your-proxy-host.company.com:8080"Note bis : before cloning, you might have to install git if it's not already installed:
sudo dnf install git -yWeb-based Configuration UI with Installation Execution - Complete end-to-end solution with real-time validation and log streaming.
# Launch the HTTP server for the configuration UI
sudo ./launch-ui.shAccess: http://localhost:8080 or http://your-vm-ip:8080
Workflow:
- Fill the form with all the required variables (an existing .env file can also be imported to auto-populate the fields)
- Generate and save .env file to server
- Validate .env file (required before installation)
- Execute NKP installation with real-time logs
# Copy the template and edit with your values
cp .env.example .env
sudo nano .env # or use your preferred editor
# Run the installation
sudo ./nkp-easy-setup.shThe .env file must be configured with your specific environment details:
PROXY_HOST="your-proxy-host.company.com"
PROXY_PORT="8080"
PROXY_PROTOCOL="http"
NO_PROXY_IPS="your-internal-ips"# In .env file, leave proxy settings empty:
PROXY_HOST=""
PROXY_PORT=""
PROXY_PROTOCOL=""NKP_DOWNLOAD_LINK="https://your-nkp-download-link.com"To obtain the NKP download link:
- Log in to the Nutanix Support Portal
- Navigate to Downloads > "Nutanix Kubernetes Platform (NKP)"
- Select the appropriate NKP version for your environment (NKP for Linux)
- Copy the download URL from the download button/link
- Don't forget to also download the NKP Node OS Image (Rocky Linux) and upload it to Prism Central
CLUSTER_NAME="nkp-demo" # NKP Cluster Name
NUTANIX_ENDPOINT="https://your-prism-central:9440/" # Prism Central URL
NUTANIX_USER="admin" # Prism Central Username
NUTANIX_PASSWORD="your-password" # Prism Central Password
NUTANIX_CLUSTER="your-nutanix-cluster" # Prism Element Cluster Name on which to deploy NKP
STORAGE_CONTAINER_NAME="your-storage-container" # Storage Container Name for persistent volumesCONTROLPLANE_IP="your-control-plane-ip" # Control Plane IP
SERVICE_LB_IP_RANGE="your-lb-ip-range" # Service Load Balancer IP Range
SUBNET="your-subnet" # Subnet Name for NKP nodes
KUBERNETES_PODS_NETWORK="192.168.0.0/16" # Kubernetes Pods Network CIDR, default is 192.168.0.0/16
KUBERNETES_SERVICES_NETWORK="10.96.0.0/12" # Kubernetes Services Network CIDR, default is 10.96.0.0/12VM_IMAGE="your-vm-image" # VM Image Name for NKP nodes
SSH_USERNAME="your-ssh-user" # SSH Username
SSH_PUBLIC_KEY_PATH="$HOME/.ssh/id_rsa.pub" # SSH Public Key Path (will be generated by the script if it does not exist)# Control Plane
CONTROL_PLANE_REPLICAS="1" # Number of Control Plane Replicas
CONTROL_PLANE_VCPUS="8" # Number of vCPUs for Control Plane
CONTROL_PLANE_CORES_PER_VCPU="1" # Cores per vCPU for Control Plane
CONTROL_PLANE_MEMORY_GIB="32" # Memory (GiB) for Control Plane
# Worker Nodes
WORKER_REPLICAS="3" # Number of Worker Replicas
WORKER_VCPUS="8" # Number of vCPUs for Worker Nodes
WORKER_CORES_PER_VCPU="1" # Cores per vCPU for Worker Nodes
WORKER_MEMORY_GIB="16" # Memory (GiB) for Worker NodesThe installation script automatically installs and configures:
- System package updates
- Essential development tools
- Docker CE with proxy configuration
- SSH key generation
- kubectl - Kubernetes command-line tool
- Helm - Kubernetes package manager
- k9s - Terminal-based Kubernetes UI
- NKP - Nutanix Kubernetes Platform CLI
- NKP cluster deployment on Nutanix infrastructure
- Control plane and worker node configuration
- Network and storage integration
After successful installation:
# Check cluster status
kubectl --kubeconfig="$HOME/{CLUSTER_NAME}.conf" get nodes
# Access cluster with k9s
k9s --kubeconfig="$HOME/{CLUSTER_NAME}.conf" -A
# Get dashboard credentials
nkp get dashboard --kubeconfig="$HOME/{CLUSTER_NAME}.conf"-
Missing .env file:
- UI Method: Use
./launch-ui.shto start the web server and access the configuration UI from your browser to generate the .env file - Manual Method: Copy
.env.exampleto.envand configure all required variables
- UI Method: Use
-
Configuration UI not accessible:
- Ensure Python is installed (
python3orpython) - Check port 8080 availability (the script automatically allows firewall connectivity)
- For bastion VM: Verify network connectivity
- Ensure Python is installed (
-
Installation issues:
- Validate .env file before executing installation
- Monitor real-time logs in the UI
- Check installation progress bar for current phase
-
Proxy connectivity: Verify proxy settings (the UI provides smart proxy configuration)
-
Nutanix connectivity: Ensure your system can reach Prism Central on port 9440
The script provides colored logging:
- π’ Green: Successful operations
- π‘ Yellow: Warnings
- π΄ Red: Errors
- π΅ Blue: Information
- Rocky Linux 9.6 (tested environment)
- Root/sudo access
- Internet connectivity (direct or via proxy)
- Access to Nutanix Prism Central
- Valid NKP download link from Nutanix Downloads Portal
- Python 3.x for the configuration UI server
- Port 8080 available for UI server
This project is provided as-is for demonstration and educational purposes.
