Kubernetes manifests for a public node, and --announce
k8s/base (kustomize): StatefulSet with a volume, p2p LoadBalancer for 4001 TCP+UDP, ClusterIP for the UI, optional ingress; k8s/overlays/nodeport for clusters without a load balancer. The pod waits for 'allmende init' so the recovery phrase never goes to a log. --announce makes a node that sits behind a router or in a container announce the address others can dial (e.g. /dns4/name/tcp/4001), so a bootstrap node behind a port forward works, and the DNS records it prints name the host. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AeFqV96dVeBX94inzcgZKw
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
# For a cluster without a load balancer: publish the libp2p port on every node
|
||||
# as NodePort 30401 (TCP and UDP) and forward the router's port 4001 to the LAN
|
||||
# address of a node, port 30401.
|
||||
#
|
||||
# kubectl apply -k k8s/overlays/nodeport (instead of k8s/base)
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
|
||||
resources:
|
||||
- ../../base
|
||||
|
||||
patches:
|
||||
- path: service-p2p.yaml
|
||||
@@ -0,0 +1,20 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: allmende-p2p
|
||||
spec:
|
||||
type: NodePort
|
||||
# NodePort traffic that lands on another node is forwarded, so the port also
|
||||
# works when the router points at a node that is not running the pod.
|
||||
externalTrafficPolicy: Cluster
|
||||
ports:
|
||||
- name: p2p-tcp
|
||||
port: 4001
|
||||
targetPort: p2p-tcp
|
||||
protocol: TCP
|
||||
nodePort: 30401
|
||||
- name: p2p-quic
|
||||
port: 4001
|
||||
targetPort: p2p-quic
|
||||
protocol: UDP
|
||||
nodePort: 30401
|
||||
Reference in New Issue
Block a user