【问题标题】:Deploy peromethues in new cluster crd issue在新的集群 crd 问题中部署 peromethues
【发布时间】:2019-08-04 03:10:56
【问题描述】:

我正在尝试在全新的 k8s 集群中使用操作员创建 prometheus 我使用以下文件,

  1. 第一步我要创建一个命名空间监控
  2. 应用这个文件,就可以了

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)

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"

我得到了错误:

error: unable to recognize "1500-prometheus-crd.yaml": no matches for kind "Prometheus" in version "monitoring.coreos.com/v1"

我找到了这个 https://github.com/coreos/prometheus-operator/issues/1866 ,但我尝试按照上面提到的那样去做,即 等待几秒钟并再次部署,但它没有帮助。任何想法 ?

还尝试删除 ns 并使用配置再次创建它,但我遇到了同样的问题。请指教

【问题讨论】:

    标签: amazon-web-services kubernetes google-cloud-platform prometheus prometheus-operator


    【解决方案1】:

    您需要先将 custom resources 安装为 Kubernetes 中的可用对象,然后才能创建它们的实例。

    【讨论】:

    • 算子上一版本有回滚吗?在操作员的 0.28 版本中,它包含在操作员中......即使它需要大约 1 分钟才能可用......
    • 感谢您的回答,现在我有关于同一主题的其他问题,您能帮忙吗?stackoverflow.com/questions/55165961/…
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-08-25
    • 1970-01-01
    • 2021-05-19
    • 1970-01-01
    相关资源
    最近更新 更多