Version v2.7.0 of the documentation is no longer actively maintained. The site that you are currently viewing is an archived snapshot. For up-to-date documentation, see the latest version.
Module: INFRA
Pigsty has a battery-included, production-ready INFRA module, to provide ultimate observability.
Configuration | Administration | Playbook | Dashboard | Parameter
Overview
Each Pigsty deployment requires a set of infrastructure components to work properly. which including:
| Component | Port | Domain | Description |
|---|---|---|---|
| Nginx | 80 | h.pigsty |
Web Service Portal (YUM/APT Repo) |
| AlertManager | 9093 | a.pigsty |
Alert Aggregation and delivery |
| Prometheus | 9090 | p.pigsty |
Monitoring Time Series Database |
| Grafana | 3000 | g.pigsty |
Visualization Platform |
| Loki | 3100 | - | Logging Collection Server |
| PushGateway | 9091 | - | Collect One-Time Job Metrics |
| BlackboxExporter | 9115 | - | Blackbox Probing |
| Dnsmasq | 53 | - | DNS Server |
| Chronyd | 123 | - | NTP Time Server |
| PostgreSQL | 5432 | - | 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.
Configuration
To define an infra cluster, use the hard-coded group name infra in your inventory file.
You can use multiple nodes to deploy INFRA module, but at least one is required. You have to assign a unique infra_seq to each node.
Then you can init INFRA module with infra.yml playbook.
Administration
Here are some administration tasks related to INFRA module:
Install/Remove Infra Module
Manage Local Software Repo
Manage Infra Component
您可以使用以下剧本子任务,管理 Infra节点 上的各个基础设施组件
Playbook
install.yml: Install Pigsty on all nodes in one-passinfra.yml: Init pigsty infrastructure on infra nodesinfra-rm.yml: Remove infrastructure components from infra nodes
infra.yml
The playbook infra.yml will init pigsty infrastructure on infra nodes.
It will also install NODE module on infra nodes too.
Here are available subtasks:
infra-rm.yml
The playbook infra-rm.yml will remove infrastructure components from infra nodes
install.yml
The playbook install.yml will install Pigsty on all node in one-pass.
Check Playbook: One-Pass Install for details.
Dashboard
Pigsty Home : Home dashboard for pigsty’s grafana
INFRA Overview : Overview of all infra components
Nginx Overview : Nginx metrics & logs
Grafana Overview: Grafana metrics & logs
Prometheus Overview: Prometheus metrics & logs
Loki Overview: Loki metrics & logs
Logs Instance: Logs for a single instance
Logs Overview: Overview of all logs
CMDB Overview: CMDB visualization
ETCD Overview: etcd metrics & logs
Parameter
API Reference for INFRA module:
META: infra meta dataCA: self-signed CAINFRA_ID: Portals and identityREPO: local yum/atp repoINFRA_PACKAGE: packages to be installedNGINX: nginx web serverDNS: dnsmasq nameserverPROMETHEUS: prometheus, alertmanager, pushgateway & blackbox_exporterGRAFANA: Grafana, the visualization platformLOKI: Loki, the logging server
Parameters
| Parameter | Section | Type | Level | Comment |
|---|---|---|---|---|
version |
META |
string | G | pigsty version string |
admin_ip |
META |
ip | G | admin node ip address |
region |
META |
enum | G | upstream mirror region: default,china,europe |
proxy_env |
META |
dict | G | global proxy env when downloading packages |
ca_method |
CA |
enum | G | create,recreate,copy, create by default |
ca_cn |
CA |
string | G | ca common name, fixed as pigsty-ca |
cert_validity |
CA |
interval | G | cert validity, 20 years by default |
infra_seq |
INFRA_ID |
int | I | infra node identity, REQUIRED |
infra_portal |
INFRA_ID |
dict | G | infra services exposed via portal |
repo_enabled |
REPO |
bool | G/I | create a yum/apt repo on this infra node? |
repo_home |
REPO |
path | G | repo home dir, /www by default |
repo_name |
REPO |
string | G | repo name, pigsty by default |
repo_endpoint |
REPO |
url | G | access point to this repo by domain or ip:port |
repo_remove |
REPO |
bool | G/A | remove existing upstream repo |
repo_modules |
REPO |
string | G/A | which repo modules are installed in repo_upstream |
repo_upstream |
REPO |
upstream[] | G | where to download upstream packages |
repo_packages |
REPO |
string[] | G | which packages to be included |
repo_url_packages |
REPO |
string[] | G | extra packages from url |
infra_packages |
INFRA_PACKAGE |
string[] | G | packages to be installed on infra nodes |
infra_packages_pip |
INFRA_PACKAGE |
string | G | pip installed packages for infra nodes |
nginx_enabled |
NGINX |
bool | G/I | enable nginx on this infra node? |
nginx_exporter_enabled |
NGINX |
bool | G/I | enable nginx_exporter on this infra node? |
nginx_sslmode |
NGINX |
enum | G | nginx ssl mode? disable,enable,enforce |
nginx_home |
NGINX |
path | G | nginx content dir, /www by default |
nginx_port |
NGINX |
port | G | nginx listen port, 80 by default |
nginx_ssl_port |
NGINX |
port | G | nginx ssl listen port, 443 by default |
nginx_navbar |
NGINX |
index[] | G | nginx index page navigation links |
dns_enabled |
DNS |
bool | G/I | setup dnsmasq on this infra node? |
dns_port |
DNS |
port | G | dns server listen port, 53 by default |
dns_records |
DNS |
string[] | G | dynamic dns records resolved by dnsmasq |
prometheus_enabled |
PROMETHEUS |
bool | G/I | enable prometheus on this infra node? |
prometheus_clean |
PROMETHEUS |
bool | G/A | clean prometheus data during init? |
prometheus_data |
PROMETHEUS |
path | G | prometheus data dir, /data/prometheus by default |
prometheus_sd_dir |
PROMETHEUS |
path | G | prometheus file service discovery directory |
prometheus_sd_interval |
PROMETHEUS |
interval | G | prometheus target refresh interval, 5s by default |
prometheus_scrape_interval |
PROMETHEUS |
interval | G | prometheus scrape & eval interval, 10s by default |
prometheus_scrape_timeout |
PROMETHEUS |
interval | G | prometheus global scrape timeout, 8s by default |
prometheus_options |
PROMETHEUS |
arg | G | prometheus extra server options |
pushgateway_enabled |
PROMETHEUS |
bool | G/I | setup pushgateway on this infra node? |
pushgateway_options |
PROMETHEUS |
arg | G | pushgateway extra server options |
blackbox_enabled |
PROMETHEUS |
bool | G/I | setup blackbox_exporter on this infra node? |
blackbox_options |
PROMETHEUS |
arg | G | blackbox_exporter extra server options |
alertmanager_enabled |
PROMETHEUS |
bool | G/I | setup alertmanager on this infra node? |
alertmanager_options |
PROMETHEUS |
arg | G | alertmanager extra server options |
exporter_metrics_path |
PROMETHEUS |
path | G | exporter metric path, /metrics by default |
exporter_install |
PROMETHEUS |
enum | G | how to install exporter? none,yum,binary |
exporter_repo_url |
PROMETHEUS |
url | G | exporter repo file url if install exporter via yum |
grafana_enabled |
GRAFANA |
bool | G/I | enable grafana on this infra node? |
grafana_clean |
GRAFANA |
bool | G/A | clean grafana data during init? |
grafana_admin_username |
GRAFANA |
username | G | grafana admin username, admin by default |
grafana_admin_password |
GRAFANA |
password | G | grafana admin password, pigsty by default |
grafana_plugin_cache |
GRAFANA |
path | G | path to grafana plugins cache tarball |
grafana_plugin_list |
GRAFANA |
string[] | G | grafana plugins to be downloaded with grafana-cli |
loki_enabled |
LOKI |
bool | G/I | enable loki on this infra node? |
loki_clean |
LOKI |
bool | G/A | whether remove existing loki data? |
loki_data |
LOKI |
path | G | loki data dir, /data/loki by default |
loki_retention |
LOKI |
interval | G | loki log retention period, 15d by default |










