Skip to content

Prevent pod admission before service account tokens exist #3035

Closed

Description

@liggitt

If a build or deployment pod is created immediately after creating a project, but before the serviceaccount API tokens have been generated, no token will be mounted, which will fail the build/deployment.

More broadly, this is true of any pod running a container which expects to make use of service account tokens.

The QPS changes in #3003 greatly narrowed the window where this issue is possible, but we may want to require the API token to exist in the serviceaccount admission controller.

Activity

  1. added
    kind/bug
    on Jun 10, 2015
  2. self-assigned this
    on Jun 10, 2015
  3. liggitt commented on Jun 10, 2015

    @liggitt
    ContributorAuthor

    This manifests itself as a pod with a service account set, but no volumemount in the pod.spec for the API token secret

  4. liggitt commented on Jun 10, 2015

    @liggitt
    ContributorAuthor

    @bparees will the build controller retry creating the build pod if it is rejected on admission? at what interval?
    @ironcladlou will the deployment controller retry creating the deployer pod if admission rejects it? at what interval?

  5. ironcladlou commented on Jun 10, 2015

    @ironcladlou
    Contributor

    @liggitt

    @ironcladlou will the deployment controller retry creating the deployer pod if admission rejects it? at what interval?

    Looks like it's currently configured to retry once immediately. If that's not sufficient we can change it.

  6. bparees commented on Jun 10, 2015

    @bparees
    Contributor

    @liggitt if "admission control rejection" means that this will get an error:
    return c.KubeClient.Pods(namespace).Create(pod)

    then we'll retry for 30 minutes using a 1/second token bucket with a 10 token burst potential.

    which in hindsight seems pretty aggressive (we used to give up after a minute).

  7. liggitt commented on Jun 10, 2015

    @liggitt
    ContributorAuthor

    @ironcladlou: retry once immediately
    @bparees: retry for 30 minutes using a 1/second token bucket

    apparently we care a lot more about builds than deployments :)

  8. ironcladlou commented on Jun 10, 2015

    @ironcladlou
    Contributor

    The retry system started in deployments, got adopted in builds, and new features have been added to the core support. Not all of them have found their way back to deployments (the token buckets have and are effective for cases where we retry more than once, but the time based retries have not). Should deployments be updated to take advantage of the time based retries?

  9. bparees commented on Jun 10, 2015

    @bparees
    Contributor

    @ironcladlou only retrying once and failing does seem overly pessimistic.

  10. ironcladlou commented on Jun 10, 2015

    @ironcladlou
    Contributor

    #3051 will cover the requirements for deployment retry handling.

  11. modified the milestone: 1.1.0 on Jun 17, 2015
  12. liggitt commented on Jul 1, 2015

    @liggitt
    ContributorAuthor

    This change was made upstream in kubernetes/kubernetes#10523

  13. liggitt commented on Jul 15, 2015

    @liggitt
    ContributorAuthor

    Merged in #3703 rebase

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/reliabilitycomponent/authkind/bugpriority/P2

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions