未在其他命名空间中安排GKE Pod

时间:2020-11-08 12:33:45

标签: kubernetes google-cloud-platform google-compute-engine google-kubernetes-engine

我想在我现有的命名空间“ test-namespace”中部署monstache部署。当我将其部署在“默认”名称空间中时,它可以工作,但是当我将其部署在“ test-namespace”中时,pod不会安排。

kubectl get pods -n test-namespace monstache-74466dc7-5tnrr -o wide
NAME                       READY   STATUS    RESTARTS   AGE   IP       NODE     NOMINATED NODE   READINESS GATES
monstache-74466dc7-5tnrr   0/1     Pending   0          57m   <none>   <none>   <none>           <none>

和:

kubectl describe pods -n test-namespace monstache-74466dc7-5tnrr
Name:           monstache-74466dc7-5tnrr
Namespace:      test-namespace
Priority:       0
Node:           <none>
Labels:         app=monstache
                pod-template-hash=74466dc7
Annotations:    <none>
Status:         Pending
IP:
IPs:            <none>
Controlled By:  ReplicaSet/monstache-74466dc7
Containers:
  monstache:
    Image:      rwynn/monstache:latest
    Port:       <none>
    Host Port:  <none>
    Command:
      /bin/monstache
      -f
      /app/monstache.test.config.toml
    Environment:
      MONSTACHE_DIRECT_READ_NS:    xxx.XXX
      MONSTACHE_CHANGE_STREAM_NS:  xxx.XXX
      MONSTACHE_MONGO_URL:         mongodb://xxx?replicaSet=rs0
      MONSTACHE_ES_USER:           elastic
      MONSTACHE_ES_PASS:           XXX
    Mounts:
      /app from monstache-config (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-qmcwm (ro)
Volumes:
  monstache-config:
    Type:      ConfigMap (a volume populated by a ConfigMap)
    Name:      monstache-config
    Optional:  false
  default-token-qmcwm:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  default-token-qmcwm
    Optional:    false
QoS Class:       BestEffort
Node-Selectors:  <none>
Tolerations:     node.kubernetes.io/not-ready:NoExecute for 300s
                 node.kubernetes.io/unreachable:NoExecute for 300s
Events:          <none>

和:

kubectl get events -n test-namespace
LAST SEEN   TYPE     REASON              OBJECT                          MESSAGE
55m         Normal   SuccessfulCreate    replicaset/monstache-74466dc7   Created pod: monstache-74466dc7-snrdb
55m         Normal   SuccessfulCreate    replicaset/monstache-74466dc7   Created pod: monstache-74466dc7-5tnrr
55m         Normal   ScalingReplicaSet   deployment/monstache            Scaled up replica set monstache-74466dc7 to 1
55m         Normal   ScalingReplicaSet   deployment/monstache            Scaled up replica set monstache-74466dc7 to 1

和:

enter image description here

这是我的monstache部署:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: monstache
  namespace: test-namespace
spec:
  progressDeadlineSeconds: 600
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app: monstache
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      creationTimestamp: null
      labels:
        app: monstache
    spec:
      containers:
      - command:
        - /bin/monstache
        - -f
        - /app/monstache.test.config.toml
        env:
        - name: MONSTACHE_DIRECT_READ_NS
          value: xxx.xxx
        - name: MONSTACHE_CHANGE_STREAM_NS
          value: xxx.xxx
        - name: MONSTACHE_MONGO_URL
          value: mongodb://mongodb-service:27017/xxx?replicaSet=rs0
        - name: MONSTACHE_ES_USER
          value: elastic
        - name: MONSTACHE_ES_PASS
          value: XXXX
        image: rwynn/monstache:latest
        imagePullPolicy: Always
        name: monstache
        resources: {}
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        volumeMounts:
        - mountPath: /app
          name: monstache-config
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      terminationGracePeriodSeconds: 30
      volumes:
      - configMap:
          defaultMode: 420
          name: monstache-config
        name: monstache-config
---
apiVersion: v1
data:
  monstache.test.config.toml: |
    resume = true

    gzip = true

    elasticsearch-urls = ["https://elasticsearch:9200"]

    elasticsearch-max-conns = 10

    elasticsearch-max-seconds = 1

    elasticsearch-max-docs = 1

    #namespace-regex = '*'

    verbose = false

    enable-http-server = true

    elasticsearch-validate-pem-file = false

    [[mapping]]
    namespace = "XXX.XXX"
    index = "XXX"
kind: ConfigMap
metadata:
  name: monstache-config
  namespace: test-namespace

几件事要知道:

  • 我已经在该命名空间中安排了pods
  • 我尝试删除重新创建的部署
  • 我什至创建了一个新的节点池,并试图在那里安排部署-也不起作用。
  • 我搜索了豆荚数量限制和豆荚配额,并且没有冲突。
  • 我在该GKE集群中有12个命名空间
  • 该GKE集群中总共有113个豆荚
  • 我在该集群的其他名称空间中成功安排了一些monstache部署。
  • 它发生在我创建的两个最新名称空间中。

有任何线索吗?

1 个答案:

答案 0 :(得分:0)

这是一个错误。使用GKE版本1.17.14-gke.1200重新部署它可以解决此问题。