Skip to content

lenaxia/pxe-in-a-box

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PXE Boot Server

This project provides a Docker image that sets up a PXE Boot server to support both UEFI and BIOS booting. It includes configurations for multiple operating systems (Ubuntu, Talos OS, Debian, Raspbian) and allows for machine-specific configurations using YAML and Jinja2 templates.

How to Use

Docker

  1. Build the Docker Image:

    docker build -t pxe-server .
  2. Run the Docker Container:

    docker run -d --name pxe-server -p 69:69/udp -p 80:80 -p 8080:8080 -p 8081:8081 -v <nfs_mount>:/pxe-server/nfs/mnt pxe-server

Kubernetes

  1. Create a Persistent Volume Claim (PVC) for NFS:

    apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
      name: pxe-server-pvc
    spec:
      accessModes:
        - ReadWriteMany
      storageClassName: <nfs-storage-class>
      resources:
        requests:
          storage: 10Gi
  2. Deploy the PXE Server:

    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: pxe-server
    spec:
      replicas: 1
      selector:
        matchLabels:
          app: pxe-server
      template:
        metadata:
          labels:
            app: pxe-server
        spec:
          containers:
          - name: pxe-server
            image: pxe-server:latest
            ports:
            - containerPort: 69
              protocol: UDP
            - containerPort: 80
            - containerPort: 8080
            - containerPort: 8081
            volumeMounts:
            - mountPath: /pxe-server/nfs/mnt
              name: nfs-volume
          volumes:
          - name: nfs-volume
            persistentVolumeClaim:
              claimName: pxe-server-pvc
  3. Expose the Deployment:

    apiVersion: v1
    kind: Service
    metadata:
      name: pxe-server
    spec:
      selector:
        app: pxe-server
      ports:
      - name: tftp
        port: 69
        targetPort: 69
        protocol: UDP
      - name: http
        port: 80
        targetPort: 80
      - name: healthz
        port: 8080
        targetPort: 8080
      - name: metrics
        port: 8081
        targetPort: 8081
      type: LoadBalancer

Configuration

Available OS Templates

Available Machine Templates

  • MAC Address: 00:11:22:33:44:55

    • OS: ubuntu

    • Static IP: 192.168.1.100

    • Gateway: 192.168.1.1

    • DNS Servers: 8.8.8.8, 8.8.4.4

    • Partitions:

      • Disk: /dev/sda
        • Mount Point: /
        • Size: 20G
    • SSH Keys:

      • ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA...
    • Default User: pxeuser

    • Default Password: pxepassword

  • MAC Address: 66:77:88:99:AA:BB

    • OS: talos_os

    • Static IP: 192.168.1.101

    • Gateway: 192.168.1.1

    • DNS Servers: 8.8.8.8, 8.8.4.4

    • Partitions:

      • Disk: /dev/sdb
        • Mount Point: /
        • Size: 30G
    • SSH Keys:

      • ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA...
    • Default User: pxeuser

    • Default Password: pxepassword

  • MAC Address: CC:DD:EE:FF:00:11

    • OS: debian

    • Static IP: 192.168.1.102

    • Gateway: 192.168.1.1

    • DNS Servers: 8.8.8.8, 8.8.4.4

    • Partitions:

      • Disk: /dev/sdc
        • Mount Point: /
        • Size: 25G
    • SSH Keys:

      • ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA...
    • Default User: pxeuser

    • Default Password: pxepassword

  • MAC Address: 22:33:44:55:66:77

    • OS: raspbian

    • Static IP: 192.168.1.103

    • Gateway: 192.168.1.1

    • DNS Servers: 8.8.8.8, 8.8.4.4

    • Partitions:

      • Disk: /dev/sdd
        • Mount Point: /
        • Size: 15G
    • SSH Keys:

      • ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA...
    • Default User: pxeuser

    • Default Password: pxepassword

About

A self contained, configurable PXE boot image

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •