代码拉取完成,页面将自动刷新
同步操作将从 cuiliang/thanos-install 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
apiVersion: v1
kind: Service
metadata:
name: prometheus-headless
namespace: thanos
labels:
app: prometheus
spec:
type: ClusterIP
clusterIP: None
selector:
app: prometheus
ports:
- name: web
port: 9090
targetPort: web
- name: grpc
port: 10901
targetPort: grpc
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: prometheus
namespace: thanos
labels:
app: prometheus
spec:
serviceName: prometheus-headless
podManagementPolicy: Parallel
replicas: 2
selector:
matchLabels:
app: prometheus
template:
metadata:
labels:
app: prometheus
spec:
serviceAccountName: prometheus
securityContext:
runAsUser: 0
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app
operator: In
values:
- prometheus
topologyKey: kubernetes.io/hostname
containers:
- name: prometheus
image: harbor.com/prometheus/prometheus:v2.42.0
imagePullPolicy: IfNotPresent
resources:
limits:
memory: "32Gi"
cpu: "8"
requests:
memory: "128Mi"
cpu: "100m"
args:
- --config.file=/etc/prometheus/config_out/prometheus.yaml
- --storage.tsdb.path=/prometheus
- --storage.tsdb.retention.time=4h # tsdb本地数据存放天数
- --storage.tsdb.no-lockfile # 允许重叠的块,从而启用垂直压缩和垂直查询合并
- --storage.tsdb.min-block-duration=2h #每2h生成一个 TSDB 数据块
- --storage.tsdb.max-block-duration=2h
- --web.route-prefix=/ # URL路径前缀
- --web.enable-admin-api # 通过一些命令去管理数据
- --web.enable-lifecycle # 支持热更新 localhost:9090/-/reload 加载
- --log.level=debug
ports:
- containerPort: 9090
name: web
protocol: TCP
livenessProbe:
failureThreshold: 6
httpGet:
path: /-/healthy
port: web
scheme: HTTP
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 3
readinessProbe:
failureThreshold: 120
httpGet:
path: /-/ready
port: web
scheme: HTTP
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 3
volumeMounts:
- name: prometheus-config-out
mountPath: /etc/prometheus/config_out
- name: prometheus-rule
mountPath: /etc/prometheus/rules
- name: etcd-ssl
mountPath: /var/run/secrets/etcd
- name: thanos-data
mountPath: /prometheus
- name: sidecar
image: harbor.com/prometheus/thanos:v0.30.2
imagePullPolicy: IfNotPresent
resources:
limits:
memory: "8Gi"
cpu: "4"
requests:
memory: "128Mi"
cpu: "100m"
args:
- sidecar
- --log.level=debug
- --tsdb.path=/prometheus
- --prometheus.url=http://127.0.0.1:9090
- --objstore.config-file=/etc/thanos/storage.yaml
- --reloader.config-file=/etc/prometheus/config/prometheus.yaml.tmpl
- --reloader.config-envsubst-file=/etc/prometheus/config_out/prometheus.yaml
- --reloader.rule-dir=/etc/prometheus/rules/
ports:
- name: http-sidecar
containerPort: 10902
- name: grpc
containerPort: 10901
livenessProbe:
httpGet:
port: http-sidecar
path: /-/healthy
readinessProbe:
httpGet:
port: http-sidecar
path: /-/ready
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: CLUSTER
value: "shanghai-prod"
volumeMounts:
- name: prometheus-config
mountPath: /etc/prometheus/config
- name: prometheus-config-out
mountPath: /etc/prometheus/config_out
- name: thanos-data
mountPath: /prometheus
- name: prometheus-rule
mountPath: /etc/prometheus/rules
- name: thanos-storage-config
subPath: storage.yaml
mountPath: /etc/thanos/storage.yaml
volumes:
- name: prometheus-config
configMap:
name: prometheus-config
- name: prometheus-config-out
emptyDir: {}
- name: thanos-data
emptyDir: {}
- name: prometheus-rule
configMap:
name: prometheus-rule
- name: etcd-ssl
secret:
secretName: etcd-ssl
items:
- key: tls.key
path: tls.key
- key: tls.crt
path: tls.crt
- name: thanos-storage-config
secret:
secretName: thanos-objectstorage
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。