没有最低可用性Google kubernetes

时间:2018-08-03 20:25:55

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

我试图在Podspec文件中使用不同的env vars启动同一容器,但是其中一些在Kubernetes引擎中获得Does not have minimum availability。规范文件具有相同的容器和资源,并且kubernetes集群是3个节点,总共有24个vCPU和21.6GB的RAM。

在不工作的日志中,我看到了:

{
 insertId:  "19i90d9faqg4pj"  
 labels: {…}  
 logName:  "projects/snappy-premise-118915/logs/sensorgen"  
 receiveTimestamp:  "2018-08-03T20:18:52.821754874Z"  
 resource: {…}  
 severity:  "ERROR"  
 textPayload:  "INFO: 2018/08/03 20:17:51 parsed scheme: ""
"  
 timestamp:  "2018-08-03T20:17:51Z"  
},

{
 insertId:  "19i90d9faqg4pk"
 labels: {…}
 logName:  "projects/snappy-premise-118915/logs/sensorgen"
 receiveTimestamp:  "2018-08-03T20:18:52.821754874Z"
 resource: {…}
 severity:  "ERROR"
 textPayload:  "INFO: 2018/08/03 20:17:51 scheme "" not registered, fallback to default scheme
"
 timestamp:  "2018-08-03T20:17:51Z"
},

{
 insertId:  "19i90d9faqg4pl"
 labels: {…}
 logName:  "projects/snappy-premise-118915/logs/sensorgen"
 receiveTimestamp:  "2018-08-03T20:18:52.821754874Z"
 resource: {…}
 severity:  "ERROR"
 textPayload:  "INFO: 2018/08/03 20:17:51 ccResolverWrapper: sending new addresses to cc: [{pubsub.googleapis.com:443 0  <nil>}]
"
 timestamp:  "2018-08-03T20:17:51Z"
},

{
 insertId:  "19i90d9faqg4pm"
 labels: {…}
 logName:  "projects/snappy-premise-118915/logs/sensorgen"
 receiveTimestamp:  "2018-08-03T20:18:52.821754874Z"
 resource: {…}
 severity:  "ERROR"
 textPayload:  "INFO: 2018/08/03 20:17:51 balancerWrapper: got update addr from Notify: [{pubsub.googleapis.com:443 0} {pubsub.googleapis.com:443 1} {pubsub.googleapis.com:443 2} {pubsub.googleapis.com:443 3} {pubsub.googleapis.com:443 4} {pubsub.googleapis.com:443 5} {pubsub.googleapis.com:443 6} {pubsub.googleapis.com:443 7}]
"
 timestamp:  "2018-08-03T20:17:51Z"
},

{
 insertId:  "19i90d9faqg4pn"
 labels: {…}
 logName:  "projects/snappy-premise-118915/logs/sensorgen"
 receiveTimestamp:  "2018-08-03T20:18:52.821754874Z"
 resource: {…}
 severity:  "ERROR"
 textPayload:  "2018/08/03 20:17:51 Failed to publish: rpc error: code = NotFound desc = Resource not found (resource=sensordata).
"
 timestamp:  "2018-08-03T20:17:51Z"
}

有效的Podspec:

apiVersion: apps/v1beta1
kind: Deployment
metadata:
  name: pubsensor-a
spec:
  template:
    metadata:
      labels:
        app: pubsensor-a
    spec:
      volumes:
      - name: google-cloud-key
        secret:
          secretName: pubsub-key
      containers:
      - name: sensorgen
        image: gcr.io/snappy-premise-118915/sensorgen:v4
        volumeMounts:
        - name: google-cloud-key
          mountPath: /var/secrets/google
        resources:
          requests:
            memory: "3000Mi"
            cpu: "2000m"
          limits:
            memory: "3000Mi"
            cpu: "2000m"
        env:
        - name: GOOGLE_APPLICATION_CREDENTIALS
          value: "/var/secrets/google/key.json"
        - name: GOOGLE_CLOUD_PROJECT
          value: "snappy-premise-118915"
        - name: LATITUDE
          value: "-122.797"
        - name: LONGITUDE
          value: "38.4994"
        - name: SENSORID
          value: "sensor"
        - name: ZIPCODE
          value: "95403"
        - name: WAREHOUSE
          value: "Warehouse-2"

一个无效的

apiVersion: apps/v1beta1
kind: Deployment
metadata:
  name: pubsensor-c
spec:
  template:
    metadata:
      labels:
        app: pubsensor-c
    spec:
      volumes:
      - name: google-cloud-key
        secret:
          secretName: pubsub-key
      containers:
      - name: sensorgen
        image: gcr.io/snappy-premise-118915/sensorgen:v4
        volumeMounts:
        - name: google-cloud-key
          mountPath: /var/secrets/google
        resources:
          requests:
            memory: "3000Mi"
            cpu: "2000m"
          limits:
            memory: "3000Mi"
            cpu: "2000m"
        env:
        - name: GOOGLE_APPLICATION_CREDENTIALS
          value: "/var/secrets/google/key.json"
        - name: GOOGLE_CLOUD_PROJECT
          value: "snappy-premise-118915"
        - name: LATITUDE
          value: "-94.216"
        - name: LONGITUDE
          value: "39.1396"
        - name: SENSORID
          value: "sensor"
        - name: ZIPCODE
          value: "64016"
        - name: WAREHOUSE
          value: "Warehouse-4"

0 个答案:

没有答案