unable to pull images in kubernetes from private registry

Multi tool use
Multi tool use

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












i have setup a private registry in docker accessible thru a domain “makdom.ddns.net”, i can login push and pull images locally, no problem even from slave kubes node i can do this thing,



but when i write a kubes deployment file, it is unable to pull images from the private registry and fails.



apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: ssh-deployment
spec:
template:
metadata:
labels:
app: helloworld
spec:
containers:
- name: ssh-demo
image: makdom.ddns.net/my-ubuntu
imagePullPolicy: IfNotPresent
ports:
- name: nodejs-port
containerPort: 22
imagePullSecrets:
- name: myregistrykey


secrets:



DOCKER_REGISTRY_SERVER="https://makdom.ddns.net/v1/"
DOCKER_USER="user"
DOCKER_PASSWORD="password"
DOCKER_EMAIL="email@example.com"

kubectl create secret docker-registry myregistrykey
--docker-server=$DOCKER_REGISTRY_SERVER
--docker-username=$DOCKER_USER
--docker-password=$DOCKER_PASSWORD
--docker-email=$DOCKER_EMAIL


error:



Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 1m default-scheduler Successfully assigned ssh-deployment-7b7c7bf977-m6stk to kubes-slave
Normal SuccessfulMountVolume 1m kubelet, kubes-slave MountVolume.SetUp succeeded for volume "default-token-mx7qq"
Normal Pulled 1m (x3 over 1m) kubelet, kubes-slave Container image "makdom.ddns.net/my-ubuntu" already present on machine
Normal Created 1m (x3 over 1m) kubelet, kubes-slave Created container
Normal Started 1m (x3 over 1m) kubelet, kubes-slave Started container
Normal Pulling 34s (x2 over 1m) kubelet, kubes-slave pulling image "makdom.ddns.net/my-ubuntu"
Warning Failed 34s (x2 over 1m) kubelet, kubes-slave Failed to pull image "makdom.ddns.net/my-ubuntu": rpc error: code = Unknown desc = Error: image my-ubuntu:latest not found
Warning Failed 34s (x2 over 1m) kubelet, kubes-slave Error: ErrImagePull
Warning BackOff 19s (x6 over 1m) kubelet, kubes-slave Back-off restarting failed container






