0

I am using GKE and Jfrog artifactory. I am building image with tag like

cicd-docker-local.jfrog.io/stage_proj:50d3afd0

If i see artifactory i can see the image in https://cicd.jfrog.io/cicd/webapp/ which is right. But my GKE is not able to recognise the image and it throws error like

couldn't parse image reference "'cicd-docker-local.jfrog.io/stage_proj:50d3afd0'": invalid reference format: InvalidImageName

But my image exists. Is there any problem with my image and name.

Deployment file portion:

 containers: 
    - 
      image: "<IMAGE_NAME>"

In yaml file

- sed -i "s%<IMAGE_NAME>%'${STAGE_CONTAINER_IMAGE}'%g" deployment.yaml

    STAGE_CONTAINER_IMAGE = cicd-docker-local.jfrog.io/stage_proj:50d3afd0



  --- 
    apiVersion: extensions/v1beta1
    kind: Deployment
    metadata: 
      labels: 
        app: go
      name: hello-world-go
    spec: 
      progressDeadlineSeconds: 60
      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: 50d3afd0
              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

If i use and sed command, i get error in kubernetes. But if i use cicd-docker-local.jfrog.io/stage_proj: 50d3afd0 directly, there is no error. Am i doing SED command wrongly?

Hacker
  • 7,798
  • 19
  • 84
  • 154
  • can you share the code for the object that's trying to use that image? I mean, like a Pod or Deployment, etc – Jose Armesto Apr 15 '19 at 15:49
  • Updated my question. Let know it suffices. – Hacker Apr 15 '19 at 15:54
  • Is your connection to GKE to artifactory working fine? this is the first time you are using or it was working earlier ? – error404 Apr 15 '19 at 16:06
  • @error404 - It first time i am working with it. How do i verify the connection? – Hacker Apr 15 '19 at 16:08
  • thanks for the clarification. the issue seems to be with the docker initially as it is not trying to search for such an image. please check this https://stackoverflow.com/questions/47435418/docker-command-returns-invalid-reference-format. Also please update the question with full deployment.yml – error404 Apr 15 '19 at 16:13
  • @error404 - Updated the question. – Hacker Apr 15 '19 at 18:23
  • Yes, you are probably using `sed` incorrectly. Please share the sed command. – Jose Armesto Apr 15 '19 at 18:37
  • @fiunchinho - Its in the question. sed -i "s%%'${STAGE_CONTAINER_IMAGE}'%g" deployment.yaml – Hacker Apr 15 '19 at 18:40

0 Answers0