An installation used to be this one: the deploy scripts and the Ansible defaults carried one site's domain, hypervisor and login, the Proxmox side and the database were set up by hand, and deploying meant copying scripts and a tree of roles beside the binary and keeping them in step with it. The binary now carries the roles, the Terraform module, the schema and the catalogue (embed.go), and installs itself: - hpcod setup: a full-screen installer for administrators. It asks where clusters are built, signs in to Proxmox before asking anything else (root's password once, or tokens), offers nodes and datastores from what Proxmox has, checks every field as it is typed, runs every step with its output live, checks the result and offers a test cluster. -yes runs the same steps from a site file; make deploy uses that. - hpcod verify: each fact checked by using it. - hpcod selftest: the smallest real cluster, by the portal's own path, a job run on it, then taken down. - Closed networks: hpcod serves HTTPS itself from a CA name-constrained to the site's domains, issuing and renewing its own certificate, and answers DNS for the portal and every cluster name. - A simulated Proxmox: Proxmox VE in QEMU on the control plane host, on a private bridge with NAT, for trying it without one. Every step reads back what it changed and is safe to run again. The site's values live in one file; group_vars/all/site.yml is generated from it, and the playbooks refuse to run without it. ci_user and -ssh-user no longer default to a personal account. scripts/B10, B20 and C20 are gone: their work is the setup steps. Proven end to end on a simulated Proxmox (Proxmox VE 9 in a VM on a real host): the install, the Proxmox step by the password path, the head template, verify READY, and a test cluster that ran srun on its compute node and was destroyed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
55 lines
2.1 KiB
Caddyfile
55 lines
2.1 KiB
Caddyfile
# The reverse proxy in front of hpcod. Not installed or edited by any script:
|
|
# the proxy usually serves other sites too, and its TLS is site policy.
|
|
# Copy these two blocks into your Caddyfile, replace hpc.example.org with
|
|
# PORTAL_DOMAIN / CLUSTER_DOMAIN from site.env, and reload Caddy.
|
|
#
|
|
# hpcod listens on 127.0.0.1:9880 only and trusts X-Forwarded-* from
|
|
# 127.0.0.1 alone (-trusted-proxy in the unit), so the proxy has to run on
|
|
# the same host.
|
|
|
|
# The control plane's own portal.
|
|
hpc.example.org {
|
|
header {
|
|
Strict-Transport-Security "max-age=31536000; includeSubDomains"
|
|
X-Content-Type-Options "nosniff"
|
|
X-Frame-Options "DENY"
|
|
Referrer-Policy "no-referrer"
|
|
-Server
|
|
}
|
|
reverse_proxy 127.0.0.1:9880 {
|
|
header_up Host {host}
|
|
header_up X-Real-IP {remote_host}
|
|
header_up X-Forwarded-For {remote_host}
|
|
header_up X-Forwarded-Proto {scheme}
|
|
}
|
|
encode gzip
|
|
}
|
|
|
|
# Every cluster's portal, c<NNN>.hpc.example.org. hpcod resolves the label to
|
|
# a cluster itself, so this block never changes when clusters come and go.
|
|
#
|
|
# A wildcard certificate cannot be had over HTTP-01. Either build Caddy with
|
|
# your DNS provider's module and use `tls { dns <provider> ... }`, or obtain
|
|
# the certificate elsewhere (certbot with a DNS plugin) and point at it:
|
|
*.hpc.example.org {
|
|
tls /etc/caddy/ssl/hpc-wildcard.pem /etc/caddy/ssl/hpc-wildcard.key
|
|
|
|
header {
|
|
Strict-Transport-Security "max-age=31536000; includeSubDomains"
|
|
X-Content-Type-Options "nosniff"
|
|
# Not no-referrer, which makes browsers send "Origin: null": Open
|
|
# OnDemand's origin check then rejects every form with 422.
|
|
Referrer-Policy "same-origin"
|
|
-Server
|
|
}
|
|
# No X-Frame-Options: Open OnDemand frames its own interactive sessions.
|
|
reverse_proxy 127.0.0.1:9880 {
|
|
# Host is how hpcod tells which cluster the request is for.
|
|
header_up Host {host}
|
|
header_up X-Real-IP {remote_host}
|
|
header_up X-Forwarded-For {remote_host}
|
|
header_up X-Forwarded-Proto {scheme}
|
|
}
|
|
encode gzip
|
|
}
|