Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Predeploy RoleBinding before unmanaged pods #354

Merged
merged 2 commits into from
Oct 29, 2018

Conversation

lautis
Copy link
Contributor

@lautis lautis commented Oct 18, 2018

RoleBindings should be deployed before unmanaged pods. This matters when RoleBindings define Pod Security Policies. This might prevent unmanaged pods from starting unless RoleBinding has been set up and the deployment fails.

For normal deployments only scenario it already works. Even if there is a race condition, it works as the pods retry.

Should there be a separate resource type? Other similar resource types seemed to have also the corresponding class defined.

Copy link
Contributor

@dturn dturn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this contribution! I've kicked off a CI run, but its going to be delayed due to the github webhook backlog

end

def deploy_succeeded?
exists?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can tell there is no status field for this resource so the success condition seems reasonable

Copy link
Contributor

@KnVerey KnVerey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just have a small request regarding the tests. Thanks for the contribution!

test/integration/kubernetes_deploy_test.rb Show resolved Hide resolved
@KnVerey
Copy link
Contributor

KnVerey commented Oct 28, 2018

Could you please rebase this? Code LGTM but tests are failing because you're using the new constant KubeclientHelper::TEST_CONTEXT from master, which doesn't exist on this branch.

RoleBindings should be deployed before unmanaged pods. This matters when
RoleBindings define Pod Security Policies. This might prevent unmanaged
pods from starting unless RoleBinding has been set up. Regular pods
retry so the race condition would not break anything.
@lautis
Copy link
Contributor Author

lautis commented Oct 28, 2018

Rebased. I used Docker for Mac for testing from #356, which almost worked as it didn't see to like context name "docker-for-desktop" rather than "docker-for-mac". Didn't realise that it also changed the constant name.

@KnVerey KnVerey merged commit 903e984 into Shopify:master Oct 29, 2018
@dturn dturn temporarily deployed to rubygems November 14, 2018 23:25 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants