name: k3s
services:
  k3s:
    image: rancher/k3s:v1.31.2-k3s1
    command: server ${SERVICE_ARGS:-""} --disable agent --disable traefik
    restart: always
    network_mode: host
    hostname: k3s
    privileged: true
    volumes:
      - data:/var/lib/rancher/k3s
    configs:
      - source: registries.yaml
        target: /etc/rancher/k3s/registries.yaml
      - source: config.yaml
        target: /etc/rancher/k3s/config.yaml
volumes:
  data:
configs:
  registries.yaml:
    content: |
      ${REGISTRY_YAML}
  config.yaml:
    content: |
      ${CONFIG_YAML}