kubernetes-handbook/manifests/HPA/sample-prometheus-instance....

75 lines
1.3 KiB
YAML
Raw Normal View History

2017-11-27 19:36:05 +08:00
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: prometheus
rules:
- apiGroups:
- ""
resources:
- nodes
- services
- endpoints
- pods
verbs:
- get
- list
- watch
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: prometheus
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: prometheus
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: prometheus
subjects:
- kind: ServiceAccount
name: prometheus
namespace: default
---
2017-12-13 23:05:05 +08:00
apiVersion: monitoring.coreos.com/v1
2017-11-27 19:36:05 +08:00
kind: Prometheus
metadata:
name: sample-metrics-prom
labels:
app: sample-metrics-prom
prometheus: sample-metrics-prom
spec:
replicas: 1
2017-12-13 23:05:05 +08:00
baseImage: sz-pg-oam-docker-hub-001.tendcloud.com/library/prometheus
2017-11-27 19:36:05 +08:00
version: v1.7.1
serviceAccountName: prometheus
serviceMonitorSelector:
matchLabels:
service-monitor: function
resources:
requests:
memory: 300Mi
#storage:
# resources:
# requests:
# storage: 3Gi
---
apiVersion: v1
kind: Service
metadata:
name: sample-metrics-prom
labels:
app: sample-metrics-prom
prometheus: sample-metrics-prom
spec:
type: NodePort
ports:
- name: web
nodePort: 30999
port: 9090
targetPort: web
selector:
prometheus: sample-metrics-prom