Go to file
2025-02-26 21:36:34 -05:00
deploy Clean up K8s specs and add README.md 2025-02-26 21:33:11 -05:00
requests Generate SSH key on startup if it does not already exist; add API endpoint to get SSH public key 2025-02-24 23:36:22 -05:00
scripts Clean up K8s specs and add README.md 2025-02-26 21:33:11 -05:00
src Actually run the damn thing 2025-02-25 00:28:52 -05:00
.gitignore Port over initial implementation of API server and simplify configuration 2025-02-23 12:42:48 -05:00
Cargo.lock Generate SSH key on startup if it does not already exist; add API endpoint to get SSH public key 2025-02-24 23:36:22 -05:00
Cargo.toml Generate SSH key on startup if it does not already exist; add API endpoint to get SSH public key 2025-02-24 23:36:22 -05:00
Dockerfile Start roughing out K8s deployment spec for api-server; bootstrap global locks AFTER DB migrations have run 2025-02-25 00:18:45 -05:00
LICENSE Add LICENSE 2025-02-26 21:36:34 -05:00
package.sh Port over initial implementation of API server and simplify configuration 2025-02-23 12:42:48 -05:00
README.md Add LICENSE 2025-02-26 21:36:34 -05:00
Rocket.toml Minor cleanup & Dockerfile 2025-02-23 13:29:38 -05:00
start.sh Port over initial implementation of API server and simplify configuration 2025-02-23 12:42:48 -05:00

P5x api-server

P5x is a set of tools for running a Kubernetes cluster on LXC containers in Proxmox. The api-server is the central component of the P5x system that handles interactions between Kubernetes and the underlying Proxmox infrastructure.

The api-server is a necessary component to run any part of the P5x system.

Deployment

P5x Storage Setup

P5x requires a small amount of persistent storage for its system database. This is accomplished with a local path on a Kubernetes node.

  1. Pick an LXC container in your K8s cluster that the P5x API server will run on.
  2. Create a new disk in Proxmox (may not be NFS storage) and mount it at /mnt/p5x-system-data on the LXC container.
  3. Update deploy/20-volume.yaml and replace the control.k8s hostname in the nodeSelectorTerms with the hostname of your K8s LXC container.

Deploy API Server to Kubernetes

Create a file with the necessary environment variables:

# 10-environment.yaml
---
apiVersion: v1
kind: Secret
metadata:
  name: api-env
  namespace: p5x-system
type: Opaque
stringData:
  P5X_API_HOST: ""  # fully-qualified hostname or IP address of your Proxmox VE server
  P5X_API_ROOT_PASSWORD: ""
  P5X_STORAGE_POOL: ""  # name of your Proxmox VE storage pool -- MUST be network storage shared between nodes
  P5X_STORAGE_DRIVER: "lvm"  # what type of driver the storage pool uses ('lvm' or 'nfs')
  P5X_K8S_ROOT_PASSWORD: ""  # FOR FUTURE USE - you can just fill in a random string here for now

Apply the environment secret and create the rest of the P5x API resources:

kubectl apply -f deploy/0-namespace.yaml -f 10-environment.yaml -f deploy

In your Kubernetes cluster, in the p5x-system namespace, you should now see a p5x-api-server-0 pod successfully boot.

License

P5x: Proxmox on Kubernetes - API Server Copyright (C) 2025 Garrett Mills shout@garrettmills.dev

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.