GKE无法从人工制品中提取图像

时间:2019-04-16 08:17:12

标签: gitlab google-kubernetes-engine jfrog-cli

我正在使用GKE,gitlab和JFrog来实现CI和CD。我的所有步骤均有效,但由于无法轮询我的映像,因此我向GKE的部署失败。图片确实存在。我在下面给出了部署,yaml和错误消息。

下面是我的部署文件,我已经对该图像进行了硬编码,以明确该图像确实存在。

--- 
apiVersion: extensions/v1beta1
kind: Deployment
metadata: 
  labels: 
    app: go
  name: hello-world-go
spec: 
  progressDeadlineSeconds: 600
  replicas: 3
  selector: 
    matchLabels: 
      app: go
  strategy: 
    rollingUpdate: 
      maxSurge: 1
      maxUnavailable: 33%
    type: RollingUpdate
  template: 
    metadata: 
      labels: 
        app: go
    spec: 
      containers: 
        - 
         # image: "<IMAGE_NAME>"
          image: cicd-docker-local.jfrog.io/stage_proj:56914646
          livenessProbe: 
            httpGet: 
              path: /healthz
              port: 8080
            initialDelaySeconds: 2
            periodSeconds: 2
          name: go
          ports: 
            - 
              containerPort: 8080
          readinessProbe: 
            httpGet: 
              path: /healthz
              port: 8080
            initialDelaySeconds: 2
            periodSeconds: 2
      imagePullSecrets:
        - name: my.secret        

下面是我的gitlab yaml文件片段

deploy to dev:
  stage: Dev-Deploy
  image: dtzar/helm-kubectl
  script:
    - kubectl config set-cluster mycluster --server="$KUBE_URL" --insecure-skip-tls-verify=true
    - kubectl config set-credentials admin --username="$KUBE_USER" --password="$KUBE_PASSWORD"
    - kubectl config set-context default --cluster=mycluster --user=admin
    - kubectl config use-context default; sleep 10
    - kubectl delete secret my.secret
    - kubectl create secret docker-registry  my.secret --docker-server=$ARTIFACTORY_DOCKER_REPOSITORY --docker-username=$ARTIFACTORY_USER --docker-password=$ARTIFACTORY_PASS --docker-email="abc@gmail.com"
    - echo ${STAGE_CONTAINER_IMAGE}
    - kubectl apply -f deployment.yaml
    - kubectl rollout status -w "deployment/hello-world-go"
   # - kubectl rollout status -f deployment.yaml
    - kubectl get all,ing -l app='hello-world-go'
  only:
    - master

我在GKE中收到如下错误。

Cannot pull image 'cicd-docker-local.jfrog.io/stage_proj:56914646' from the registry.

0 个答案:

没有答案