# PO chart 的部分内容 ## AdditionalScrapeConfigs allows specifying additional Prometheus scrape configurations. Scrape configurations ## are appended to the configurations generated by the Prometheus Operator. Job configurations must have the form ## as specified in the official Prometheus documentation: ## https://prometheus.io/docs/prometheus/latest/configuration/configuration/#<scrape_config>. As scrape configs are ## appended, the user is responsible to make sure it is valid. Note that using this feature may expose the possibility ## to break upgrades of Prometheus. It is advised to review Prometheus release notes to ensure that no incompatible ## scrape configs are going to break Prometheus after the upgrade. ## ## The scrape configuraiton example below will find master nodes, provided they have the name .*mst.*, relabel the ## port to 2379 and allow etcd scraping provided it is running on all Kubernetes master nodes ## additionalScrapeConfigs: -job_name:kubernetes-cadvisor kubernetes_sd_configs: -role:node scheme:https tls_config: ca_file:/var/run/secrets/kubernetes.io/serviceaccount/ca.crt bearer_token_file:/var/run/secrets/kubernetes.io/serviceaccount/token relabel_configs: -action:labelmap regex:__meta_kubernetes_node_label_(.+) -target_label:__address__ replacement:kubernetes.default.svc:443 -source_labels: [__meta_kubernetes_node_name] regex:(.+) target_label:__metrics_path__ replacement:/api/v1/nodes/${1}/proxy/metrics/cadvisor metric_relabel_configs: -action:replace source_labels: [id] regex:'^/machine\.slice/machine-rkt\\x2d([^\\]+)\\.+/([^/]+)\.service$' target_label:rkt_container_name replacement:'${2}-${1}' -action:replace source_labels: [id] regex:'^/system\.slice/(.+)\.service$' target_label:systemd_service_name replacement:'${1}' # - job_name: kube-etcd # kubernetes_sd_configs: # - role: node # scheme: https # tls_config: # ca_file: /etc/prometheus/secrets/etcd-client-cert/etcd-ca # cert_file: /etc/prometheus/secrets/etcd-client-cert/etcd-client # key_file: /etc/prometheus/secrets/etcd-client-cert/etcd-client-key # relabel_configs: # - action: labelmap # regex: __meta_kubernetes_node_label_(.+) # - source_labels: [__address__] # action: replace # target_label: __address__ # regex: ([^:;]+):(\d+) # replacement: ${1}:2379 # - source_labels: [__meta_kubernetes_node_name] # action: keep # regex: .*mst.* # - source_labels: [__meta_kubernetes_node_name] # action: replace # target_label: node # regex: (.*) # replacement: ${1} # metric_relabel_configs: # - regex: (kubernetes_io_hostname|failure_domain_beta_kubernetes_io_region|beta_kubernetes_io_os|beta_kubernetes_io_arch|beta_kubernetes_io_instance_type|failure_domain_beta_kubernetes_io_zone) # action: labeldrop