【发布时间】:2016-10-31 06:15:07
【问题描述】:
我正在尝试使用以下 YAML 创建一个 pod,特别是在 Google Cloud Platform 上:
apiVersion: v1
kind: ReplicationController
metadata:
name: frontend
spec:
replicas: 2
template:
metadata:
labels:
app: search
tier: frontend
spec:
containers:
- name: node
image: gcr.io/google_appengine/nodejs
resources:
requests:
cpu: 100m
memory: 100Mi
env:
- name: GET_HOSTS_FROM
value: dns
ports:
- containerPort: 80
由于某种原因,我不断收到状态:CrashLoopBackOff
当我运行 kubectl 日志时,它显示如下:
npm ERR! Linux 4.4.21+
npm ERR! argv "/nodejs/bin/node" "/nodejs/bin/npm" "start"
npm ERR! node v6.9.1
npm ERR! npm v3.10.8
npm ERR! path /app/package.json
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open '/app/package.json'
npm ERR! enoent ENOENT: no such file or directory, open '/app/package.json'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! Please include the following file with any support request:
npm ERR! /app/npm-debug.log
我四处寻找,找到了跑步的建议
npm install -g npm-autoinit
当我只是拉动图像时,我不确定该怎么做。我对 Docker 和 Kubernetes 还很陌生,因此我们将不胜感激!
【问题讨论】:
标签: node.js kubernetes google-cloud-platform google-kubernetes-engine