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
cf793e7c
Commit
cf793e7c
authored
Feb 23, 2017
by
Devan Goodwin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kubeadm: Demote --self-hosted to master config file.
parent
17375fc5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
12 deletions
+13
-12
types.go
cmd/kubeadm/app/apis/kubeadm/types.go
+4
-0
types.go
cmd/kubeadm/app/apis/kubeadm/v1alpha1/types.go
+4
-0
init.go
cmd/kubeadm/app/cmd/init.go
+5
-12
No files found.
cmd/kubeadm/app/apis/kubeadm/types.go
View file @
cf793e7c
...
@@ -40,6 +40,10 @@ type MasterConfiguration struct {
...
@@ -40,6 +40,10 @@ type MasterConfiguration struct {
KubernetesVersion
string
KubernetesVersion
string
CloudProvider
string
CloudProvider
string
AuthorizationMode
string
AuthorizationMode
string
// SelfHosted enables an alpha deployment type where the apiserver, scheduler, and
// controller manager are managed by Kubernetes itself. This option is likely to
// become the default in the future.
SelfHosted
bool
}
}
type
API
struct
{
type
API
struct
{
...
...
cmd/kubeadm/app/apis/kubeadm/v1alpha1/types.go
View file @
cf793e7c
...
@@ -30,6 +30,10 @@ type MasterConfiguration struct {
...
@@ -30,6 +30,10 @@ type MasterConfiguration struct {
KubernetesVersion
string
`json:"kubernetesVersion"`
KubernetesVersion
string
`json:"kubernetesVersion"`
CloudProvider
string
`json:"cloudProvider"`
CloudProvider
string
`json:"cloudProvider"`
AuthorizationMode
string
`json:"authorizationMode"`
AuthorizationMode
string
`json:"authorizationMode"`
// SelfHosted enables an alpha deployment type where the apiserver, scheduler, and
// controller manager are managed by Kubernetes itself. This option is likely to
// become the default in the future.
SelfHosted
bool
`json:"selfHosted"`
}
}
type
API
struct
{
type
API
struct
{
...
...
cmd/kubeadm/app/cmd/init.go
View file @
cf793e7c
...
@@ -69,12 +69,11 @@ func NewCmdInit(out io.Writer) *cobra.Command {
...
@@ -69,12 +69,11 @@ func NewCmdInit(out io.Writer) *cobra.Command {
var
cfgPath
string
var
cfgPath
string
var
skipPreFlight
bool
var
skipPreFlight
bool
var
selfHosted
bool
cmd
:=
&
cobra
.
Command
{
cmd
:=
&
cobra
.
Command
{
Use
:
"init"
,
Use
:
"init"
,
Short
:
"Run this in order to set up the Kubernetes master"
,
Short
:
"Run this in order to set up the Kubernetes master"
,
Run
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
Run
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
i
,
err
:=
NewInit
(
cfgPath
,
&
cfg
,
skipPreFlight
,
selfHosted
)
i
,
err
:=
NewInit
(
cfgPath
,
&
cfg
,
skipPreFlight
)
kubeadmutil
.
CheckErr
(
err
)
kubeadmutil
.
CheckErr
(
err
)
kubeadmutil
.
CheckErr
(
i
.
Validate
())
kubeadmutil
.
CheckErr
(
i
.
Validate
())
kubeadmutil
.
CheckErr
(
i
.
Run
(
out
))
kubeadmutil
.
CheckErr
(
i
.
Run
(
out
))
...
@@ -122,15 +121,10 @@ func NewCmdInit(out io.Writer) *cobra.Command {
...
@@ -122,15 +121,10 @@ func NewCmdInit(out io.Writer) *cobra.Command {
"The discovery method kubeadm will use for connecting nodes to the master"
,
"The discovery method kubeadm will use for connecting nodes to the master"
,
)
)
cmd
.
PersistentFlags
()
.
BoolVar
(
&
selfHosted
,
"self-hosted"
,
selfHosted
,
"Enable self-hosted control plane"
,
)
return
cmd
return
cmd
}
}
func
NewInit
(
cfgPath
string
,
cfg
*
kubeadmapi
.
MasterConfiguration
,
skipPreFlight
bool
,
selfHosted
bool
)
(
*
Init
,
error
)
{
func
NewInit
(
cfgPath
string
,
cfg
*
kubeadmapi
.
MasterConfiguration
,
skipPreFlight
bool
)
(
*
Init
,
error
)
{
fmt
.
Println
(
"[kubeadm] WARNING: kubeadm is in alpha, please do not use it for production clusters."
)
fmt
.
Println
(
"[kubeadm] WARNING: kubeadm is in alpha, please do not use it for production clusters."
)
...
@@ -169,12 +163,11 @@ func NewInit(cfgPath string, cfg *kubeadmapi.MasterConfiguration, skipPreFlight
...
@@ -169,12 +163,11 @@ func NewInit(cfgPath string, cfg *kubeadmapi.MasterConfiguration, skipPreFlight
// Try to start the kubelet service in case it's inactive
// Try to start the kubelet service in case it's inactive
preflight
.
TryStartKubelet
()
preflight
.
TryStartKubelet
()
return
&
Init
{
cfg
:
cfg
,
selfHosted
:
selfHosted
},
nil
return
&
Init
{
cfg
:
cfg
},
nil
}
}
type
Init
struct
{
type
Init
struct
{
cfg
*
kubeadmapi
.
MasterConfiguration
cfg
*
kubeadmapi
.
MasterConfiguration
selfHosted
bool
}
}
// Validate validates configuration passed to "kubeadm init"
// Validate validates configuration passed to "kubeadm init"
...
@@ -225,7 +218,7 @@ func (i *Init) Run(out io.Writer) error {
...
@@ -225,7 +218,7 @@ func (i *Init) Run(out io.Writer) error {
}
}
// Is deployment type self-hosted?
// Is deployment type self-hosted?
if
i
.
s
elfHosted
{
if
i
.
cfg
.
S
elfHosted
{
// Temporary control plane is up, now we create our self hosted control
// Temporary control plane is up, now we create our self hosted control
// plane components and remove the static manifests:
// plane components and remove the static manifests:
fmt
.
Println
(
"[init] Creating self-hosted control plane..."
)
fmt
.
Println
(
"[init] Creating self-hosted control plane..."
)
...
...
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