share|improve this question
























    up vote
    1
    down vote

    favorite












    i have setup a private registry in docker accessible thru a domain “makdom.ddns.net”, i can login push and pull images locally, no problem even from slave kubes node i can do this thing,



    but when i write a kubes deployment file, it is unable to pull images from the private registry and fails.



    apiVersion: extensions/v1beta1
    kind: Deployment
    metadata:
    name: ssh-deployment
    spec:
    template:
    metadata:
    labels:
    app: helloworld
    spec:
    containers:
    - name: ssh-demo
    image: makdom.ddns.net/my-ubuntu
    imagePullPolicy: IfNotPresent
    ports:
    - name: nodejs-port
    containerPort: 22
    imagePullSecrets:
    - name: myregistrykey


    secrets:



    DOCKER_REGISTRY_SERVER="https://makdom.ddns.net/v1/"
    DOCKER_USER="user"
    DOCKER_PASSWORD="password"
    DOCKER_EMAIL="email@example.com"

    kubectl create secret docker-registry myregistrykey
    --docker-server=$DOCKER_REGISTRY_SERVER
    --docker-username=$DOCKER_USER
    --docker-password=$DOCKER_PASSWORD
    --docker-email=$DOCKER_EMAIL


    error:



    Events:
    Type Reason Age From Message
    ---- ------ ---- ---- -------
    Normal Scheduled 1m default-scheduler Successfully assigned ssh-deployment-7b7c7bf977-m6stk to kubes-slave
    Normal SuccessfulMountVolume 1m kubelet, kubes-slave MountVolume.SetUp succeeded for volume "default-token-mx7qq"
    Normal Pulled 1m (x3 over 1m) kubelet, kubes-slave Container image "makdom.ddns.net/my-ubuntu" already present on machine
    Normal Created 1m (x3 over 1m) kubelet, kubes-slave Created container
    Normal Started 1m (x3 over 1m) kubelet, kubes-slave Started container
    Normal Pulling 34s (x2 over 1m) kubelet, kubes-slave pulling image "makdom.ddns.net/my-ubuntu"
    Warning Failed 34s (x2 over 1m) kubelet, kubes-slave Failed to pull image "makdom.ddns.net/my-ubuntu": rpc error: code = Unknown desc = Error: image my-ubuntu:latest not found
    Warning Failed 34s (x2 over 1m) kubelet, kubes-slave Error: ErrImagePull
    Warning BackOff 19s (x6 over 1m) kubelet, kubes-slave Back-off restarting failed container






    share|improve this question






















      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      i have setup a private registry in docker accessible thru a domain “makdom.ddns.net”, i can login push and pull images locally, no problem even from slave kubes node i can do this thing,



      but when i write a kubes deployment file, it is unable to pull images from the private registry and fails.



      apiVersion: extensions/v1beta1
      kind: Deployment
      metadata:
      name: ssh-deployment
      spec:
      template:
      metadata:
      labels:
      app: helloworld
      spec:
      containers:
      - name: ssh-demo
      image: makdom.ddns.net/my-ubuntu
      imagePullPolicy: IfNotPresent
      ports:
      - name: nodejs-port
      containerPort: 22
      imagePullSecrets:
      - name: myregistrykey


      secrets:



      DOCKER_REGISTRY_SERVER="https://makdom.ddns.net/v1/"
      DOCKER_USER="user"
      DOCKER_PASSWORD="password"
      DOCKER_EMAIL="email@example.com"

      kubectl create secret docker-registry myregistrykey
      --docker-server=$DOCKER_REGISTRY_SERVER
      --docker-username=$DOCKER_USER
      --docker-password=$DOCKER_PASSWORD
      --docker-email=$DOCKER_EMAIL


      error:



      Events:
      Type Reason Age From Message
      ---- ------ ---- ---- -------
      Normal Scheduled 1m default-scheduler Successfully assigned ssh-deployment-7b7c7bf977-m6stk to kubes-slave
      Normal SuccessfulMountVolume 1m kubelet, kubes-slave MountVolume.SetUp succeeded for volume "default-token-mx7qq"
      Normal Pulled 1m (x3 over 1m) kubelet, kubes-slave Container image "makdom.ddns.net/my-ubuntu" already present on machine
      Normal Created 1m (x3 over 1m) kubelet, kubes-slave Created container
      Normal Started 1m (x3 over 1m) kubelet, kubes-slave Started container
      Normal Pulling 34s (x2 over 1m) kubelet, kubes-slave pulling image "makdom.ddns.net/my-ubuntu"
      Warning Failed 34s (x2 over 1m) kubelet, kubes-slave Failed to pull image "makdom.ddns.net/my-ubuntu": rpc error: code = Unknown desc = Error: image my-ubuntu:latest not found
      Warning Failed 34s (x2 over 1m) kubelet, kubes-slave Error: ErrImagePull
      Warning BackOff 19s (x6 over 1m) kubelet, kubes-slave Back-off restarting failed container






      share|improve this question












      i have setup a private registry in docker accessible thru a domain “makdom.ddns.net”, i can login push and pull images locally, no problem even from slave kubes node i can do this thing,



      but when i write a kubes deployment file, it is unable to pull images from the private registry and fails.



      apiVersion: extensions/v1beta1
      kind: Deployment
      metadata:
      name: ssh-deployment
      spec:
      template:
      metadata:
      labels:
      app: helloworld
      spec:
      containers:
      - name: ssh-demo
      image: makdom.ddns.net/my-ubuntu
      imagePullPolicy: IfNotPresent
      ports:
      - name: nodejs-port
      containerPort: 22
      imagePullSecrets:
      - name: myregistrykey


      secrets:



      DOCKER_REGISTRY_SERVER="https://makdom.ddns.net/v1/"
      DOCKER_USER="user"
      DOCKER_PASSWORD="password"
      DOCKER_EMAIL="email@example.com"

      kubectl create secret docker-registry myregistrykey
      --docker-server=$DOCKER_REGISTRY_SERVER
      --docker-username=$DOCKER_USER
      --docker-password=$DOCKER_PASSWORD
      --docker-email=$DOCKER_EMAIL


      error:



      Events:
      Type Reason Age From Message
      ---- ------ ---- ---- -------
      Normal Scheduled 1m default-scheduler Successfully assigned ssh-deployment-7b7c7bf977-m6stk to kubes-slave
      Normal SuccessfulMountVolume 1m kubelet, kubes-slave MountVolume.SetUp succeeded for volume "default-token-mx7qq"
      Normal Pulled 1m (x3 over 1m) kubelet, kubes-slave Container image "makdom.ddns.net/my-ubuntu" already present on machine
      Normal Created 1m (x3 over 1m) kubelet, kubes-slave Created container
      Normal Started 1m (x3 over 1m) kubelet, kubes-slave Started container
      Normal Pulling 34s (x2 over 1m) kubelet, kubes-slave pulling image "makdom.ddns.net/my-ubuntu"
      Warning Failed 34s (x2 over 1m) kubelet, kubes-slave Failed to pull image "makdom.ddns.net/my-ubuntu": rpc error: code = Unknown desc = Error: image my-ubuntu:latest not found
      Warning Failed 34s (x2 over 1m) kubelet, kubes-slave Error: ErrImagePull
      Warning BackOff 19s (x6 over 1m) kubelet, kubes-slave Back-off restarting failed container








      share|improve this question











      share|improve this question




      share|improve this question










      asked Dec 23 '17 at 14:21









      Mohd

      146114




      146114




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote



          accepted










          Known issue https://github.com/kubernetes/kubernetes/issues/57427, resolved in master in https://github.com/kubernetes/kubernetes/pull/57463



          Targeted fix for 1.9.1 in https://github.com/kubernetes/kubernetes/pull/57472



          Workarounds until then:



          If you have a .dockerconfigjson for your private registry already, you can manually specify the type and data key:



          kubectl create secret generic my-secret-name 
          --type=kubernetes.io/dockerconfigjson
          --from-file .dockerconfigjson=/path/to/.dockerconfigjson


          If you don't have a .dockerconfigjson file already, you can fix up the secret produced by kubectl create secret docker-registry manually:



          1. add --dry-run -o yaml > secret.yaml

          2. change the type from kubernetes.io/dockercfg to kubernetes.io/dockercfgjson

          3. change the data key from .dockercfg to .dockercfgjson

          4. create the modified secret with kubectl create -f secret.yaml





          share|improve this answer






















          • ok how can i fix this, as im a little lost!
            – Mohd
            Dec 24 '17 at 3:20










          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );








           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f412678%2funable-to-pull-images-in-kubernetes-from-private-registry%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          1
          down vote



          accepted










          Known issue https://github.com/kubernetes/kubernetes/issues/57427, resolved in master in https://github.com/kubernetes/kubernetes/pull/57463



          Targeted fix for 1.9.1 in https://github.com/kubernetes/kubernetes/pull/57472



          Workarounds until then:



          If you have a .dockerconfigjson for your private registry already, you can manually specify the type and data key:



          kubectl create secret generic my-secret-name 
          --type=kubernetes.io/dockerconfigjson
          --from-file .dockerconfigjson=/path/to/.dockerconfigjson


          If you don't have a .dockerconfigjson file already, you can fix up the secret produced by kubectl create secret docker-registry manually:



          1. add --dry-run -o yaml > secret.yaml

          2. change the type from kubernetes.io/dockercfg to kubernetes.io/dockercfgjson

          3. change the data key from .dockercfg to .dockercfgjson

          4. create the modified secret with kubectl create -f secret.yaml





          share|improve this answer






















          • ok how can i fix this, as im a little lost!
            – Mohd
            Dec 24 '17 at 3:20














          up vote
          1
          down vote



          accepted










          Known issue https://github.com/kubernetes/kubernetes/issues/57427, resolved in master in https://github.com/kubernetes/kubernetes/pull/57463



          Targeted fix for 1.9.1 in https://github.com/kubernetes/kubernetes/pull/57472



          Workarounds until then:



          If you have a .dockerconfigjson for your private registry already, you can manually specify the type and data key:



          kubectl create secret generic my-secret-name 
          --type=kubernetes.io/dockerconfigjson
          --from-file .dockerconfigjson=/path/to/.dockerconfigjson


          If you don't have a .dockerconfigjson file already, you can fix up the secret produced by kubectl create secret docker-registry manually:



          1. add --dry-run -o yaml > secret.yaml

          2. change the type from kubernetes.io/dockercfg to kubernetes.io/dockercfgjson

          3. change the data key from .dockercfg to .dockercfgjson

          4. create the modified secret with kubectl create -f secret.yaml





          share|improve this answer






















          • ok how can i fix this, as im a little lost!
            – Mohd
            Dec 24 '17 at 3:20












          up vote
          1
          down vote



          accepted







          up vote
          1
          down vote



          accepted






          Known issue https://github.com/kubernetes/kubernetes/issues/57427, resolved in master in https://github.com/kubernetes/kubernetes/pull/57463



          Targeted fix for 1.9.1 in https://github.com/kubernetes/kubernetes/pull/57472



          Workarounds until then:



          If you have a .dockerconfigjson for your private registry already, you can manually specify the type and data key:



          kubectl create secret generic my-secret-name 
          --type=kubernetes.io/dockerconfigjson
          --from-file .dockerconfigjson=/path/to/.dockerconfigjson


          If you don't have a .dockerconfigjson file already, you can fix up the secret produced by kubectl create secret docker-registry manually:



          1. add --dry-run -o yaml > secret.yaml

          2. change the type from kubernetes.io/dockercfg to kubernetes.io/dockercfgjson

          3. change the data key from .dockercfg to .dockercfgjson

          4. create the modified secret with kubectl create -f secret.yaml





          share|improve this answer














          Known issue https://github.com/kubernetes/kubernetes/issues/57427, resolved in master in https://github.com/kubernetes/kubernetes/pull/57463



          Targeted fix for 1.9.1 in https://github.com/kubernetes/kubernetes/pull/57472



          Workarounds until then:



          If you have a .dockerconfigjson for your private registry already, you can manually specify the type and data key:



          kubectl create secret generic my-secret-name 
          --type=kubernetes.io/dockerconfigjson
          --from-file .dockerconfigjson=/path/to/.dockerconfigjson


          If you don't have a .dockerconfigjson file already, you can fix up the secret produced by kubectl create secret docker-registry manually:



          1. add --dry-run -o yaml > secret.yaml

          2. change the type from kubernetes.io/dockercfg to kubernetes.io/dockercfgjson

          3. change the data key from .dockercfg to .dockercfgjson

          4. create the modified secret with kubectl create -f secret.yaml






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Dec 24 '17 at 4:55

























          answered Dec 23 '17 at 21:05









          Jordan Liggitt

          1263




          1263











          • ok how can i fix this, as im a little lost!
            – Mohd
            Dec 24 '17 at 3:20
















          • ok how can i fix this, as im a little lost!
            – Mohd
            Dec 24 '17 at 3:20















          ok how can i fix this, as im a little lost!
          – Mohd
          Dec 24 '17 at 3:20




          ok how can i fix this, as im a little lost!
          – Mohd
          Dec 24 '17 at 3:20












           

          draft saved


          draft discarded


























           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f412678%2funable-to-pull-images-in-kubernetes-from-private-registry%23new-answer', 'question_page');

          );

          Post as a guest













































































          5,gKYq8OPt2WPKYOc pWYWAE3urvio7wcRc wKmQR3oqWEwg U5NfBAFjsp2NvllmOIdCHJD3 nrYmt AmCSM4yTu3rf,lAG DEI
          J zdlJB UPP,0C2KwmC3dvl B 7bDmeQa,V07feRQP

          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          How many registers does an x86_64 CPU actually have?

          Displaying single band from multi-band raster using QGIS