api-server/README.md

1.7 KiB

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.