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

Implement deployments without Deployment #584

Merged
merged 1 commit into from
Jan 9, 2015

Conversation

ironcladlou
Copy link
Contributor

What?

This PR implements deployments without using the Deployment API object. ReplicationControllers are used as a replacement for Deployment.

Why?

Since the metadata represented by Deployment can also be represented by ReplicationController annotations, the Deployment resource is a potentially unnecessary and complicating layer of indirection. Removing the resource would reduce the API surface area and bring tighter upstream integration. The original design discussion took place in #507.

Note that this PR does not actually remove Deployment from the public or internal API- that structure can be deprecated and removed separately.

TODO

  • Implement core design
  • Fix unit tests
  • Fix integration tests
  • Fix e2e tests
  • Update godocs
  • Address any existing UI code

@ironcladlou ironcladlou changed the title WIP implement deployments without Deployment (Do not merge) WIP: Implement deployments without Deployment Dec 17, 2014
@ironcladlou
Copy link
Contributor Author

@smarterclayton @pmorie Still tracking down some issue in the e2e test preventing the image change trigger from causing a new deployment, but I think the bulk of the work is ready for general review.

@ironcladlou
Copy link
Contributor Author

@jwforres Can you evaluate this for UI impact?

@ironcladlou
Copy link
Contributor Author

The e2e test failure was fixed by pulling the latest registry image.

@pmorie
Copy link
Contributor

pmorie commented Dec 17, 2014

@ironcladlou Does the deployment resource still have any meaning? It seems like part of this refactor should be to introduce the 'virtual resource' that we discussed for deployments.

@jwforres
Copy link
Member

@ironcladlou UI can work against this with some minimal changes. All the key bits from deployment are there (what triggered me and what deploymentConfig I came from). I've got it working locally, can tweak as needed based on any updates to this PR.

@ironcladlou
Copy link
Contributor Author

@pmorie

Does the deployment resource still have any meaning? It seems like part of this refactor should be to introduce the 'virtual resource' that we discussed for deployments.

The Deployment resource becomes vestigial with this PR. We could potentially adapt ReplicationControllers/Deployments, but that would be more design and work. Is it worth it?

@ironcladlou
Copy link
Contributor Author

@jwforres

UI can work against this with some minimal changes. All the key bits from deployment are there (what triggered me and what deploymentConfig I came from). I've got it working locally, can tweak as needed based on any updates to this PR.

There's something I forgot to point out which is subtle but probably relevant: Previously, the ReplicationControllers were related to a point in time snapshot of a DeploymentConfig via Deployment. To replace that, I have to serialize the DeploymentConfig on which the RC is based into an annotation (DeploymentEncodedConfigAnnotation). A better way would be to store the DeploymentConfig.ResourceVersion on the RC, but we need upstream support for retrieving a resource by version.

Now that I've said it, I wonder how exactly you're going to access old versions of DeploymentConfigs and ReplicationControllers to display history... @smarterclayton ?

@pmorie
Copy link
Contributor

pmorie commented Dec 17, 2014

@ironcladlou So, does 'list deployments' do anything?

@smarterclayton
Copy link
Contributor

If we make the name of the rc deterministic (deployment config name + version) we can live with the convention for now

@ironcladlou
Copy link
Contributor Author

@pmorie

So, does 'list deployments' do anything?

It will continue to function as usual: The API object still exists and is plumbed throughout the REST API and storage, but no deployment controllers make use of the object.

@ironcladlou
Copy link
Contributor Author

@smarterclayton

If we make the name of the rc deterministic (deployment config name + version) we can live with the convention for now

That was the convention used for Deployment.Name, and I carried that over to ReplicationControllers. The main concern I have from my previous comment is how the UI is going to present history of any kind without the capability to List or Get old ReplicationControllers or DeploymentConfigs via the REST API pending upstream work for obtaining resources by ResourceVersion.

