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
0b13221f
Unverified
Commit
0b13221f
authored
Dec 10, 2018
by
Kubernetes Prow Robot
Committed by
GitHub
Dec 10, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #71885 from dims/create-etcd-with-0700-permissions
Create /var/lib/etcd with 0700
parents
d4548645
836f413c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
local.go
cmd/kubeadm/app/phases/etcd/local.go
+12
-0
local_test.go
cmd/kubeadm/app/phases/etcd/local_test.go
+1
-1
No files found.
cmd/kubeadm/app/phases/etcd/local.go
View file @
0b13221f
...
@@ -18,6 +18,7 @@ package etcd
...
@@ -18,6 +18,7 @@ package etcd
import
(
import
(
"fmt"
"fmt"
"os"
"path/filepath"
"path/filepath"
"strings"
"strings"
...
@@ -48,6 +49,12 @@ func CreateLocalEtcdStaticPodManifestFile(manifestDir string, cfg *kubeadmapi.In
...
@@ -48,6 +49,12 @@ func CreateLocalEtcdStaticPodManifestFile(manifestDir string, cfg *kubeadmapi.In
}
}
// gets etcd StaticPodSpec
// gets etcd StaticPodSpec
emptyInitialCluster
:=
[]
etcdutil
.
Member
{}
emptyInitialCluster
:=
[]
etcdutil
.
Member
{}
// creates target folder if not already exists
if
err
:=
os
.
MkdirAll
(
cfg
.
Etcd
.
Local
.
DataDir
,
0700
);
err
!=
nil
{
return
errors
.
Wrapf
(
err
,
"failed to create etcd directory %q"
,
cfg
.
Etcd
.
Local
.
DataDir
)
}
spec
:=
GetEtcdPodSpec
(
cfg
,
emptyInitialCluster
)
spec
:=
GetEtcdPodSpec
(
cfg
,
emptyInitialCluster
)
// writes etcd StaticPod to disk
// writes etcd StaticPod to disk
if
err
:=
staticpodutil
.
WriteStaticPodToDisk
(
kubeadmconstants
.
Etcd
,
manifestDir
,
spec
);
err
!=
nil
{
if
err
:=
staticpodutil
.
WriteStaticPodToDisk
(
kubeadmconstants
.
Etcd
,
manifestDir
,
spec
);
err
!=
nil
{
...
@@ -100,6 +107,11 @@ func CreateStackedEtcdStaticPodManifestFile(client clientset.Interface, manifest
...
@@ -100,6 +107,11 @@ func CreateStackedEtcdStaticPodManifestFile(client clientset.Interface, manifest
fmt
.
Println
(
"[etcd] Announced new etcd member joining to the existing etcd cluster"
)
fmt
.
Println
(
"[etcd] Announced new etcd member joining to the existing etcd cluster"
)
klog
.
V
(
1
)
.
Infof
(
"Updated etcd member list: %v"
,
initialCluster
)
klog
.
V
(
1
)
.
Infof
(
"Updated etcd member list: %v"
,
initialCluster
)
// creates target folder if not already exists
if
err
:=
os
.
MkdirAll
(
cfg
.
Etcd
.
Local
.
DataDir
,
0700
);
err
!=
nil
{
return
errors
.
Wrapf
(
err
,
"failed to create etcd directory %q"
,
cfg
.
Etcd
.
Local
.
DataDir
)
}
klog
.
V
(
1
)
.
Info
(
"Creating local etcd static pod manifest file"
)
klog
.
V
(
1
)
.
Info
(
"Creating local etcd static pod manifest file"
)
// gets etcd StaticPodSpec, actualized for the current InitConfiguration and the new list of etcd members
// gets etcd StaticPodSpec, actualized for the current InitConfiguration and the new list of etcd members
spec
:=
GetEtcdPodSpec
(
cfg
,
initialCluster
)
spec
:=
GetEtcdPodSpec
(
cfg
,
initialCluster
)
...
...
cmd/kubeadm/app/phases/etcd/local_test.go
View file @
0b13221f
...
@@ -67,7 +67,7 @@ func TestCreateLocalEtcdStaticPodManifestFile(t *testing.T) {
...
@@ -67,7 +67,7 @@ func TestCreateLocalEtcdStaticPodManifestFile(t *testing.T) {
KubernetesVersion
:
"v1.7.0"
,
KubernetesVersion
:
"v1.7.0"
,
Etcd
:
kubeadmapi
.
Etcd
{
Etcd
:
kubeadmapi
.
Etcd
{
Local
:
&
kubeadmapi
.
LocalEtcd
{
Local
:
&
kubeadmapi
.
LocalEtcd
{
DataDir
:
"/var/lib
/etcd"
,
DataDir
:
tmpdir
+
"
/etcd"
,
},
},
},
},
},
},
...
...
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