2017-07-13 3 views
0

私は私有Artifactory Docker repoから画像を取り出すようにKubernetesを設定しようとします。私はKubernetesに "ImagePullBackOff" のエラーが表示されますAzure ACSでKubernetesを設定してArtifactoryから画像を取得します

apiVersion: v1 
kind: Pod 
metadata: 
    name: base-infra 
spec: 
    containers: 
    - name: api-gateway 
     image: api-gateway 
    imagePullSecrets: 
    - name: artifactorysecret 

とkubectlを使用してポッドを作成した後

kubectl create secret docker-registry artifactorysecret --docker-server=ourcompany.jfrog.io/path/list/docker-repo/ --docker-username=artifactory-user --docker-password=artipwd --docker-email=myemail 

まず私はkubectlと秘密を構成し

3m   3m    1  default-scheduler           Normal 
Scheduled  Successfully assigned consort-base-infra to k8s-agent-ab2f29b2-2 
    3m   0s    5  kubelet, k8s-agent-ab2f29b2-2 spec.containers{api-gateway} Normal 
Pulling   pulling image "api-gateway" 
    2m   <invalid>  5  kubelet, k8s-agent-ab2f29b2-2 spec.containers{api-gateway} Warning 
Failed   Failed to pull image "api-gateway": rpc error: code = 2 desc = Error: image library/api-gateway:latest not found 
    2m   <invalid>  5  kubelet, k8s-agent-ab2f29b2-2        Warning 
FailedSync  Error syncing pod, skipping: failed to "StartContainer" for "api-gateway" with ErrImagePull: "rpc error: code = 2 desc = Error: image library/api-gateway:latest not found" 

    2m <invalid>  17  kubelet, k8s-agent-ab2f29b2-2 spec.containers{api-gateway} Normal BackOff 
Back-off pulling image "api-gateway" 
    2m <invalid>  17  kubelet, k8s-agent-ab2f29b2-2         Warning FailedSync 
Error syncing pod, skipping: failed to "StartContainer" for "api-gateway" with ImagePullBackOff: "Back-off pulling image \"api-gateway\"" 

もちろん、レポには最新のバージョンがあります。私はここで何が欠けているのか分からない。

+0

あなたはドッカープルでイメージを引き出すことができましたか? –

+0

はい - それは動作します。 Azure ACSは外部プライベートドッカーレジストリを許可していないようです。それは、Azure ACRから私的画像を引き出すことを好む – user2262423

答えて

0

[OK]を... Kubernetesはレポにログインできるようです - 私は、に注意を払うために二つのことがありますPull image Azure Container Registry - Kubernetes

にArtifactoryのおかげで接続することが分かった:

1)で秘密の定義HTTPSを忘れないでください://サーバ属性で:

kubectl create secret docker-registry regsecret --docker-server=https://our-repo.jfrog.io --docker-username=myuser --docker-password=<your-pword> --docker-email=<your-email> 

2)配備記述子にフルイメージパスを使用して秘密を指定する(またはデフォルトServiceAccountに付加):

apiVersion: v1 
kind: Pod 
metadata: 
    name: consort-base-infra-art 
spec: 
    containers: 
    - name: api-gateway 
     image: our-repo.jfrog.io/api-gateway 
    imagePullSecrets: 
    - name: regsecret 
関連する問題