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

Provide flags to use etcd3 backed storage #24455

Merged
merged 1 commit into from
Apr 29, 2016

Conversation

hongchaodeng
Copy link
Contributor

@hongchaodeng hongchaodeng commented Apr 19, 2016

No action required from user when upgrading to v1.3.0

ref: #24405

What's in this PR?

  • Add a new flag "storage-backend" to choose "etcd2" or "etcd3". By default (i.e. empty), it's "etcd2".
  • Take out etcd config code into a standalone package and let it create etcd2 or etcd3 storage backend given user input.

@k8s-github-robot k8s-github-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. release-note-label-needed labels Apr 19, 2016
@bgrant0607 bgrant0607 assigned lavalamp and unassigned bgrant0607 Apr 19, 2016
@bgrant0607
Copy link
Member

cc @smarterclayton

DeserializationCacheSize int
}

func (c *ETCDStorageConfig) NewStorage() (storage.Interface, error) {
Copy link
Member

@timothysc timothysc Apr 19, 2016

Choose a reason for hiding this comment

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

Shouldn't we be passing back storage.Interface here?

  • please add Factory to denote operation. Which is consistent in other places in the codebase.

Copy link
Member

Choose a reason for hiding this comment

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

Changing the type name like I suggest should be OK. This method could optionally be called Construct, New, Build, or it's OK as is.

@timothysc
Copy link
Member

Minor comments for now, feel free to ping me when it's ready.

@@ -204,6 +204,7 @@ func (s *APIServer) AddFlags(fs *pflag.FlagSet) {
fs.StringVar(&s.AuthorizationConfig.WebhookConfigFile, "authorization-webhook-config-file", s.AuthorizationConfig.WebhookConfigFile, "File with webhook configuration in kubeconfig format, used with --authorization-mode=Webhook. The API server will query the remote service to determine access on the API server's secure port.")
fs.StringVar(&s.AdmissionControl, "admission-control", s.AdmissionControl, "Ordered list of plug-ins to do admission control of resources into cluster. Comma-delimited list of: "+strings.Join(admission.GetPlugins(), ", "))
fs.StringVar(&s.AdmissionControlConfigFile, "admission-control-config-file", s.AdmissionControlConfigFile, "File with admission control configuration.")
fs.StringSliceVar(&s.EtcdConfig.Type, "--storage-backend", s.EtcdConfig.Type, "The storage backend for persistent states")
Copy link
Member

Choose a reason for hiding this comment

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

No one is going to understand that description. At a minimum list all the valid options?

@hongchaodeng
Copy link
Contributor Author

Sorry for the delay.
I have made a storage factory style change.
PTAL. Thanks!

@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 20, 2016
StorageTypeETCD2 = "etcd2"
StorageTypeETCD3 = "etcd3"
)

Copy link
Contributor

Choose a reason for hiding this comment

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

probably

type StorageType string

then use this type to define etcd2, etcd3, etc..

@hongchaodeng
Copy link
Contributor Author

@timothysc @lavalamp
Can you guys walk through again and see if the structure is good?

@hongchaodeng
Copy link
Contributor Author

Rebased and addressed comments

@hongchaodeng
Copy link
Contributor Author

Rebased and squashed


// Config is configuration for creating a storage backend.
type Config struct {
Type string
Copy link
Member

Choose a reason for hiding this comment

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

Please add comments to all the fields here - those aren't obvious for people who didn't touch this code.

@hongchaodeng
Copy link
Contributor Author

@wojtek-t
Added docs. PTAL

@hongchaodeng hongchaodeng force-pushed the fl branch 2 times, most recently from 405472c to 55ca7c1 Compare April 27, 2016 23:25
@hongchaodeng
Copy link
Contributor Author

@k8s-bot unit test this issue: #24815

@k8s-bot
Copy link

k8s-bot commented Apr 28, 2016

GCE e2e build/test passed for commit c0071a1.

@hongchaodeng
Copy link
Contributor Author

Squashed and all tests are green

@timothysc timothysc assigned timothysc and unassigned lavalamp Apr 28, 2016
@timothysc timothysc added lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-merge release-note-action-required Denotes a PR that introduces potentially breaking changes that require user action. and removed needs-ok-to-merge labels Apr 28, 2016
@xiang90 xiang90 added the priority/backlog Higher priority than priority/awaiting-more-evidence. label Apr 29, 2016
@k8s-github-robot
Copy link

@k8s-bot test this [submit-queue is verifying that this PR is safe to merge]

@k8s-bot
Copy link

k8s-bot commented Apr 29, 2016

GCE e2e build/test passed for commit c0071a1.

@k8s-github-robot
Copy link

Automatic merge from submit-queue

@k8s-github-robot k8s-github-robot merged commit 11298d0 into kubernetes:master Apr 29, 2016
@hongchaodeng hongchaodeng deleted the fl branch April 29, 2016 15:55
@erictune
Copy link
Member

erictune commented Jul 2, 2016

@hongchaodeng Does this PR require action by the user when upgrading to 1.3.0? (Think about non-developer users.) If so, please edit your first comment to have a release-note block, like in #28132. If it is just an optional feature, please change the label to just release-note.

@xiang90 xiang90 added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-action-required Denotes a PR that introduces potentially breaking changes that require user action. labels Jul 2, 2016
@xiang90
Copy link
Contributor

xiang90 commented Jul 2, 2016

@erictune Fixed the label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/backlog Higher priority than priority/awaiting-more-evidence. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants