# yaml-language-server: $schema=https://schema.zeabur.app/template.json
apiVersion: zeabur.com/v1
kind: Template
metadata:
    name: etcd
spec:
    description: A distributed, reliable key-value store for the most critical data of a distributed system
    icon: https://i.imgur.com/jyDr9hI.png
    tags:
        - database
        - key-value
        - distributed
    readme: |
        etcd is a distributed reliable key-value store for the most critical data of a distributed system, with a focus on being:
        - Simple: well-defined, user-facing API (gRPC)
        - Secure: automatic TLS with optional client cert authentication
        - Fast: benchmarked 10,000 writes/sec
        - Reliable: properly distributed using Raft
        - etcd is written in Go and uses the Raft consensus algorithm to manage a highly-available replicated log.
    services:
        - name: etcd
          icon: https://i.imgur.com/jyDr9hI.png
          template: PREBUILT
          spec:
            source:
                image: quay.io/coreos/etcd:v3.5.10
                command:
                    - etcd
                    - --config-file
                    - /etc/etcd/etcd.yml
            ports:
                - id: client
                  port: 2379
                  type: TCP
                - id: peer
                  port: 2380
                  type: TCP
            volumes:
                - id: data
                  dir: /etcd-data
            env:
                ALLOW_NONE_AUTHENTICATION:
                    default: "yes"
            configs:
                - path: /etc/etcd/etcd.yml
                  template: |
                    name: 'etcd0'
                    data-dir: '/etcd-data'
                    listen-client-urls: 'http://0.0.0.0:2379'
                    advertise-client-urls: 'http://0.0.0.0:2379'
                    listen-peer-urls: 'http://0.0.0.0:2380'
                    initial-advertise-peer-urls: 'http://0.0.0.0:2380'
                    initial-cluster: 'etcd0=http://0.0.0.0:2380'
                    initial-cluster-token: 'etcd-cluster-1'
                    initial-cluster-state: 'new'
                  permission: null
                  envsubst: null
