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
3cd807a6
Commit
3cd807a6
authored
Aug 07, 2019
by
Erik Wilson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add --flannel-conf flag
parent
73d31f5b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
1 deletion
+19
-1
config.go
pkg/agent/config/config.go
+6
-1
setup.go
pkg/agent/flannel/setup.go
+4
-0
agent.go
pkg/cli/cmds/agent.go
+7
-0
server.go
pkg/cli/cmds/server.go
+1
-0
types.go
pkg/daemons/config/types.go
+1
-0
No files found.
pkg/agent/config/config.go
View file @
3cd807a6
...
...
@@ -362,7 +362,12 @@ func get(envInfo *cmds.Agent) (*config.Node, error) {
nodeConfig
.
ServerAddress
=
serverURLParsed
.
Host
nodeConfig
.
Certificate
=
servingCert
if
!
nodeConfig
.
NoFlannel
{
nodeConfig
.
FlannelConf
=
filepath
.
Join
(
envInfo
.
DataDir
,
"etc/flannel/net-conf.json"
)
if
envInfo
.
FlannelConf
==
""
{
nodeConfig
.
FlannelConf
=
filepath
.
Join
(
envInfo
.
DataDir
,
"etc/flannel/net-conf.json"
)
}
else
{
nodeConfig
.
FlannelConf
=
envInfo
.
FlannelConf
nodeConfig
.
FlannelConfOverride
=
true
}
nodeConfig
.
AgentConfig
.
CNIBinDir
=
filepath
.
Dir
(
hostLocal
)
nodeConfig
.
AgentConfig
.
CNIConfDir
=
filepath
.
Join
(
envInfo
.
DataDir
,
"etc/cni/net.d"
)
}
...
...
pkg/agent/flannel/setup.go
View file @
3cd807a6
...
...
@@ -98,6 +98,10 @@ func createFlannelConf(config *config.Node) error {
if
config
.
FlannelConf
==
""
{
return
nil
}
if
config
.
FlannelConfOverride
{
logrus
.
Infof
(
"Using custom flannel conf defined at %s"
,
config
.
FlannelConf
)
return
nil
}
return
util
.
WriteFile
(
config
.
FlannelConf
,
strings
.
Replace
(
netJSON
,
"%CIDR%"
,
config
.
AgentConfig
.
ClusterCIDR
.
String
(),
-
1
))
}
pkg/cli/cmds/agent.go
View file @
3cd807a6
...
...
@@ -22,6 +22,7 @@ type Agent struct {
ContainerRuntimeEndpoint
string
NoFlannel
bool
FlannelIface
string
FlannelConf
string
Debug
bool
Rootless
bool
AgentShared
...
...
@@ -64,6 +65,11 @@ var (
Usage
:
"(agent) Override default flannel interface"
,
Destination
:
&
AgentConfig
.
FlannelIface
,
}
FlannelConfFlag
=
cli
.
StringFlag
{
Name
:
"flannel-conf"
,
Usage
:
"(agent) Override default flannel config file"
,
Destination
:
&
AgentConfig
.
FlannelConf
,
}
CRIEndpointFlag
=
cli
.
StringFlag
{
Name
:
"container-runtime-endpoint"
,
Usage
:
"(agent) Disable embedded containerd and use alternative CRI implementation"
,
...
...
@@ -151,6 +157,7 @@ func NewAgentCommand(action func(ctx *cli.Context) error) cli.Command {
DockerFlag
,
FlannelFlag
,
FlannelIfaceFlag
,
FlannelConfFlag
,
NodeNameFlag
,
NodeIPFlag
,
CRIEndpointFlag
,
...
...
pkg/cli/cmds/server.go
View file @
3cd807a6
...
...
@@ -194,6 +194,7 @@ func NewServerCommand(action func(*cli.Context) error) cli.Command {
DockerFlag
,
FlannelFlag
,
FlannelIfaceFlag
,
FlannelConfFlag
,
CRIEndpointFlag
,
PauseImageFlag
,
ResolvConfFlag
,
...
...
pkg/daemons/config/types.go
View file @
3cd807a6
...
...
@@ -18,6 +18,7 @@ type Node struct {
ContainerRuntimeEndpoint
string
NoFlannel
bool
FlannelConf
string
FlannelConfOverride
bool
FlannelIface
*
net
.
Interface
Containerd
Containerd
Images
string
...
...
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