在K8上部署心跳时,我收到“错误:在版本”v1“中的部署无法作为部署处理:无法解析数量的后缀”“

ee7vknir  于 2022-09-20  发布在  Kubernetes
关注(0)|答案(0)|浏览(125)

大家好,我正在尝试在Kubernetes上部署心跳,以监控Kubernetes组件。

我从官方的弹性文档中获得了YAML文件。yaml file

以下是完整的配置文件:

apiVersion: apps/v1
  kind: Deployment
  metadata:
    name: heartbeat
    namespace: kube-system
    labels:
      k8s-app: heartbeat
  spec:
    selector:
      matchLabels:
        k8s-app: heartbeat
    template:
      metadata:
        labels:
          k8s-app: heartbeat
      spec:
        serviceAccountName: heartbeat
        hostNetwork: true
        dnsPolicy: ClusterFirstWithHostNet
        containers:
        - name: heartbeat
          image: docker.elastic.co/beats/heartbeat:7.17.6
          args: [
            "-c", "/etc/heartbeat.yml",
            "-e",
          ]
          env:

          - name: NODE_NAME
            valueFrom:
              fieldRef:
                fieldPath: spec.nodeName
          securityContext:
            runAsUser: 0
          resources:
            limits:
              memory: 1536mi
            requests:
          # for synthetics, 2 full cores is a good starting point for 
         relatively consistent perform of a single concurrent check
        # For lightweight checks as low as 100m is fine
              cpu: 2000m 
        # A high value like this is encouraged for browser based 
        monitors. 
        # Lightweight checks use substantially less, even 128Mi is fine 
        for those.
              memory: 1536Mi 
          volumeMounts:
          - name: config
            mountPath: /etc/heartbeat.yml
            readOnly: true
            subPath: heartbeat.yml
          - name: data
            mountPath: /usr/share/heartbeat/data
        volumes:
        - name: config
          configMap:
            defaultMode: 0600
            name: heartbeat-deployment-config
        - name: data
          hostPath:
            path: /var/lib/heartbeat-data
            type: DirectoryOrCreate

现在它给我这个错误“Error When Creating”HEARTHAT-kubernetes.yaml“:在版本”v1“中的部署不能作为部署处理:无法解析数量的后缀”。

当应用yamlfile时,我得到了`

configmap/heartbeat-deployment-config unchanged
clusterrolebinding.rbac.authorization.k8s.io/heartbeat unchanged
rolebinding.rbac.authorization.k8s.io/heartbeat unchanged
rolebinding.rbac.authorization.k8s.io/heartbeat-kubeadm-config 
unchanged
clusterrole.rbac.authorization.k8s.io/heartbeat unchanged
role.rbac.authorization.k8s.io/heartbeat unchanged
role.rbac.authorization.k8s.io/heartbeat-kubeadm-config unchanged
serviceaccount/heartbeat unchanged`

除了部署部分,一切都很好。

如有任何帮助,我们将不胜感激并感谢您。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题