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

Update to use latest etcd client library #18635

Merged
merged 1 commit into from
Dec 18, 2015

Conversation

timothysc
Copy link
Member

This is the update for the new client library after all the storage refactoring. There is still an error I'm chasing down in the cache, but everything else appears green.

Final implementation for #11962

@wojtek-t & @jdef for review

/cc @liggitt

@k8s-github-robot
Copy link

Labelling this PR as size/L

@k8s-github-robot k8s-github-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Dec 14, 2015
@k8s-bot
Copy link

k8s-bot commented Dec 14, 2015

GCE e2e test build/test passed for commit 549ae8386443242a2554e0924452ac6c62437a73.

client, err = etcd.NewClientFromFile(etcdConfigFile)
} else {
client = etcd.NewClient(etcdServerList)
func newEtcd(etcdServerList []string) (etcd.Client, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

looks like etcdConfigFile should be completely removed as a state var (and flag) from SchedulerServer

Copy link
Member

Choose a reason for hiding this comment

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

were you going to update newEtcd in kube-apiserver/app/server.go? also, what are we going to do about etcdConfigFile? that's currently the only way to connect to a secured etcd

Copy link
Member Author

Choose a reason for hiding this comment

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

re: etcdConfigFile - it's completely removed in the nwo.
/cc @xiang90

Copy link
Member Author

Choose a reason for hiding this comment

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

@jdef Done.

were you going to update newEtcd in kube-apiserver/app/server.go ?

already done.

Copy link
Contributor

Choose a reason for hiding this comment

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

so what's the recommended way to connect securely to etcd right now? we should surface that somewhere if we haven't already, I see a good amount of confusion on slack.

@jdef
Copy link
Contributor

jdef commented Dec 14, 2015

/cc @sttts since I'm OOO after Monday

@@ -287,7 +287,6 @@ func TestFiltering(t *testing.T) {
if err != nil {
t.Fatalf("Incorrect resourceVersion: %s", fooCreated.ResourceVersion)
}
initialVersion--
Copy link
Member

Choose a reason for hiding this comment

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

Why did you remove this?

Copy link
Member Author

Choose a reason for hiding this comment

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

RV shift.

@wojtek-t wojtek-t assigned wojtek-t and unassigned dchen1107 Dec 14, 2015
}
glog.Infof("Creating etcd client pointing to %v", cfg.Endpoints)

kAPI := etcd.NewKeysAPI(etcdClient)
Copy link
Member

Choose a reason for hiding this comment

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

nit, but I would assume kapi meant "kubernetes api"... maybe a clearer name?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@wojtek-t wojtek-t mentioned this pull request Dec 15, 2015
@wojtek-t
Copy link
Member

@timothysc - I think that this PR should fix the remaining issue in Go 1.5 - see #18701 for more details.

Can we prioritize it to have this merged ASAP?

@timothysc
Copy link
Member Author

on it.

@wojtek-t
Copy link
Member

@timothysc - thanks a lot!

@timothysc
Copy link
Member Author

@wojtek-t I think I'll need to ping you tomorrow on the cacher tomorrow, there is some subtlety that I'm missing that is causing an issue there.

@wojtek-t
Copy link
Member

@timothysc - sure

@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 16, 2015
@wojtek-t
Copy link
Member

@timothysc - can you please rebase this PR - it will be much simpler for me to patch it and debug the cacher problem

@timothysc timothysc force-pushed the etcd_client_post_cleanup branch from 549ae83 to 5074bb1 Compare December 16, 2015 15:36
@k8s-github-robot k8s-github-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 16, 2015
@wojtek-t
Copy link
Member

@timothysc - cacher_test.go - line 205 (initialVersion--) should be removed

This solves the problem (at least when I'm running it locally).

@wojtek-t
Copy link
Member

unit tests passed, e2e flake

@k8s-bot test this please

@wojtek-t
Copy link
Member

infrastructure unit-test failure:

git checkout -f b43af14b26801071c65ee65bab22f5247840dd15
FATAL: Could not checkout b43af14b26801071c65ee65bab22f5247840dd15

@k8s-bot unit test this please

@k8s-bot
Copy link

k8s-bot commented Dec 18, 2015

GCE e2e test build/test passed for commit c505a5d.

@wojtek-t
Copy link
Member

The same again:

git checkout -f b43af14b26801071c65ee65bab22f5247840dd15
FATAL: Could not checkout b43af14b26801071c65ee65bab22f5247840dd15

@k8s-bot test this please

@k8s-bot
Copy link

k8s-bot commented Dec 18, 2015

GCE e2e build/test failed for commit c505a5d.

@wojtek-t
Copy link
Member

@k8s-bot e2e test this please

@k8s-bot
Copy link

k8s-bot commented Dec 18, 2015

GCE e2e test build/test passed for commit c505a5d.

@wojtek-t
Copy link
Member

All tests are passing - merging manually, to unblock effort to update to Go 1.5

wojtek-t added a commit that referenced this pull request Dec 18, 2015
Update to use latest etcd client library
@wojtek-t wojtek-t merged commit d1e039b into kubernetes:master Dec 18, 2015
@timothysc
Copy link
Member Author

Awesome!

@ixdy
Copy link
Member

ixdy commented Dec 18, 2015

I think this PR started causing several etcd unit tests to data race or timeout, as linked in the above issues.

cfg := etcd.Config{
Endpoints: c.ServerList,
// TODO: Determine if transport needs optimization
Transport: &http.Transport{
Copy link
Contributor

Choose a reason for hiding this comment

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

why not use util.SetTransportDefaults here?

Copy link
Member

Choose a reason for hiding this comment

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

We are overwriting some things (e.g. MaxIdleConnsPerHost) - it was crucial for performance reasons.

Copy link
Member

Choose a reason for hiding this comment

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

You can still do that with SetTransportDefaults… only set MaxIdle… and the defaulting func will set all the other defaults

Copy link
Member Author

Choose a reason for hiding this comment

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

The defaults are explicitly specified so others will know the values on inspection, vs. hunt and peck.

@jdef
Copy link
Contributor

jdef commented Jan 12, 2016

xref #18153

@streamnsight
Copy link

@timothysc
@jdef
@wojtek-t

I am running into this issue:

#24578

trying to run apiserver with etcd TLS.

TLS worked fine with v1.1.2 I am trying to upgrade from.
I could get into the apiserver container and cat the files apiserver is complaining about not finding, so I don't understand what is wrong.

@streamnsight
Copy link

same problem with 1.2.1

@streamnsight
Copy link

streamnsight commented Apr 21, 2016

in using TLS for the etcd client before I had to have something like

var cfg store.Config

    if caCert != "" && clientCert != "" && clientKey != "" {
        var tlsInfo = transport.TLSInfo{
            CAFile:   caCert,
            CertFile: clientCert,
            KeyFile:  clientKey,
            TrustedCAFile: caCert,
            ClientCertAuth: true,
        }
        t, err := transport.NewTransport(tlsInfo, 10 * time.Second)
        if err != nil {
            fmt.Fprintln(os.Stderr, err)
            os.Exit(1)
        }

        cfg = store.Config{
            ConnectionTimeout: 10 * time.Second,
            TLS: t.TLSClientConfig,
        }
    } else {
        cfg = store.Config{
                ConnectionTimeout: 10 * time.Second,
            }
    }

@timothysc
Copy link
Member Author

@streamnsight The fix is here #21535, but it changes the default initialization. I believe the release note denotes as well.

@streamnsight
Copy link

@timothysc
Sorry Tim but I don't get it:
I don't see anything in the release notes, and I don't understand the 'fix': what I see is a PR but no explanation about how I'm now suppose to configure secured etcd properly.
If i go by the docs it doesn't work as intended.

Could you please explain what I'm supposed to do or point me to the proper documentation.
Thanks

@liggitt
Copy link
Member

liggitt commented Apr 21, 2016

the updates needed for secured etcd were in the v1.2.0 release notes in the "action required" section:

Running against a secured etcd requires these flags to be passed to kube-apiserver (instead of --etcd-config):
    --etcd-certfile, --etcd-keyfile (if using client cert auth)
    --etcd-cafile (if not using system roots)

@streamnsight
Copy link

@liggitt Thanks for pointing this out.

@streamnsight
Copy link

FYI the problem I was having was having quotes around the file names in the etcd config.
This is a pretty stupid mistake, but I thought yaml supported both quoted or not quoted string, so just wanted to point it out here.

jonboulle pushed a commit to jonboulle/kubernetes that referenced this pull request May 31, 2016
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. 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.