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

Commit 5a965bc

Browse files
committed
comment
1 parent 2e8fd95 commit 5a965bc

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

cmd/bootkube/render.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ func validateRenderOpts(cmd *cobra.Command, args []string) error {
9999
if (renderOpts.etcdCAPath != "" || renderOpts.etcdCertificatePath != "" || renderOpts.etcdPrivateKeyPath != "") && (renderOpts.etcdCAPath == "" || renderOpts.etcdCertificatePath == "" || renderOpts.etcdPrivateKeyPath == "") {
100100
return errors.New("You must specify either all or none of --etcd-ca-path, --etcd-certificate-path, and --etcd-private-key-path")
101101
}
102+
if renderOpts.etcdCertificatePath != "" && renderOpts.selfHostedEtcd {
103+
return errors.New("Cannot specify --etcd-certificate-path with --experimental-self-hosted-etcd." +
104+
" Self-hosted etcd + TLS will auto-generate certs based on root CA cert.")
105+
}
102106
if renderOpts.assetDir == "" {
103107
return errors.New("Missing required flag: --asset-dir")
104108
}
@@ -208,7 +212,7 @@ func flagsToAssetConfig() (c *asset.Config, err error) {
208212
}
209213
}
210214

211-
if etcdUseTLS && etcdCACert == nil {
215+
if etcdUseTLS && etcdCACert == nil && !renderOpts.selfHostedEtcd {
212216
bootkube.UserOutput("NOTE: --etcd-servers=%s but --etcd-ca-path, --etcd-certificate-path, and --etcd-private-key-path were not set. Bootkube will create etcd certificates under '%s/tls'. You must configure etcd to use these certificates before invoking 'bootkube run'.\n", renderOpts.etcdServers, renderOpts.assetDir)
213217
}
214218

pkg/asset/tls.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ func newEtcdTLSAssets(etcdCACert, etcdClientCert *x509.Certificate, etcdClientKe
148148
return assets, nil
149149
}
150150

151+
// newSelfHostedEtcdTLSAssets automatically generates three suites of x509 certificates (CA, key, cert)
152+
// for self-hosted etcd related components. Two suites are used by etcd members' client and peer ports;
153+
// one is used via etcd client to talk to etcd by operator, apiserver.
154+
// Self-hosted etcd doesn't allow user to specify etcd certs.
151155
func newSelfHostedEtcdTLSAssets(etcdSvcIP, bootEtcdSvcIP string, caCert *x509.Certificate, caPrivKey *rsa.PrivateKey) (Assets, error) {
152156
// TODO: This method uses tlsutil.NewSignedCertificate() which will create certs for both client and server auth.
153157
// We can limit on finer granularity.

0 commit comments

Comments
 (0)