mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-16 06:32:32 +00:00
Add Subject Alt Names to self signed apiserver certs
A cert from GCE shows: - IP Address:23.236.49.122 - IP Address:10.0.0.1 - DNS:kubernetes, - DNS:kubernetes.default - DNS:kubernetes.default.svc - DNS:kubernetes.default.svc.cluster.local - DNS:e2e-test-zml-master A similarly configured self signed cert shows: - IP Address:23.236.49.122 - IP Address:10.0.0.1 - DNS:kubernetes - DNS:kubernetes.default - DNS:kubernetes.default.svc So we are missing the fqdn kubernetes.default.svc.cluster.local. The apiserver does not even know the fqdn! it's defined entirely by the kubelet! We also do not have the cluster name certificate. This may be --cluster-name= argument to the apiserver but will take a bit more research.
This commit is contained in:
@@ -449,7 +449,7 @@ func (s *APIServer) Run(_ []string) error {
|
||||
s.TLSCertFile = path.Join(s.CertDirectory, "apiserver.crt")
|
||||
s.TLSPrivateKeyFile = path.Join(s.CertDirectory, "apiserver.key")
|
||||
// TODO (cjcullen): Is PublicAddress the right address to sign a cert with?
|
||||
if err := util.GenerateSelfSignedCert(config.PublicAddress.String(), s.TLSCertFile, s.TLSPrivateKeyFile); err != nil {
|
||||
if err := util.GenerateSelfSignedCert(config.PublicAddress.String(), s.TLSCertFile, s.TLSPrivateKeyFile, config.ServiceReadWriteIP); err != nil {
|
||||
glog.Errorf("Unable to generate self signed cert: %v", err)
|
||||
} else {
|
||||
glog.Infof("Using self-signed cert (%s, %s)", s.TLSCertFile, s.TLSPrivateKeyFile)
|
||||
|
Reference in New Issue
Block a user