Is there anything we have aside from implementing certain List/Get interfaces with direct etcd access where necessary?

@smarterclayton
Copy link
Contributor

Why do we need to see old versions of replication controllers? Deployment configs we can just identify as a gap that we want to fill

On Dec 17, 2014, at 6:36 PM, Dan Mace notifications@github.com wrote:

@smarterclayton

If we make the name of the rc deterministic (deployment config name + version) we can live with the convention for now

That was the convention used for Deployment.Name, and I carried that over to ReplicationControllers. The main concern I have from my previous comment is how the UI is going to present history of any kind without the capability to List or Get old ReplicationControllers or DeploymentConfigs via the REST API pending upstream work for obtaining resources by ResourceVersion.

Is there anything we have aside from implementing certain List/Get interfaces with direct etcd access where necessary?


Reply to this email directly or view it on GitHub.

@ironcladlou
Copy link
Contributor Author

Why do we need to see old versions of replication controllers? Deployment configs we can just identify as a gap that we want to fill

You're right, there's no reason to see the old ReplicationControllers. I just want to confirm that this will be a regression (as we're effectively losing the ability to see old deployments). Having access to the history is also required for rollbacks, so this could introduce speed bumps for that feature.

@smarterclayton
Copy link
Contributor

Rollbacks are almost always correlated in time with a deployment, so I don't think we'll lose much, except that the client needs to figure out what the proper RC is based on deployment config and name, and as we discussed that's more complex today.

----- Original Message -----

Why do we need to see old versions of replication controllers? Deployment
configs we can just identify as a gap that we want to fill

You're right, there's no reason to see the old ReplicationControllers. I just
want to confirm that this will be a regression (as we're effectively losing
the ability to see old deployments). Having access to the history is also
required for rollbacks, so this could introduce speed bumps for that
feature.


Reply to this email directly or view it on GitHub:
#584 (comment)

@ironcladlou ironcladlou force-pushed the rc-deployments-redux branch 2 times, most recently from 22e96cd to 02123e9 Compare January 5, 2015 15:38
@ironcladlou
Copy link
Contributor Author

[test]

@openshift-bot
Copy link
Contributor

@ironcladlou ironcladlou force-pushed the rc-deployments-redux branch 3 times, most recently from 8dab37b to 02123e9 Compare January 5, 2015 17:50
@ironcladlou
Copy link
Contributor Author

@pmorie @smarterclayton

Before I go revamp the godocs and such, this is ready for a review.

@ironcladlou
Copy link
Contributor Author

[test] again

@pmorie
Copy link
Contributor

pmorie commented Jan 5, 2015

@ironcladlou as we discussed earlier I think it would be best to re-implement the read-only operations for the Deployment resource during this PR, to avoid having a span of time where the deployments functionality and resource were still there, but didn't work at all.

Otherwise, the implementation you have here LGTM.

@ironcladlou
Copy link
Contributor Author

@pmorie

as we discussed earlier I think it would be best to re-implement the read-only operations for the
Deployment resource during this PR, to avoid having a span of time where the deployments
functionality and resource were still there, but didn't work at all.

To recap offline talks: the Deployment resource will be deprecated, and no attempts will be made with this PR to virtualize access to RCs via Deployment. We'll decide at a later time whether to remove it outright or use it as an API abstraction.

@ironcladlou ironcladlou force-pushed the rc-deployments-redux branch 3 times, most recently from 6bd61c4 to 39efec2 Compare January 7, 2015 18:53
@ironcladlou
Copy link
Contributor Author

@jwforres, please review the UI commit.

@jwforres
Copy link
Member

jwforres commented Jan 7, 2015

ui commit LGTM

@ironcladlou ironcladlou changed the title (Do not merge) WIP: Implement deployments without Deployment Implement deployments without Deployment Jan 7, 2015
@ironcladlou ironcladlou force-pushed the rc-deployments-redux branch from 39efec2 to 0eb0234 Compare January 8, 2015 15:19
@ironcladlou
Copy link
Contributor Author

@smarterclayton I now use the runtime.Codec interface under the hood for encoding/decoding, and inject latest.Codec all the way from master through the factories/controllers. Also cleaned up the switch you pointed out.

@ironcladlou ironcladlou force-pushed the rc-deployments-redux branch from 0eb0234 to 2dc416b Compare January 8, 2015 19:10
@ironcladlou
Copy link
Contributor Author

@smarterclayton Improved the annotation docs, and added a DeploymentVersionAnnotation to all ReplicationControllers for deployments which tracks the DeploymentConfig.LatestVersion on which the deployment was based.

@ironcladlou
Copy link
Contributor Author

@pmorie @smarterclayton AFAIK all feedback is addressed, please give it another look.

@ironcladlou
Copy link
Contributor Author

Also: I'm revamping the documentation for a separate PR, since it's a lot of work and will require its own discussion.

@smarterclayton
Copy link
Contributor

Hope to finish review by tonight. It's in pretty good shape - what's your confidence on tests and e2e and general use?

@ironcladlou
Copy link
Contributor Author

@smarterclayton

Hope to finish review by tonight. It's in pretty good shape - what's your confidence on tests and e2e and general use?

Pizazz levels are way up. e2e is fine, and I did manual testing with the console including builds and deployments. I can give it one last round of manual testing in the console tomorrow morning.

@ironcladlou
Copy link
Contributor Author

General use is fine except for the lack of documentation, which I'm trying to address. We also have followup cards coming up immediately for nicer CLI and console stuff around deployments and rollbacks. There will be a period of discomfort dealing with RC's from the CLI, as annotations aren't rendered which are what you need to correlate stuff, but I consider that minor at the moment.

@pmorie
Copy link
Contributor

pmorie commented Jan 9, 2015

@ironcladlou @smarterclayton pizzazz levels check out on this PR. going to use the PKE meter next 👻

@ironcladlou
Copy link
Contributor Author

Follow-on for updated documentation: #631

@@ -100,9 +104,9 @@ func TestHandleNewDeploymentCreatePodFail(t *testing.T) {
return nil, fmt.Errorf("Failed to create pod %s", pod.Name)
},
},
NextDeployment: func() *deployapi.Deployment {
NextDeployment: func() *kapi.ReplicationController {
deployment := basicDeployment()
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you not use the OkDeployment method here?

@ironcladlou ironcladlou force-pushed the rc-deployments-redux branch from 2dc416b to 1964dfe Compare January 9, 2015 17:28
Deprecate the Deployment resource and remplement deployment mechanics
using ReplicationControllers instead of Deployment. The result is a deployment
subsystem which adds fewer new concepts to Kubernetes while providing the same
functionality as the former subsystem.
@smarterclayton
Copy link
Contributor

LGTM [merge]

@smarterclayton
Copy link
Contributor

What's the worst that can happen?

@ironcladlou
Copy link
Contributor Author

@pmorie didn't finish his PKE readings... the PR could be haunted

@pmorie
Copy link
Contributor

pmorie commented Jan 9, 2015

LGTM

@openshift-bot
Copy link
Contributor

Origin Merge Results: SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_requests_openshift3/583/) (Image: devenv-fedora_524)

@openshift-bot
Copy link
Contributor

Evaluated for origin up to 1964dfe

openshift-bot pushed a commit that referenced this pull request Jan 9, 2015
@openshift-bot openshift-bot merged commit a0f73e9 into openshift:master Jan 9, 2015
@smarterclayton
Copy link
Contributor

Dan, he's been dead the whole movie.

On Jan 9, 2015, at 1:28 PM, Paul Morie notifications@github.com wrote:

LGTM


Reply to this email directly or view it on GitHub.

@ironcladlou ironcladlou deleted the rc-deployments-redux branch January 12, 2015 19:51
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.

5 participants