---
#==============================================================#
# File      :   deepflow.yml
# Desc      :   observability config for running DeepFlow stack
# Ctime     :   2026-02-04
# Mtime     :   2026-02-04
# License   :   Apache-2.0 @ https://pigsty.io/docs/about/license/
#==============================================================#

# how to use this template:
#
#  curl -fsSL https://repo.pigsty.io/get | bash; cd ~/pigsty
# ./bootstrap                  # prepare local repo & ansible
# ./configure -c deepflow/deepflow  # use this deepflow config template
# vi pigsty.yml                # IMPORTANT: CHANGE CREDENTIALS / DOMAIN
# ./deploy.yml                 # install infra stack
# ./docker.yml                 # install docker & docker-compose
# ./deepflow.yml               # install deepflow with compose + optional connector/agent

all:
  children:

    deepflow:
      hosts: { 10.10.10.10: {} }
      vars:
        deepflow_enabled: true
        deepflow_mysql_enabled: true
        deepflow_clickhouse_s3_enabled: true
        deepflow_connector_enabled: true
        deepflow_agent_enabled: false

        deepflow_deploy_profile: lite
        deepflow_storage_mode: short_ttl

        deepflow_data: /data/deepflow

        # role: deepflow_mysql
        deepflow_mysql_port: 13306
        deepflow_mysql_root_password: DeepFlow.Root.ChangeMe
        deepflow_mysql_user: deepflow
        deepflow_mysql_password: DeepFlow.MySQL.ChangeMe
        deepflow_mysql_database: deepflow

        # role: deepflow_clickhouse_s3
        deepflow_clickhouse_http_port: 18123
        deepflow_clickhouse_tcp_port: 19000
        deepflow_clickhouse_retention_hours: 24
        deepflow_s3_enabled: false
        deepflow_minio_api_port: 19090
        deepflow_minio_console_port: 19091
        deepflow_s3_bucket: deepflow
        deepflow_s3_access_key: deepflow
        deepflow_s3_secret_key: DeepFlow.S3.ChangeMe
        deepflow_s3_region: us-east-1

        # role: deepflow_server
        deepflow_server_grpc_port: 20035
        deepflow_server_http_port: 20417
        deepflow_app_port: 20880
        deepflow_clickhouse_addr: host.docker.internal:19000
        deepflow_s3_endpoint: http://host.docker.internal:19090
        deepflow_mysql_addr: host.docker.internal:13306
        deepflow_l4_log_ttl_hour: 24
        deepflow_l7_log_ttl_hour: 24
        deepflow_flow_metrics_ttl_hour: 24
        deepflow_metrics_ttl_hour: 24
        deepflow_prometheus_ttl_hour: 24

        # role: deepflow_connector
        deepflow_connector_source_endpoint: http://127.0.0.1:20417/metrics
        deepflow_connector_remote_write_url: http://127.0.0.1:8428/api/v1/write

        # role: deepflow_agent
        deepflow_agent_mode: binary
        deepflow_agent_profile: lite
        deepflow_agent_disable_pcap: false
        deepflow_agent_disable_vector: true
        deepflow_agent_grpc_endpoint: "{{ deepflow_grpc_domain }}:443"

    infra: { hosts: { 10.10.10.10: { infra_seq: 1 } } }
    etcd:  { hosts: { 10.10.10.10: { etcd_seq: 1 } }, vars: { etcd_cluster: etcd } }

  vars:
    version: v4.0.0
    admin_ip: 10.10.10.10
    region: default
    node_tune: oltp
    pg_conf: oltp.yml
    docker_enabled: true

    # Caddy gRPC ingress for deepflow-agent:
    caddy_enabled: true
    deepflow_grpc_enabled: true
    deepflow_grpc_domain: deepflow-agent.pigsty
    deepflow_grpc_upstream: 127.0.0.1:20035

    infra_portal:
      home     : { domain: svc.plus }
      deepflow : { domain: deepflow.pigsty ,endpoint: "10.10.10.10:20880" }

    proxy_env:
      no_proxy: "localhost,127.0.0.1,10.0.0.0/8,192.168.0.0/16,*.pigsty,*.aliyun.com,mirrors.*,*.tsinghua.edu.cn"

    repo_enabled: false
    node_repo_modules: node,infra,pgsql

    grafana_admin_password: pigsty
    grafana_view_password: DBUser.Viewer
    pg_admin_password: DBUser.DBA
    pg_monitor_password: DBUser.Monitor
    pg_replication_password: DBUser.Replicator
    patroni_password: Patroni.API
    haproxy_admin_password: pigsty
    minio_secret_key: S3User.MinIO
    etcd_root_password: Etcd.Root
