问题描述
我正在尝试用运算符在全新的新k8s集群中创建普罗米修斯我使用以下文件,
I'm trying to create prometheus with operator in fresh new k8s clusterI use the following files ,
- 我正在创建名称空间监视
- 应用此文件,该文件可以正常工作
apiVersion: apps/v1beta2
kind: Deployment
metadata:
labels:
k8s-app: prometheus-operator
name: prometheus-operator
namespace: monitoring
spec:
replicas: 2
selector:
matchLabels:
k8s-app: prometheus-operator
template:
metadata:
labels:
k8s-app: prometheus-operator
spec:
priorityClassName: "operator-critical"
tolerations:
- key: "WorkGroup"
operator: "Equal"
value: "operator"
effect: "NoSchedule"
- key: "WorkGroup"
operator: "Equal"
value: "operator"
effect: "NoExecute"
containers:
- args:
- --kubelet-service=kube-system/kubelet
- --logtostderr=true
- --config-reloader-image=quay.io/coreos/configmap-reload:v0.0.1
- --prometheus-config-reloader=quay.io/coreos/prometheus-config-reloader:v0.29.0
image: quay.io/coreos/prometheus-operator:v0.29.0
name: prometheus-operator
ports:
- containerPort: 8080
name: http
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
nodeSelector:
serviceAccountName: prometheus-operator
现在我要应用此文件(CRD)
Now I want to apply this file (CRD)
apiVersion: monitoring.coreos.com/v1
kind: Prometheus
metadata:
name: prometheus
namespace: monitoring
labels:
prometheus: prometheus
spec:
replica: 1
priorityClassName: "operator-critical"
serviceAccountName: prometheus
nodeSelector:
worker.garden.sapcloud.io/group: operator
serviceMonitorNamespaceSelector: {}
serviceMonitorSelector:
matchLabels:
role: observeable
tolerations:
- key: "WorkGroup"
operator: "Equal"
value: "operator"
effect: "NoSchedule"
- key: "WorkGroup"
operator: "Equal"
value: "operator"
effect: "NoExecute"
在创建这些CRD之前
https://github.com/coreos /prometheus-operator/tree/master/example/prometheus-operator-crd
吊舱无法启动的问题(0/2),请参见下图.可能是什么问题呢?请指教
The problem that the pods didn't able to start (0/2), see the picture below. What could be the problem? please advice
更新
当我去参加舞会的时候,我看到以下错误creating: pods "prometheus-operator-6944778645-" is forbidden: no PriorityClass with name operator-critical was found replicaset-controller
,你知道吗?
when I go to the event of the prom operator I see the following Error creating: pods "prometheus-operator-6944778645-" is forbidden: no PriorityClass with name operator-critical was found replicaset-controller
, any idea ?
推荐答案
您正在尝试引用operator-critical
优先级.优先级类别确定Pod的优先级及其资源分配.
You are trying to reference the operator-critical
priority class. Priority classes determine the priority of pods and their resource assignment.
要解决此问题,您可以删除两个文件中的显式优先级类(priorityClassName: "operator-critical"
)或创建operator-critical
类:
To fix this issue you could either remove the explicit priority class(priorityClassName: "operator-critical"
) in both files or create the operator-critical
class:
apiVersion: scheduling.k8s.io/v1beta1
kind: PriorityClass
metadata:
name: operator-critical
value: 1000000
globalDefault: false
description: "Critical operator workloads"
这篇关于为什么普罗米修斯操作员无法启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!