Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How pushgateway on K8s deploys yaml

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report