Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How pushgateway on K8s deploys yaml

Shulou Source: shulou.com Published: 2022-06-01 12:47:12 09月26日 Update

Pushgateway on K8s is how to deploy yaml, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.

Pushgateway on K8s deployment yaml file for yamlprometheus pushgateway deployment

Contents of the deployment file of pushgateway

ApiVersion: apps/v1beta2kind: Deploymentmetadata: namespace: kube-ops name: pushgateway-ttt labels: app: pushgateway-ttt annotations: prometheus.io/scrape: "true" prometheus.io/port: "8080" spec: replicas: 1 revisionHistoryLimit: 0 selector: matchLabels: app: pushgateway-ttt strategy: type: RollingUpdate rollingUpdate: maxSurge: "25" maxUnavailable: "25" template: metadata: Name: pushgateway-ttt labels: app: pushgateway-ttt spec: containers:-name: pushgateway-ttt image: prom/pushgateway:v0.7.0 imagePullPolicy: IfNotPresent livenessProbe: initialDelaySeconds: 600 periodSeconds: 10 successThreshold: 1 failureThreshold: 10 httpGet: path: / Port: 9091 ports:-name: "app-port" containerPort: 9091 resources: limits: memory: "1000Mi" cpu: 1 requests: memory: "1000Mi" cpu: 1

Prom/pushgateway can find the dockerfile file and deployment instructions in hub.docker.io. The startup parameters, such as persistence.file, can be added to spec.args to take effect.

All startup parameters:

-- web.listen-address default:9091--web.telemetry-path default:/metrics--web.route-prefix default: "--persistence.file default:"-- persistence.interval default: 5m

Parameter description address

Contents of the service file of pushgateway

ApiVersion: v1kind: Servicemetadata: name: pushgateway-ttt namespace: kube-ops labels: app: pushgateway-tttspec: selector: app: pushgateway-ttt # type: NodePort ports:-name: pushgateway-ttt port: 9091 targetPort: 9091

Contents of the ingress file of pushgateway

ApiVersion: extensions/v1beta1kind: Ingressmetadata: name: pushgateway-ingress namespace: kube-ops annotations: kubernetes.io/ingress.class: nginxspec: rules:-host: push-prometheus.ttt.mucang.cn http: paths:-path: / backend: serviceName: pushgateway-ttt servicePort: 9091 configure pushgateway and pull pushgateway data configuration in Prometheus # pull pushgateway component configuration in prometheus configuration file-job_name : 'pushgateway' scrape_interval: 60s metrics_path: / metrics static_configs:-targets: ["push-prometheus.xxx.xx.xx] # deployment configuration file configuration environment variable for prometheus In this way, prometheus will go to the data cached by pull pushgateway # all the data pushed to pushgateway will be reflected in the / metrics API. Is it helpful for you to see the above? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Tags: Files configuration content parameters data help clarity variables addresses this interfaces articles novices more environment knowledge components caching industry information Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info Redmi OPPO Reno Xiaomi Linux