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
2cb6f523
Commit
2cb6f523
authored
Aug 24, 2019
by
Darren Shepherd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable storing bootstrap information by default
parent
a005219c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
29 deletions
+30
-29
server.go
pkg/cli/cmds/server.go
+7
-0
server.go
pkg/cli/server/server.go
+1
-0
types.go
pkg/daemons/config/types.go
+21
-22
bootstrap.go
pkg/daemons/control/bootstrap.go
+1
-7
No files found.
pkg/cli/cmds/server.go
View file @
2cb6f523
...
@@ -22,6 +22,7 @@ type Server struct {
...
@@ -22,6 +22,7 @@ type Server struct {
ExtraSchedulerArgs
cli
.
StringSlice
ExtraSchedulerArgs
cli
.
StringSlice
ExtraControllerArgs
cli
.
StringSlice
ExtraControllerArgs
cli
.
StringSlice
Rootless
bool
Rootless
bool
StoreBootstrap
bool
StorageEndpoint
string
StorageEndpoint
string
StorageCAFile
string
StorageCAFile
string
StorageCertFile
string
StorageCertFile
string
...
@@ -142,6 +143,12 @@ func NewServerCommand(action func(*cli.Context) error) cli.Command {
...
@@ -142,6 +143,12 @@ func NewServerCommand(action func(*cli.Context) error) cli.Command {
Usage
:
"(experimental) Run rootless"
,
Usage
:
"(experimental) Run rootless"
,
Destination
:
&
ServerConfig
.
Rootless
,
Destination
:
&
ServerConfig
.
Rootless
,
},
},
cli
.
BoolFlag
{
Name
:
"bootstrap-save"
,
Usage
:
"(experimental) Save bootstrap information in the storage endpoint"
,
Hidden
:
true
,
Destination
:
&
ServerConfig
.
StoreBootstrap
,
},
cli
.
StringFlag
{
cli
.
StringFlag
{
Name
:
"storage-endpoint"
,
Name
:
"storage-endpoint"
,
Usage
:
"Specify etcd, Mysql, Postgres, or Sqlite (default) data source name"
,
Usage
:
"Specify etcd, Mysql, Postgres, or Sqlite (default) data source name"
,
...
...
pkg/cli/server/server.go
View file @
2cb6f523
...
@@ -87,6 +87,7 @@ func run(app *cli.Context, cfg *cmds.Server) error {
...
@@ -87,6 +87,7 @@ func run(app *cli.Context, cfg *cmds.Server) error {
serverConfig
.
ControlConfig
.
Storage
.
KeyFile
=
cfg
.
StorageKeyFile
serverConfig
.
ControlConfig
.
Storage
.
KeyFile
=
cfg
.
StorageKeyFile
serverConfig
.
ControlConfig
.
AdvertiseIP
=
cfg
.
AdvertiseIP
serverConfig
.
ControlConfig
.
AdvertiseIP
=
cfg
.
AdvertiseIP
serverConfig
.
ControlConfig
.
AdvertisePort
=
cfg
.
AdvertisePort
serverConfig
.
ControlConfig
.
AdvertisePort
=
cfg
.
AdvertisePort
serverConfig
.
ControlConfig
.
BootstrapReadOnly
=
!
cfg
.
StoreBootstrap
if
cmds
.
AgentConfig
.
FlannelIface
!=
""
&&
cmds
.
AgentConfig
.
NodeIP
==
""
{
if
cmds
.
AgentConfig
.
FlannelIface
!=
""
&&
cmds
.
AgentConfig
.
NodeIP
==
""
{
cmds
.
AgentConfig
.
NodeIP
=
netutil
.
GetIPFromInterface
(
cmds
.
AgentConfig
.
FlannelIface
)
cmds
.
AgentConfig
.
NodeIP
=
netutil
.
GetIPFromInterface
(
cmds
.
AgentConfig
.
FlannelIface
)
...
...
pkg/daemons/config/types.go
View file @
2cb6f523
...
@@ -68,28 +68,27 @@ type Agent struct {
...
@@ -68,28 +68,27 @@ type Agent struct {
}
}
type
Control
struct
{
type
Control
struct
{
AdvertisePort
int
AdvertisePort
int
AdvertiseIP
string
AdvertiseIP
string
ListenPort
int
ListenPort
int
HTTPSPort
int
HTTPSPort
int
ClusterSecret
string
ClusterSecret
string
ClusterIPRange
*
net
.
IPNet
ClusterIPRange
*
net
.
IPNet
ServiceIPRange
*
net
.
IPNet
ServiceIPRange
*
net
.
IPNet
ClusterDNS
net
.
IP
ClusterDNS
net
.
IP
ClusterDomain
string
ClusterDomain
string
NoCoreDNS
bool
NoCoreDNS
bool
KubeConfigOutput
string
KubeConfigOutput
string
KubeConfigMode
string
KubeConfigMode
string
DataDir
string
DataDir
string
Skips
[]
string
Skips
[]
string
BootstrapReadOnly
bool
BootstrapReadOnly
bool
BootstrapOverwriteLocal
bool
Storage
endpoint
.
Config
Storage
endpoint
.
Config
NoScheduler
bool
NoScheduler
bool
ExtraAPIArgs
[]
string
ExtraAPIArgs
[]
string
ExtraControllerArgs
[]
string
ExtraControllerArgs
[]
string
ExtraSchedulerAPIArgs
[]
string
ExtraSchedulerAPIArgs
[]
string
NoLeaderElect
bool
NoLeaderElect
bool
Runtime
*
ControlRuntime
`json:"-"`
Runtime
*
ControlRuntime
`json:"-"`
}
}
...
...
pkg/daemons/control/bootstrap.go
View file @
2cb6f523
...
@@ -18,7 +18,7 @@ const (
...
@@ -18,7 +18,7 @@ const (
)
)
// fetchBootstrapData copies the bootstrap data (certs, keys, passwords)
// fetchBootstrapData copies the bootstrap data (certs, keys, passwords)
// from etcd to in
i
dividual files specified by cfg.Runtime.
// from etcd to individual files specified by cfg.Runtime.
func
fetchBootstrapData
(
ctx
context
.
Context
,
cfg
*
config
.
Control
,
c
client
.
Client
)
error
{
func
fetchBootstrapData
(
ctx
context
.
Context
,
cfg
*
config
.
Control
,
c
client
.
Client
)
error
{
logrus
.
Info
(
"Fetching bootstrap data from etcd"
)
logrus
.
Info
(
"Fetching bootstrap data from etcd"
)
gr
,
err
:=
c
.
Get
(
ctx
,
k3sRuntimeEtcdPath
)
gr
,
err
:=
c
.
Get
(
ctx
,
k3sRuntimeEtcdPath
)
...
@@ -45,12 +45,6 @@ func fetchBootstrapData(ctx context.Context, cfg *config.Control, c client.Clien
...
@@ -45,12 +45,6 @@ func fetchBootstrapData(ctx context.Context, cfg *config.Control, c client.Clien
continue
continue
}
}
if
!
cfg
.
BootstrapOverwriteLocal
{
if
_
,
err
:=
os
.
Stat
(
path
);
err
==
nil
{
continue
}
}
if
err
:=
os
.
MkdirAll
(
filepath
.
Dir
(
path
),
0700
);
err
!=
nil
{
if
err
:=
os
.
MkdirAll
(
filepath
.
Dir
(
path
),
0700
);
err
!=
nil
{
return
errors
.
Wrapf
(
err
,
"failed to mkdir %s"
,
filepath
.
Dir
(
path
))
return
errors
.
Wrapf
(
err
,
"failed to mkdir %s"
,
filepath
.
Dir
(
path
))
}
}
...
...
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