【问题标题】:deployment/auth-mongo-depl: container auth-mongo is waiting to start: mongo can't be pulleddeployment/auth-mongo-depl: container auth-mongo is waiting to start: mongo can't be pulled
【发布时间】:2022-11-26 16:27:29
【问题描述】:

这是我的auth-depl.yaml 文件:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: auth-depl
spec:
  replicas: 1
  selector:
    matchLabels:
      app: auth
  template:
    metadata:
      labels:
        app: auth
    spec:
      containers:
        - name: auth
          image: tester/auth
          env:
            - name: MONGO_URI
              value: 'mongodb://auth-mongo-srv:27017/auth'
            - name: JWT_KEY
              valueFrom:
                secretKeyRef:
                  name: jwt-secret
                  key: JWT_KEY
---
apiVersion: v1
kind: Service
metadata:
  name: auth-srv
spec:
  selector:
    app: auth
  ports:
    - name: auth
      protocol: TCP
      port: 3000
      targetPort: 3000

以下是auth-mongo-depl.yaml

apiVersion: apps/v1
kind: Deployment
metadata:
  name: auth-mongo-depl
spec:
  replicas: 1
  selector:
    matchLabels:
      app: auth-mongo
  template:
    metadata:
      labels:
        app: auth-mongo
    spec:
      containers:
        - name: auth-mongo
          image: mongo
---
apiVersion: v1
kind: Service
metadata:
  name: auth-mongo-srv
spec:
  selector:
    app: auth-mongo
  ports:
    - name: db
      protocol: TCP
      port: 27017
      targetPort: 27017

当我运行 skaffold dev 时,出现以下错误:

 - deployment/auth-mongo-depl: container auth-mongo is waiting to start: mongo can't be pulled
    - pod/auth-mongo-depl-64f5f58669-dw4hg: container auth-mongo is waiting to start: mongo can't be pulled
 - deployment/auth-mongo-depl failed. Error: container auth-mongo is waiting to start: mongo can't be pulled.

mongo 服务已启动并正在运行,我可以在终端上运行 mongo 命令。它还会在默认的mongodb://127.0.0.1:27017 地址上启动和运行。我使用 Windows 10 和 Docker-Desktop。

让我知道是否需要添加更多信息。

【问题讨论】:

    标签: mongodb docker kubernetes deployment pull-request


    【解决方案1】:

    我认为常见的解决方案是将 Docker Hub 中的 mongo 镜像拉到你的位置,然后再次尝试运行 skaffold dev

    【讨论】:

      猜你喜欢
      • 2020-07-19
      • 2015-10-15
      • 2016-12-23
      • 2020-06-04
      • 1970-01-01
      • 2019-03-12
      • 2017-11-17
      • 2021-08-28
      • 2011-05-09
      相关资源
      最近更新 更多