apiVersion: k3d.io/v1alpha5
kind: Simple
metadata:
  name: easyai-acceptance-local
servers: 3
agents: 0
image: EASYAI_ACCEPTANCE_K3S_IMAGE
subnet: EASYAI_ACCEPTANCE_CLUSTER_SUBNET
kubeAPI:
  host: 127.0.0.1
  hostPort: "16550"
ports:
  - port: 18443:31088
    nodeFilters:
      - server:0
  - port: 19443:31089
    nodeFilters:
      - server:1
volumes:
  - volume: EASYAI_ACCEPTANCE_MEDIA_DIR:/var/lib/easyai-acceptance/media
    nodeFilters:
      - server:*
  - volume: easyai-acceptance-local-server-0-etcd:/var/lib/rancher/k3s/server/db
    nodeFilters:
      - server:0
  - volume: easyai-acceptance-local-server-1-etcd:/var/lib/rancher/k3s/server/db
    nodeFilters:
      - server:1
  - volume: easyai-acceptance-local-server-2-etcd:/var/lib/rancher/k3s/server/db
    nodeFilters:
      - server:2
  - volume: easyai-acceptance-local-server-0-storage:/var/lib/rancher/k3s/storage
    nodeFilters:
      - server:0
  - volume: easyai-acceptance-local-server-1-storage:/var/lib/rancher/k3s/storage
    nodeFilters:
      - server:1
options:
  k3s:
    extraArgs:
      - arg: --disable=traefik
        nodeFilters:
          - server:*
      - arg: --disable=servicelb
        nodeFilters:
          - server:*
      - arg: --node-label=easyai.io/site=ningbo
        nodeFilters:
          - server:0
      - arg: --node-label=easyai.io/site=hongkong
        nodeFilters:
          - server:1
      - arg: --node-label=easyai.io/site=los-angeles
        nodeFilters:
          - server:2
      - arg: --node-label=easyai.io/workload=true
        nodeFilters:
          - server:0
          - server:1
      - arg: --node-label=easyai.io/worker=true
        nodeFilters:
          - server:0
          - server:1
      - arg: --node-label=easyai.io/database=true
        nodeFilters:
          - server:0
          - server:1
      - arg: --node-taint=easyai.io/control-plane-only=true:NoSchedule
        nodeFilters:
          - server:2
      - arg: --kubelet-arg=system-reserved=cpu=EASYAI_ACCEPTANCE_SITE_SYSTEM_CPU,memory=EASYAI_ACCEPTANCE_SITE_SYSTEM_MEMORY
        nodeFilters:
          - server:0
          - server:1
      - arg: --kubelet-arg=kube-reserved=cpu=250m,memory=512Mi
        nodeFilters:
          - server:0
          - server:1
      - arg: --kubelet-arg=system-reserved=cpu=EASYAI_ACCEPTANCE_WITNESS_SYSTEM_CPU,memory=EASYAI_ACCEPTANCE_WITNESS_SYSTEM_MEMORY
        nodeFilters:
          - server:2
      - arg: --kubelet-arg=kube-reserved=cpu=250m,memory=512Mi
        nodeFilters:
          - server:2
      - arg: --kubelet-arg=eviction-hard=memory.available<512Mi,nodefs.available<10%
        nodeFilters:
          - server:*
