{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/57801","repository_url":"https://api.github.com/repos/kubernetes/kubernetes","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/57801/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/57801/comments","events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/57801/events","html_url":"https://github.com/kubernetes/kubernetes/issues/57801","id":285784892,"node_id":"MDU6SXNzdWUyODU3ODQ4OTI=","number":57801,"title":"imagePullSecrets on a Deployment not been propagated to pods","user":{"login":"bitgandtter","id":1316125,"node_id":"MDQ6VXNlcjEzMTYxMjU=","avatar_url":"https://avatars3.githubusercontent.com/u/1316125?v=4","gravatar_id":"","url":"https://api.github.com/users/bitgandtter","html_url":"https://github.com/bitgandtter","followers_url":"https://api.github.com/users/bitgandtter/followers","following_url":"https://api.github.com/users/bitgandtter/following{/other_user}","gists_url":"https://api.github.com/users/bitgandtter/gists{/gist_id}","starred_url":"https://api.github.com/users/bitgandtter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitgandtter/subscriptions","organizations_url":"https://api.github.com/users/bitgandtter/orgs","repos_url":"https://api.github.com/users/bitgandtter/repos","events_url":"https://api.github.com/users/bitgandtter/events{/privacy}","received_events_url":"https://api.github.com/users/bitgandtter/received_events","type":"User","site_admin":false},"labels":[{"id":105146071,"node_id":"MDU6TGFiZWwxMDUxNDYwNzE=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/kind/bug","name":"kind/bug","color":"e11d21","default":false},{"id":173493665,"node_id":"MDU6TGFiZWwxNzM0OTM2NjU=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/sig/node","name":"sig/node","color":"d2b48c","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":18,"created_at":"2018-01-03T19:27:28Z","updated_at":"2018-12-17T12:19:55Z","closed_at":"2018-01-04T20:28:00Z","author_association":"NONE","body":"**Is this a BUG REPORT or FEATURE REQUEST?**:\r\n\r\n> Uncomment only one, leave it on its own line: \r\n>\r\n/kind bug\r\n> /kind feature\r\n\r\n\r\n**What happened**:\r\nI have a Deployment configuration like:\r\n\r\n```\r\n- apiVersion: extensions/v1beta1\r\n  kind: Deployment\r\n  metadata:\r\n    annotations:\r\n      kompose.cmd: kompose convert -o k8s\r\n      kompose.version: 1.6.0 (e4adfef)\r\n    creationTimestamp: null\r\n    labels:\r\n      io.kompose.service: user\r\n    name: user\r\n  spec:\r\n    replicas: 1\r\n    strategy: {}\r\n    template:\r\n      metadata:\r\n        creationTimestamp: null\r\n        labels:\r\n          io.kompose.service: user\r\n      spec:\r\n        containers:\r\n        - env:\r\n          - name: APP_DEBUG\r\n            value: \"0\"\r\n          - name: APP_ENV\r\n            value: prod\r\n          image: \"user/private-repo\"\r\n          name: user\r\n          resources: {}\r\n        restartPolicy: Always\r\n        imagePullSecrets:\r\n          - name: regsecret\r\n  status: {}\r\n```\r\nwhere **regsecret** is a secret created following [the official doc](https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod) but the created pod failed to pull the image because authentication and the pod does not mount the specified secret, see describe:\r\n\r\n```\r\nName:           user-798fc86589-2lmd4\r\nNamespace:      default\r\nNode:           ip-172-31-9-21/172.31.9.21\r\nStart Time:     Wed, 03 Jan 2018 19:13:17 +0000\r\nLabels:         io.kompose.service=service\r\n                pod-template-hash=3549742145\r\nAnnotations:    <none>\r\nStatus:         Pending\r\nIP:             10.1.98.124\r\nControlled By:  ReplicaSet/user-798fc86589\r\nContainers:\r\n  service:\r\n    Container ID:   \r\n    Image:          user/private-repo\r\n    Image ID:       \r\n    Port:           <none>\r\n    State:          Waiting\r\n      Reason:       ErrImagePull\r\n    Ready:          False\r\n    Restart Count:  0\r\n    Environment:\r\n      APP_DEBUG:  0\r\n      APP_ENV:    prod\r\n    Mounts:\r\n      /var/run/secrets/kubernetes.io/serviceaccount from default-token-4tdzg (ro)\r\nConditions:\r\n  Type           Status\r\n  Initialized    True \r\n  Ready          False \r\n  PodScheduled   True \r\nVolumes:\r\n  default-token-4tdzg:\r\n    Type:        Secret (a volume populated by a Secret)\r\n    SecretName:  default-token-4tdzg\r\n    Optional:    false\r\nQoS Class:       BestEffort\r\nNode-Selectors:  <none>\r\nTolerations:     node.kubernetes.io/not-ready:NoExecute for 300s\r\n                 node.kubernetes.io/unreachable:NoExecute for 300s\r\nEvents:\r\n  Type     Reason                 Age                From                     Message\r\n  ----     ------                 ----               ----                     -------\r\n  Normal   Scheduled              11m                default-scheduler        Successfully assigned service-798fc86589-2lmd4 to ip-172-31-9-21\r\n  Normal   SuccessfulMountVolume  11m                kubelet, ip-172-31-9-21  MountVolume.SetUp succeeded for volume \"default-token-4tdzg\"\r\n  Warning  Failed                 10m (x2 over 11m)  kubelet, ip-172-31-9-21  Failed to pull image \"user/private-repo\": rpc error: code = Unknown desc = Error response from daemon: repository primoshome/service not found: does not exist or no pull access\r\n  Warning  Failed                 10m (x2 over 11m)  kubelet, ip-172-31-9-21  Error: ErrImagePull\r\n  Normal   BackOff                10m (x5 over 11m)  kubelet, ip-172-31-9-21  Back-off pulling image \"user/private-repo\"\r\n  Normal   SandboxChanged         10m (x7 over 11m)  kubelet, ip-172-31-9-21  Pod sandbox changed, it will be killed and re-created.\r\n  Normal   Pulling                10m (x3 over 11m)  kubelet, ip-172-31-9-21  pulling image \"user/private-repo\"\r\n  Warning  Failed                 1m (x52 over 11m)  kubelet, ip-172-31-9-21  Error: ImagePullBackOff\r\n```\r\n\r\n**What you expected to happen**:\r\n\r\ni expect the pod to be configured with the secret and be able to pull the image from the private repository\r\n\r\n**How to reproduce it (as minimally and precisely as possible)**:\r\n\r\nexec above configuration with any private repository\r\n\r\n**Anything else we need to know?**:\r\n\r\n**Environment**:\r\n- Kubernetes version (use `kubectl version`): v1.9.0\r\n- Cloud provider or hardware configuration: aws\r\n- OS (e.g. from /etc/os-release): ubuntu\r\n- Kernel (e.g. `uname -a`): Linux ip-172-31-10-97 4.4.0-64-generic #85-Ubuntu SMP Mon Feb 20 11:50:30 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux\r\n- Install tools: ubuntu official kubernetes (juju)\r\n- Others:\r\n"},"comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments/447826041","html_url":"https://github.com/kubernetes/kubernetes/issues/57801#issuecomment-447826041","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/57801","id":447826041,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NzgyNjA0MQ==","user":{"login":"zakkg3","id":25042095,"node_id":"MDQ6VXNlcjI1MDQyMDk1","avatar_url":"https://avatars0.githubusercontent.com/u/25042095?v=4","gravatar_id":"","url":"https://api.github.com/users/zakkg3","html_url":"https://github.com/zakkg3","followers_url":"https://api.github.com/users/zakkg3/followers","following_url":"https://api.github.com/users/zakkg3/following{/other_user}","gists_url":"https://api.github.com/users/zakkg3/gists{/gist_id}","starred_url":"https://api.github.com/users/zakkg3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zakkg3/subscriptions","organizations_url":"https://api.github.com/users/zakkg3/orgs","repos_url":"https://api.github.com/users/zakkg3/repos","events_url":"https://api.github.com/users/zakkg3/events{/privacy}","received_events_url":"https://api.github.com/users/zakkg3/received_events","type":"User","site_admin":false},"created_at":"2018-12-17T12:19:55Z","updated_at":"2018-12-17T12:19:55Z","author_association":"NONE","body":"In my case was a indentation problem:\r\n\r\nImage section should be placed in container specification. ImagePullSecret should be placed in spec section so proper yaml file looks like this (please note indent):\r\n\r\n```\r\napiVersion: extensions/v1beta1\r\nkind: Deployment\r\nmetadata:\r\n  name: test-pod-deployment\r\n  labels:\r\n    app: test-pod\r\nspec:\r\n  replicas: 3\r\n  selector:\r\n    matchLabels:\r\n      app: test-pod\r\n  template:\r\n    metadata:\r\n      labels:\r\n        app: test-pod\r\n    spec:\r\n      containers:\r\n       - name: test-pod\r\n         image: <private-registry>\r\n      imagePullSecrets:\r\n       - name: regcred\r\n```"}}
{"actor":{"display_login":"zakkg3"}}