Skip to content
This repository has been archived by the owner on Jul 30, 2021. It is now read-only.

TLS: converge asset naming of SH and non-SH etcd #621

Merged
merged 1 commit into from
Jul 5, 2017

Conversation

hongchaodeng
Copy link
Contributor

@hongchaodeng hongchaodeng commented Jun 30, 2017

fix #611

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 30, 2017
@hongchaodeng hongchaodeng force-pushed the up2 branch 9 times, most recently from d8aaeae to f2f768b Compare June 30, 2017 19:11
@hongchaodeng
Copy link
Contributor Author

Manually verified recovery case too.

@hongchaodeng
Copy link
Contributor Author

@xiang90 @diegs @aaronlevy
Can you take a review?

@hongchaodeng
Copy link
Contributor Author

coreosbot run e2e

Seems flake:

reboot_test.go:44: rebooting node: ssh: handshake failed: EOF

@hongchaodeng
Copy link
Contributor Author

coreosbot run e2e

@hongchaodeng
Copy link
Contributor Author

@aaronlevy @diegs Can you approve this?

Copy link
Contributor

@diegs diegs left a comment

Choose a reason for hiding this comment

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

Somme comments based on what you wrote in #611 (comment)

Am I misunderstanding the distinction between client-ca and server-ca?

@@ -21,10 +21,10 @@ coreos:
Environment="ETCD_LISTEN_PEER_URLS=https://$private_ipv4:2380"
Environment="ETCD_INITIAL_CLUSTER={{ETCD_INITIAL_CLUSTER}}"
Environment="ETCD_SSL_DIR=/etc/etcd/tls"
Environment="ETCD_TRUSTED_CA_FILE=/etc/ssl/certs/etcd-ca.crt"
Environment="ETCD_TRUSTED_CA_FILE=/etc/ssl/certs/etcd-client-ca.crt"
Copy link
Contributor

Choose a reason for hiding this comment

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

etcd-server-ca.rt?

Copy link
Contributor

Choose a reason for hiding this comment

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

(and the below should be etcd-server.crt and etcd-server.key

Environment="ETCD_PEER_TRUSTED_CA_FILE=/etc/ssl/certs/etcd-ca.crt"
Environment="ETCD_PEER_CERT_FILE=/etc/ssl/certs/etcd-peer.crt"
Environment="ETCD_PEER_KEY_FILE=/etc/ssl/certs/etcd-peer.key"
Environment="ETCD_PEER_TRUSTED_CA_FILE=/etc/ssl/certs/etcd-client-ca.crt"
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't this be peer-ca.crt?

Environment="ETCD_PEER_TRUSTED_CA_FILE=/etc/ssl/certs/etcd-ca.crt"
Environment="ETCD_PEER_CERT_FILE=/etc/ssl/certs/etcd-peer.crt"
Environment="ETCD_PEER_KEY_FILE=/etc/ssl/certs/etcd-peer.key"
Environment="ETCD_PEER_TRUSTED_CA_FILE=/etc/ssl/certs/etcd-client-ca.crt"
Copy link
Contributor

Choose a reason for hiding this comment

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

etcd-peer-ca.crt?

Environment="ETCD_PEER_TRUSTED_CA_FILE=/etc/ssl/certs/etcd-ca.crt"
Environment="ETCD_PEER_CERT_FILE=/etc/ssl/certs/etcd-peer.crt"
Environment="ETCD_PEER_KEY_FILE=/etc/ssl/certs/etcd-peer.key"
Environment="ETCD_PEER_TRUSTED_CA_FILE=/etc/ssl/certs/etcd-client-ca.crt"
Copy link
Contributor

Choose a reason for hiding this comment

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

peer-ca.crt?

@@ -12,11 +12,11 @@
Environment="ETCD_LISTEN_CLIENT_URLS=https://0.0.0.0:2379"
Environment="ETCD_LISTEN_PEER_URLS=https://0.0.0.0:2380"
Environment="ETCD_SSL_DIR=/etc/etcd/tls"
Environment="ETCD_TRUSTED_CA_FILE=/etc/ssl/certs/etcd-ca.crt"
Environment="ETCD_TRUSTED_CA_FILE=/etc/ssl/certs/etcd-client-ca.crt"
Copy link
Contributor

Choose a reason for hiding this comment

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

etcd-server-ca.crt?

Copy link
Contributor

Choose a reason for hiding this comment

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

(and the two lines below)

@hongchaodeng
Copy link
Contributor Author

@diegs
Let me answer all of the questions above.
So those cloud config yamls are for non-self-hosted cases.
In current setup, non-self-hosted assets for etcd includes:

etcd-client-ca.crt
etcd-client.[crt,key]
etcd-peer.[crt,key]

@diegs
Copy link
Contributor

diegs commented Jul 5, 2017

@hongchaodeng couldn't the non-self-hosted code path in bootkube render also output server-ca.crt and peer-ca.crt too (even if they're both copies of etcd-client-ca.crt) to make things consistent and clear?

(Discussed in 2 comments at #611 (comment), I know it's a long thread so thanks for helping to clean all this up)

@hongchaodeng
Copy link
Contributor Author

@diegs
Could we do it in another PR? This PR is already huge. And this PR is only about converging the paths.

Copy link
Contributor

@diegs diegs left a comment

Choose a reason for hiding this comment

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

I'd really just rather get this right in this PR. It's only a few more lines, and then it's done. If we punt to another PR we are going to change some of the exact same lines again.

@@ -139,7 +139,7 @@ func newEtcdTLSAssets(etcdCACert, etcdClientCert *x509.Certificate, etcdClientKe
}

assets = append(assets, []Asset{
{Name: AssetPathEtcdCA, Data: tlsutil.EncodeCertificatePEM(etcdCACert)},
{Name: AssetPathEtcdClientCA, Data: tlsutil.EncodeCertificatePEM(etcdCACert)},
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add AssetPathEtcdServer[CA,Key,Cert] here.

Please add AssetPathEtcdPeerCA on line 136 above.

@@ -21,10 +21,10 @@ coreos:
Environment="ETCD_LISTEN_PEER_URLS=https://$private_ipv4:2380"
Environment="ETCD_INITIAL_CLUSTER={{ETCD_INITIAL_CLUSTER}}"
Environment="ETCD_SSL_DIR=/etc/etcd/tls"
Environment="ETCD_TRUSTED_CA_FILE=/etc/ssl/certs/etcd-ca.crt"
Environment="ETCD_TRUSTED_CA_FILE=/etc/ssl/certs/etcd-client-ca.crt"
Copy link
Contributor

Choose a reason for hiding this comment

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

(and the below should be etcd-server.crt and etcd-server.key

@@ -12,11 +12,11 @@
Environment="ETCD_LISTEN_CLIENT_URLS=https://0.0.0.0:2379"
Environment="ETCD_LISTEN_PEER_URLS=https://0.0.0.0:2380"
Environment="ETCD_SSL_DIR=/etc/etcd/tls"
Environment="ETCD_TRUSTED_CA_FILE=/etc/ssl/certs/etcd-ca.crt"
Environment="ETCD_TRUSTED_CA_FILE=/etc/ssl/certs/etcd-client-ca.crt"
Copy link
Contributor

Choose a reason for hiding this comment

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

(and the two lines below)

@hongchaodeng
Copy link
Contributor Author

All fixed

Copy link
Contributor

@diegs diegs left a comment

Choose a reason for hiding this comment

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

awesome, thanks!

@xiang90
Copy link
Contributor

xiang90 commented Jul 5, 2017

coreosbot run e2e

@hongchaodeng hongchaodeng merged commit ed2e94e into kubernetes-retired:master Jul 5, 2017
@hongchaodeng hongchaodeng deleted the up2 branch July 5, 2017 21:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

etcd TLS paths are inconsistent or disorganized
4 participants