Skip to content

A Packer reference to build a VMware PhotonOS based Kubernetes appliance.

Notifications You must be signed in to change notification settings

rguske/kubernetes-appliance

Repository files navigation

Kubernetes Appliance - VMware OVA

Twitter Follow

📝 My Personal Blog

⬇️ Download Kubernetes-Appliance

📖 Table of Content

🙌 Credits

Credits goes out to William Lam. The code basis for this project is based on the awesome VMware open-source project VMware Event Broker Appliance. I reused the code and stripped it down to the necessary pieces and adjusted it for my needs.

Twitter Follow

👓 Overview

This repository contains the necessary code to build a Photon OS 4.0 based Kubernetes Appliance.

The Appliance can be quickly deployed on vSphere for testing, development or learning purposes. Perhaps, it serves as the foundation for your project(s) 😉

📋 Requirements

CLI Tools:

Network:

  • DHCP enabled
  • SSH enabled (port 22)
  • No network restrictions between the build system (were packer is running on) and the VMware ESXi host
  • Packer will create an http server serving http_directory
    • Random port used within the range of 8000 and 9000

vSphere

  • ESXi 6.7 or greater
  • Enable GuestIPHack on the ESXi host before building the appliance: esxcli system settings advanced set -o /Net/GuestIPHack -i 1

👨‍🍳 Building the Appliance

  1. Clone the repository: git clone git@github.com:rguske/kubernetes-appliance.git
  2. Change into the directoy: cd kubernetes-appliance
  3. Adjust the photon-builder.json file with the appropriate ESXi (build host) data (IP or FQDN, user, password, datastore, network)
  4. Execute the build.sh script: ./build.sh

Optional: If you like to change the versions for e.g. Kubernetes or Antrea, modify those in the k8s-app-bom.json

Debugging

The SSH session initiated will be visible in the detail provided when PACKER_LOG=1 environment variable is set within the build.sh script.

Example: PACKER_LOG=1 packer build -var "K8S_APP_VERSION=${K8S_APP_VERSION_FROM_BOM}" -var-file=photon-builder.json -var-file=photon-version.json photon.json.

Output directoy

The finished ova file will be exported to the output-vmware-iso directory.

💻 zsh installed

I'm a happy user of zsh and oh-my-zsh and therefore, when connecting to the appliance via ssh, you will use a "pimped" shell environment.

rguske-zsh

Deployment Options Appliance

rguske-k8s-app-ova-1

rguske-k8s-app-ova-2

rguske-k8s-app-ova-3

Join an existing Kubernetes-Appliance

In version v0.3.0, the possibility was added to join an existing Kubernetes-Appliance as an additional node.

screenshot_change_name 2

screenshot_change_name 7

📋 Change Log

  • [2024-06-06] Updated versions to Kubernetes 1.29.2, Antrea to 1.15, etc.
  • [2022-03-14] Added option to join an existing K8s Appliance Node (v0.3.0)
  • [2022-03-10] Added local-path-provisioner (v0.2.1)
  • [2022-03-10] Updated to VMware PhotonOS v4 Rev.2 (v0.2.0)