Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
7d5ea895
Unverified
Commit
7d5ea895
authored
May 14, 2018
by
Jason DeTiberus
Committed by
Chuck Ha
May 23, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kubeadm - do not generate etcd ca/certs for external etcd
Only generate the etcd CA and certificates if not configured for external etcd.
parent
7195f798
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
3 deletions
+27
-3
certs.go
cmd/kubeadm/app/phases/certs/certs.go
+10
-3
certs_test.go
cmd/kubeadm/app/phases/certs/certs_test.go
+17
-0
No files found.
cmd/kubeadm/app/phases/certs/certs.go
View file @
7d5ea895
...
...
@@ -37,14 +37,21 @@ func CreatePKIAssets(cfg *kubeadmapi.MasterConfiguration) error {
CreateCACertAndKeyFiles
,
CreateAPIServerCertAndKeyFiles
,
CreateAPIServerKubeletClientCertAndKeyFiles
,
CreateServiceAccountKeyAndPublicKeyFiles
,
CreateFrontProxyCACertAndKeyFiles
,
CreateFrontProxyClientCertAndKeyFiles
,
}
etcdCertActions
:=
[]
func
(
cfg
*
kubeadmapi
.
MasterConfiguration
)
error
{
CreateEtcdCACertAndKeyFiles
,
CreateEtcdServerCertAndKeyFiles
,
CreateEtcdPeerCertAndKeyFiles
,
CreateEtcdHealthcheckClientCertAndKeyFiles
,
CreateAPIServerEtcdClientCertAndKeyFiles
,
CreateServiceAccountKeyAndPublicKeyFiles
,
CreateFrontProxyCACertAndKeyFiles
,
CreateFrontProxyClientCertAndKeyFiles
,
}
// Currently this is the only way we have to identify static pod etcd vs external etcd
if
len
(
cfg
.
Etcd
.
Endpoints
)
==
0
{
certActions
=
append
(
certActions
,
etcdCertActions
...
)
}
for
_
,
action
:=
range
certActions
{
...
...
cmd/kubeadm/app/phases/certs/certs_test.go
View file @
7d5ea895
...
...
@@ -601,6 +601,7 @@ func TestCreateCertificateFilesMethods(t *testing.T) {
setupFunc
func
(
cfg
*
kubeadmapi
.
MasterConfiguration
)
error
createFunc
func
(
cfg
*
kubeadmapi
.
MasterConfiguration
)
error
expectedFiles
[]
string
externalEtcd
bool
}{
{
createFunc
:
CreatePKIAssets
,
...
...
@@ -619,6 +620,18 @@ func TestCreateCertificateFilesMethods(t *testing.T) {
},
},
{
createFunc
:
CreatePKIAssets
,
externalEtcd
:
true
,
expectedFiles
:
[]
string
{
kubeadmconstants
.
CACertName
,
kubeadmconstants
.
CAKeyName
,
kubeadmconstants
.
APIServerCertName
,
kubeadmconstants
.
APIServerKeyName
,
kubeadmconstants
.
APIServerKubeletClientCertName
,
kubeadmconstants
.
APIServerKubeletClientKeyName
,
kubeadmconstants
.
ServiceAccountPrivateKeyName
,
kubeadmconstants
.
ServiceAccountPublicKeyName
,
kubeadmconstants
.
FrontProxyCACertName
,
kubeadmconstants
.
FrontProxyCAKeyName
,
kubeadmconstants
.
FrontProxyClientCertName
,
kubeadmconstants
.
FrontProxyClientKeyName
,
},
},
{
createFunc
:
CreateCACertAndKeyFiles
,
expectedFiles
:
[]
string
{
kubeadmconstants
.
CACertName
,
kubeadmconstants
.
CAKeyName
},
},
...
...
@@ -683,6 +696,10 @@ func TestCreateCertificateFilesMethods(t *testing.T) {
CertificatesDir
:
tmpdir
,
}
if
test
.
externalEtcd
{
cfg
.
Etcd
.
Endpoints
=
[]
string
{
"192.168.1.1:2379"
}
}
// executes setup func (if necessary)
if
test
.
setupFunc
!=
nil
{
if
err
:=
test
.
setupFunc
(
cfg
);
err
!=
nil
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment