{"action":"created","issue":{"url":"https://api.github.com/repos/rancher/rancher/issues/4548","repository_url":"https://api.github.com/repos/rancher/rancher","labels_url":"https://api.github.com/repos/rancher/rancher/issues/4548/labels{/name}","comments_url":"https://api.github.com/repos/rancher/rancher/issues/4548/comments","events_url":"https://api.github.com/repos/rancher/rancher/issues/4548/events","html_url":"https://github.com/rancher/rancher/issues/4548","id":150961979,"number":4548,"title":"Adding support for ServiceAccount in kubernetes","user":{"login":"galal-hussein","id":3309968,"avatar_url":"https://avatars.githubusercontent.com/u/3309968?v=3","gravatar_id":"","url":"https://api.github.com/users/galal-hussein","html_url":"https://github.com/galal-hussein","followers_url":"https://api.github.com/users/galal-hussein/followers","following_url":"https://api.github.com/users/galal-hussein/following{/other_user}","gists_url":"https://api.github.com/users/galal-hussein/gists{/gist_id}","starred_url":"https://api.github.com/users/galal-hussein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/galal-hussein/subscriptions","organizations_url":"https://api.github.com/users/galal-hussein/orgs","repos_url":"https://api.github.com/users/galal-hussein/repos","events_url":"https://api.github.com/users/galal-hussein/events{/privacy}","received_events_url":"https://api.github.com/users/galal-hussein/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rancher/rancher/labels/area/kubernetes","name":"area/kubernetes","color":"fbca04"},{"url":"https://api.github.com/repos/rancher/rancher/labels/kind/bug","name":"kind/bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"prachidamle","id":1470602,"avatar_url":"https://avatars.githubusercontent.com/u/1470602?v=3","gravatar_id":"","url":"https://api.github.com/users/prachidamle","html_url":"https://github.com/prachidamle","followers_url":"https://api.github.com/users/prachidamle/followers","following_url":"https://api.github.com/users/prachidamle/following{/other_user}","gists_url":"https://api.github.com/users/prachidamle/gists{/gist_id}","starred_url":"https://api.github.com/users/prachidamle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prachidamle/subscriptions","organizations_url":"https://api.github.com/users/prachidamle/orgs","repos_url":"https://api.github.com/users/prachidamle/repos","events_url":"https://api.github.com/users/prachidamle/events{/privacy}","received_events_url":"https://api.github.com/users/prachidamle/received_events","type":"User","site_admin":false},"assignees":[{"login":"prachidamle","id":1470602,"avatar_url":"https://avatars.githubusercontent.com/u/1470602?v=3","gravatar_id":"","url":"https://api.github.com/users/prachidamle","html_url":"https://github.com/prachidamle","followers_url":"https://api.github.com/users/prachidamle/followers","following_url":"https://api.github.com/users/prachidamle/following{/other_user}","gists_url":"https://api.github.com/users/prachidamle/gists{/gist_id}","starred_url":"https://api.github.com/users/prachidamle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prachidamle/subscriptions","organizations_url":"https://api.github.com/users/prachidamle/orgs","repos_url":"https://api.github.com/users/prachidamle/repos","events_url":"https://api.github.com/users/prachidamle/events{/privacy}","received_events_url":"https://api.github.com/users/prachidamle/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/rancher/rancher/milestones/70","html_url":"https://github.com/rancher/rancher/milestones/Release%201.1.0","labels_url":"https://api.github.com/repos/rancher/rancher/milestones/70/labels","id":1835014,"number":70,"title":"Release 1.1.0","description":"","creator":{"login":"will-chan","id":10134676,"avatar_url":"https://avatars.githubusercontent.com/u/10134676?v=3","gravatar_id":"","url":"https://api.github.com/users/will-chan","html_url":"https://github.com/will-chan","followers_url":"https://api.github.com/users/will-chan/followers","following_url":"https://api.github.com/users/will-chan/following{/other_user}","gists_url":"https://api.github.com/users/will-chan/gists{/gist_id}","starred_url":"https://api.github.com/users/will-chan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/will-chan/subscriptions","organizations_url":"https://api.github.com/users/will-chan/orgs","repos_url":"https://api.github.com/users/will-chan/repos","events_url":"https://api.github.com/users/will-chan/events{/privacy}","received_events_url":"https://api.github.com/users/will-chan/received_events","type":"User","site_admin":false},"open_issues":23,"closed_issues":14,"state":"open","created_at":"2016-06-17T16:40:40Z","updated_at":"2016-06-27T23:03:14Z","due_on":"2016-06-30T07:00:00Z","closed_at":null},"comments":4,"created_at":"2016-04-25T19:45:17Z","updated_at":"2016-06-27T23:53:01Z","closed_at":null,"body":"Rancher Version:\r\n1.0.1\r\nDocker Version:\r\n1.10.1\r\n\r\nService Account admission controller is not enabled in kubernetes agent, so any pod will be created with no default service account, also creating a manual service account with secret doesn't seem to work:\r\n\r\n```\r\n$ cat sa.yaml\r\napiVersion: v1\r\nkind: ServiceAccount\r\nmetadata:\r\n  name: default2\r\n  namespace: default\r\nsecrets:\r\nimagePullSecrets:\r\n- name: myregistrykey\r\n$ kubectl create -f sa.yaml \r\nserviceaccount \"default2\" created\r\n$ kubectl get serviceaccount\r\nNAME       SECRETS   AGE\r\ndefault    0         36m\r\ndefault2   0         7s\r\n``` \r\nWhere myregistrykey is the the docker hub registry credentials, then i tried to create a pod with this new service account, but the imagepullsecret was not added to the pod spec hence the pulling failed:\r\n\r\n```\r\n$ kubectl create -f pod-awesome.yaml \r\npod \"awesomeapp\" created\r\n\r\n$ kubectl get pods\r\nNAME         READY     STATUS         RESTARTS   AGE\r\nawesomeapp   0/1       ErrImagePull   0          5s\r\n\r\n$ kubectl get pods/awesomeapp -o yaml\r\napiVersion: v1\r\nkind: Pod\r\nmetadata:\r\n  creationTimestamp: 2016-04-25T19:41:55Z\r\n  labels:\r\n    app: awesomeapp\r\n  name: awesomeapp\r\n  namespace: default\r\n  resourceVersion: \"568\"\r\n  selfLink: /api/v1/namespaces/default/pods/awesomeapp\r\n  uid: c430b686-0b1d-11e6-83d5-029883ea05c4\r\nspec:\r\n  containers:\r\n  - image: husseingalal/awesomeapp\r\n    imagePullPolicy: Always\r\n    name: awesomeapp\r\n    ports:\r\n    - containerPort: 80\r\n      protocol: TCP\r\n    resources: {}\r\n    terminationMessagePath: /dev/termination-log\r\n  dnsPolicy: ClusterFirst\r\n  nodeName: node-02\r\n  restartPolicy: Always\r\n  securityContext: {}\r\n  serviceAccount: default2\r\n  serviceAccountName: default2\r\n  terminationGracePeriodSeconds: 30\r\nstatus:\r\n  conditions:\r\n  - lastProbeTime: null\r\n    lastTransitionTime: 2016-04-25T19:41:55Z\r\n    message: 'containers with unready status: [awesomeapp]'\r\n    reason: ContainersNotReady\r\n    status: \"False\"\r\n    type: Ready\r\n  containerStatuses:\r\n  - image: husseingalal/awesomeapp\r\n    imageID: \"\"\r\n    lastState: {}\r\n    name: awesomeapp\r\n    ready: false\r\n    restartCount: 0\r\n    state:\r\n      waiting:\r\n        message: Back-off pulling image \"husseingalal/awesomeapp\"\r\n        reason: ImagePullBackOff\r\n  hostIP: 139.59.169.227\r\n  phase: Pending\r\n  podIP: 10.42.145.211\r\n  startTime: 2016-04-25T19:41:55Z\r\n``` "},"comment":{"url":"https://api.github.com/repos/rancher/rancher/issues/comments/228910391","html_url":"https://github.com/rancher/rancher/issues/4548#issuecomment-228910391","issue_url":"https://api.github.com/repos/rancher/rancher/issues/4548","id":228910391,"user":{"login":"prachidamle","id":1470602,"avatar_url":"https://avatars.githubusercontent.com/u/1470602?v=3","gravatar_id":"","url":"https://api.github.com/users/prachidamle","html_url":"https://github.com/prachidamle","followers_url":"https://api.github.com/users/prachidamle/followers","following_url":"https://api.github.com/users/prachidamle/following{/other_user}","gists_url":"https://api.github.com/users/prachidamle/gists{/gist_id}","starred_url":"https://api.github.com/users/prachidamle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prachidamle/subscriptions","organizations_url":"https://api.github.com/users/prachidamle/orgs","repos_url":"https://api.github.com/users/prachidamle/repos","events_url":"https://api.github.com/users/prachidamle/events{/privacy}","received_events_url":"https://api.github.com/users/prachidamle/received_events","type":"User","site_admin":false},"created_at":"2016-06-27T23:53:01Z","updated_at":"2016-06-27T23:53:01Z","body":"@galal-hussein In above /tmp/build-robot-secret.yaml, you are creating a secret manually for an already existing service-account \"build-robot\".\r\n\r\nDo you have this service-account \"build-robot\"?\r\n\r\nIf you don't see the account by doing the following, then the secret you are creating manually will not be linked to any account. \r\n\r\n> kubectl get serviceaccounts/build-robot -o yaml\r\nError from server: serviceaccounts \"build-robot\" not found\r\n> kubectl get serviceaccounts\r\nNAME      SECRETS   AGE\r\ndefault   1         27m\r\n>\r\n\r\nIf you dont have the \"build-robot\" account, then I dont think this is a valid test.\r\n\r\n\r\n\r\n\r\n"}}
{"actor":{"display_login":"prachidamle"}}