1b7aac71f6
Add --ingress-mode flag (native default, floating-ip) + --floating-ip, --gateway, --mac, --net-prefix flags to 'orca node join'. Native mode (default): provision an unprivileged LXC with --features nesting=1,keyctl=1,fuse=1 (research Topic 3), install podman inside it, run orca-traefik container. nft on PVE host DNATs to the LXC bridge IP (DNATTarget parameterization, C-55: discover LXC IP before first nft apply, no downtime window). LXC provisioning: deterministic VMID 200, hostname orca-traefik, --onboot 1, 2GB RAM. Idempotent (C-53: command -v podman check). podman-restart.service enabled inside LXC (research Topic 6). step-ca root CA pushed into LXC via pct exec heredoc. traefik static config rendered + written into LXC. nft ruleset rendered with DNATTarget=LXC-IP + applied on PVE host. Migration 0009_ingress_mode.sql (C-59: NOT 0007 — already taken by certs_serial_unique). ALTER TABLE nodes ADD COLUMN ingress_mode. IngressMode field added to model.Node + set on proxmox node record. ---ci--- project: orca phase: 5 milestone: v0.14 status: execute ---/ci---
48 lines
1.7 KiB
Go
48 lines
1.7 KiB
Go
package model
|
|
|
|
import "time"
|
|
|
|
type NodeState string
|
|
|
|
const (
|
|
NodeStatePending NodeState = "pending"
|
|
NodeStateReady NodeState = "ready"
|
|
NodeStateLeft NodeState = "left"
|
|
NodeStateDraining NodeState = "draining"
|
|
NodeStateDrained NodeState = "drained"
|
|
)
|
|
|
|
// NodeKind classifies a node by how it joined the cluster.
|
|
type NodeKind string
|
|
|
|
const (
|
|
// NodeKindLocalhost is the auto-registered local node from `orca init`.
|
|
NodeKindLocalhost NodeKind = "localhost"
|
|
// NodeKindLinux is a generic Linux node (ubuntu/debian/alpine) joined
|
|
// without a specific type. Reserved for future SSH-join flows.
|
|
NodeKindLinux NodeKind = "linux"
|
|
// NodeKindProxmox is a Proxmox VE 8/9 host joined via SSH bootstrap.
|
|
NodeKindProxmox NodeKind = "proxmox"
|
|
)
|
|
|
|
type Node struct {
|
|
ID string `json:"id"`
|
|
Name string `json:"name"`
|
|
Address string `json:"address"`
|
|
State NodeState `json:"state"`
|
|
JoinedAt time.Time `json:"joined_at"`
|
|
LastSeen time.Time `json:"last_seen"`
|
|
Metadata map[string]string `json:"metadata,omitempty"`
|
|
// Kind classifies the node: localhost | linux | proxmox (REQ-049).
|
|
// Empty string for rows created before migration 0006.
|
|
Kind string `json:"kind,omitempty"`
|
|
// OS is the auto-detected OS identifier from /etc/os-release ID=
|
|
// (ubuntu|debian|alpine|pve|linux). Empty for pre-0006 rows.
|
|
OS string `json:"os,omitempty"`
|
|
// IngressMode is the ingress configuration for the node (R-024,
|
|
// v0.14). Values: "" (legacy/default for linux/localhost),
|
|
// "native" (proxmox native — traefik in LXC), "floating-ip"
|
|
// (proxmox floating-IP — ingress LXC owns the floating IP).
|
|
IngressMode string `json:"ingress_mode,omitempty"`
|
|
}
|