高级部署 
社区提供的各种部署方法的示例和模板。
Ansible 
我们推荐使用 community.beszel Ansible 集合。
感谢 dbrennand 和所有贡献者维护这个集合。
其他有用的示例请在 GitHub 的此讨论 中查看。
Docker Swarm 
推荐的方法是分别定义每个代理,并将其约束到唯一的主机/端口。
更多信息请在 GitHub 问题中搜索 "swarm",或查看 aeoneros 的示例:
https://wiki.aeoneros.com/books/beszel/page/quickstart-guide
x-common-config: &common-config
  image: henrygd/beszel-agent:latest
  restart: unless-stopped
  network_mode: host
  volumes:
    - /var/run/docker.sock:/var/run/docker.sock:ro
  environment:
    KEY: 'YOUR_PUBLIC_KEY_FROM_HUB'
  deploy: &common-deploy
    mode: replicated
    replicas: 1
services:
  beszel-agent1:
    <<: *common-config
    ports:
      - 45876:45876
    environment:
      <<: *common-config.environment
      LISTEN: '45876'
    deploy:
      <<: *common-deploy
      placement:
        constraints:
          - node.hostname == host-one
  beszel-agent2:
    <<: *common-config
    ports:
      - 45877:45877
    environment:
      <<: *common-config.environment
      LISTEN: '45877'
    deploy:
      <<: *common-deploy
      placement:
        constraints:
          - node.hostname == host-twoHashiCorp Nomad 
blinkinglight 在以下文章中提供了一个 Nomad 配置示例:
https://dev.to/blinkinglight/tailscale-and-beszel-on-hashicorp-nomad-1jmo
Kubernetes 
来源讨论
以下内容由 nodesocket 在 GitHub 的此讨论 中分享。
Hub 
使用标准的 Kubernetes Deployment 并通过负载均衡服务或 Ingress 暴露。Hub 不需要特殊配置。
代理 
使用 Kubernetes DaemonSet(自动在每个节点上部署一个 Pod),然后添加 tolerations 以允许部署到主节点/控制平面节点。最后,需要一些额外的网络属性,例如 hostNetwork 和 ports。
示例代理 DaemonSet YAML 
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: beszel-agent
  namespace: default
spec:
  selector:
    matchLabels:
      app: beszel-agent
  template:
    metadata:
      labels:
        app: beszel-agent
    spec:
      hostNetwork: true
      containers:
        - env:
            - name: LISTEN
              value: "45876"
            - name: KEY
              value: "YOUR-KEY-HERE"
          image: henrygd/beszel-agent:latest
          imagePullPolicy: Always
          name: beszel-agent
          ports:
            - containerPort: 45876
              hostPort: 45876
      restartPolicy: Always
      tolerations:
        - effect: NoSchedule
          key: node-role.kubernetes.io/master
          operator: Exists
        - effect: NoSchedule
          key: node-role.kubernetes.io/control-plane
          operator: Exists
  updateStrategy:
    rollingUpdate:
      maxSurge: 0
      maxUnavailable: 100%
    type: RollingUpdate将系统添加到 Beszel 
由于我们使用了 hostNetwork: true,因此在添加系统时需要使用 Kubernetes 节点的 IP 地址。注意:这不是 Kubernetes 内部 IP,而是节点本身的物理 IP。 每个 Kubernetes 节点只运行一个代理 Pod,因此这种方法有效。
关于 WebSocket 超时的说明 
当在代理上使用由 Ingress 控制器(如 NGINX)提供服务的 Beszel Hub 地址(HUB_URL)时,请确保增加代理读取/发送超时时间。否则连接会定期中止,您的节点将被报告为离线。
对于 Kubernetes NGINX Ingress 控制器,添加 proxy-read-timeout 和 proxy-send-timeout 注解。
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
    nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"