Module: INFRA

More observability stack and database runtime

Pigsty has a battery-included, production-ready INFRA module, to provide ultimate observability.


Overview

Each Pigsty deployment requires a set of infrastructure components to work properly. which including:

ComponentPortDomainDescription
Nginx80h.pigstyWeb Service Portal (Also used as Yum Repo)
AlertManager9093a.pigstyAlert Aggregation and delivery
Prometheus9090p.pigstyMonitoring Time Series Database
Grafana3000g.pigstyVisualization Platform
Loki3100-Logging Collection Server
PushGateway3100-Logging Collection Server
BlackboxExporter3100-Logging Collection Server
Dnsmasq53-DNS Server (optional)
Chronyd123-NTP Time Server (optional)
PostgreSQL5432-Pigsty CMDB & default database
Ansible--Run playbooks

Pigsty will set up these components for you on infra nodes. You can expose them to the outside world by configuring the infra_portal parameter.

  1. infra_portal: # domain names and upstream servers
  2. home : { domain: h.pigsty }
  3. grafana : { domain: g.pigsty ,endpoint: "${admin_ip}:3000" , websocket: true }
  4. prometheus : { domain: p.pigsty ,endpoint: "${admin_ip}:9090" }
  5. alertmanager : { domain: a.pigsty ,endpoint: "${admin_ip}:9093" }
  6. blackbox : { endpoint: "${admin_ip}:9115" }
  7. loki : { endpoint: "${admin_ip}:3100" }
  8. minio : { domain: sss.pigsty ,endpoint: "${admin_ip}:9001" ,scheme: https ,websocket: true }

pigsty-infra


Playbooks

  • install.yml : Install Pigsty on current node in one-pass
  • infra.yml : Init pigsty infrastructure on infra nodes
  • infra-rm.yml : Remove infrastructure components from infra nodes

Dashboards


Parameters

API Reference for INFRA module:

  • META: infra meta data
  • CA: self-signed CA
  • INFRA_ID : Portals and identity
  • REPO: local yum repo
  • INFRA_PACKAGE : packages to be installed
  • NGINX : nginx web server
  • DNS: dnsmasq nameserver
  • PROMETHEUS : prometheus, alertmanager, pushgateway & blackbox_exporter
  • GRAFANA : Grafana, the visualization platform
  • LOKI : Loki, the logging server

Parameters

ParameterSectionTypeLevelComment
versionMETAstringGpigsty version string
admin_ipMETAipGadmin node ip address
regionMETAenumGupstream mirror region: default,china,europe
proxy_envMETAdictGglobal proxy env when downloading packages
ca_methodCAenumGcreate,recreate,copy, create by default
ca_cnCAstringGca common name, fixed as pigsty-ca
cert_validityCAintervalGcert validity, 20 years by default
infra_seqINFRA_IDintIinfra node identity, REQUIRED
infra_portalINFRA_IDdictGinfra services exposed via portal
repo_enabledREPOboolG/Icreate a yum repo on this infra node?
repo_homeREPOpathGrepo home dir, /www by default
repo_nameREPOstringGrepo name, pigsty by default
repo_endpointREPOurlGaccess point to this repo by domain or ip:port
repo_removeREPOboolG/Aremove existing upstream repo
repo_upstreamREPOupstream[]Gwhere to download upstream packages
repo_packagesREPOstring[]Gwhich packages to be included
repo_url_packagesREPOstring[]Gextra packages from url
infra_packagesINFRA_PACKAGEstring[]Gpackages to be installed on infra nodes
infra_packages_pipINFRA_PACKAGEstringGpip installed packages for infra nodes
nginx_enabledNGINXboolG/Ienable nginx on this infra node?
nginx_sslmodeNGINXenumGnginx ssl mode? disable,enable,enforce
nginx_homeNGINXpathGnginx content dir, /www by default
nginx_portNGINXportGnginx listen port, 80 by default
nginx_ssl_portNGINXportGnginx ssl listen port, 443 by default
nginx_navbarNGINXindex[]Gnginx index page navigation links
dns_enabledDNSboolG/Isetup dnsmasq on this infra node?
dns_portDNSportGdns server listen port, 53 by default
dns_recordsDNSstring[]Gdynamic dns records resolved by dnsmasq
prometheus_enabledPROMETHEUSboolG/Ienable prometheus on this infra node?
prometheus_cleanPROMETHEUSboolG/Aclean prometheus data during init?
prometheus_dataPROMETHEUSpathGprometheus data dir, /data/prometheus by default
prometheus_sd_intervalPROMETHEUSintervalGprometheus target refresh interval, 5s by default
prometheus_scrape_intervalPROMETHEUSintervalGprometheus scrape & eval interval, 10s by default
prometheus_scrape_timeoutPROMETHEUSintervalGprometheus global scrape timeout, 8s by default
prometheus_optionsPROMETHEUSargGprometheus extra server options
pushgateway_enabledPROMETHEUSboolG/Isetup pushgateway on this infra node?
pushgateway_optionsPROMETHEUSargGpushgateway extra server options
blackbox_enabledPROMETHEUSboolG/Isetup blackbox_exporter on this infra node?
blackbox_optionsPROMETHEUSargGblackbox_exporter extra server options
alertmanager_enabledPROMETHEUSboolG/Isetup alertmanager on this infra node?
alertmanager_optionsPROMETHEUSargGalertmanager extra server options
exporter_metrics_pathPROMETHEUSpathGexporter metric path, /metrics by default
exporter_installPROMETHEUSenumGhow to install exporter? none,yum,binary
exporter_repo_urlPROMETHEUSurlGexporter repo file url if install exporter via yum
grafana_enabledGRAFANAboolG/Ienable grafana on this infra node?
grafana_cleanGRAFANAboolG/Aclean grafana data during init?
grafana_admin_usernameGRAFANAusernameGgrafana admin username, admin by default
grafana_admin_passwordGRAFANApasswordGgrafana admin password, pigsty by default
grafana_plugin_cacheGRAFANApathGpath to grafana plugins cache tarball
grafana_plugin_listGRAFANAstring[]Ggrafana plugins to be downloaded with grafana-cli
loki_enabledLOKIboolG/Ienable loki on this infra node?
loki_cleanLOKIboolG/Awhether remove existing loki data?
loki_dataLOKIpathGloki data dir, /data/loki by default
loki_retentionLOKIintervalGloki log retention period, 15d by default

Last modified 2023-02-27: add v2.0 images and docs (5b09f12)