Resolution

ARTIFACTORY: How to resolve error “Failed to pull image…” when pulling images from Artifactory in Kubernetes

AuthorFullName__c
Ino Choi
articleNumber
000005495
ft:sourceType
Salesforce
FirstPublishedDate
2022-12-11T10:33:46Z
lastModifiedDate
2022-12-11
VersionNumber
3
To overcome this issue, you need to create a new secret type, “kubernetes.io/dockerconfigjson”, which is generated using the new Docker config file saved in ~/.docker/config.json (Docker 1.7.0 and above).
NAME               TYPE                             DATA   AGE
dockerconfigjson   kubernetes.io/dockerconfigjson   1      4s
Now, you can use this secret to create a pod and pull images from Artifactory successfully.
apiVersion: v1
kind: Pod
metadata:
  name: my-private-pod
spec:
  containers:
    - name: private
      image: <ARTIFACTORY>/docker/busybox:latest
  imagePullSecrets:
    - name: dockerconfigjson
 Normal   Pulled     4s                kubelet            Successfully pulled image "artifactory/docker/busybox:latest" in 9.760532921s
  Normal   Pulling    3s (x2 over 14s)  kubelet            Pulling image "artifactory/docker/busybox:latest"
  Normal   Created    1s (x2 over 4s)   kubelet            Created container private
  Normal   Pulled     1s                kubelet            Successfully pulled image "artifactory/docker/busybox:latest" in 2.496841418s

For an advanced EKS environment setup, you can utilize the new passwordless feature described in our blog post.