Skip to content

Commit 3af69c2

Browse files
authored
Merge pull request #5568 from twz123/remove-cidr-range
Completely remove old Windows-only CLI flags
2 parents 6adbe39 + 80ae50c commit 3af69c2

File tree

5 files changed

+8
-16
lines changed

5 files changed

+8
-16
lines changed

cmd/controller/controller_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ Examples:
6060
Note: Token can be passed either as a CLI argument or as a flag
6161
6262
Flags:
63-
--cidr-range string HACK: cidr range for the windows worker node (default "10.96.0.0/12")
6463
-c, --config string config file, use '-' to read the config from stdin (default `+defaultConfigPath+`)
6564
--cri-socket string container runtime socket to use, default to internal containerd. Format: [remote|docker]:[path-to-socket]
6665
--data-dir string Data Directory for k0s. DO NOT CHANGE for an existing setup, things will break! (default `+defaultDataDir+`)

cmd/install/controller_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ With the controller subcommand you can setup a single node cluster by running:
5656
5757
5858
Flags:
59-
--cidr-range string HACK: cidr range for the windows worker node (default "10.96.0.0/12")
6059
-c, --config string config file, use '-' to read the config from stdin (default `+defaultConfigPath+`)
6160
--cri-socket string container runtime socket to use, default to internal containerd. Format: [remote|docker]:[path-to-socket]
6261
--data-dir string Data Directory for k0s. DO NOT CHANGE for an existing setup, things will break! (default `+defaultDataDir+`)

cmd/install/worker.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ func installWorkerCmd(installFlags *installFlags) *cobra.Command {
3333
Use: "worker",
3434
Short: "Install k0s worker on a brand-new system. Must be run as root (or with sudo)",
3535
Example: `Worker subcommand allows you to pass in all available worker parameters.
36-
All default values of worker command will be passed to the service stub unless overridden.
37-
38-
Windows flags like "--api-server", "--cidr-range" and "--cluster-dns" will be ignored since install command doesn't yet support Windows services`,
36+
All default values of worker command will be passed to the service stub unless overridden.`,
3937
Args: cobra.NoArgs,
4038
RunE: func(cmd *cobra.Command, _ []string) error {
4139
if runtime.GOOS != "windows" && os.Geteuid() != 0 {

docs/experimental-windows.md

+1-9
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ During the first run, the calico install script is created as `C:\bootstrap.ps1`
1515
Install Mirantis Container Runtime on the Windows node(s), as it is required for the initial Calico set up).
1616

1717
```shell
18-
k0s worker --cri-socket=remote:npipe:////./pipe/containerd-containerd --cidr-range=<cidr_range> --cluster-dns=<clusterdns> --api-server=<k0s api> <token>
18+
k0s worker --cri-socket=remote:npipe:////./pipe/containerd-containerd <token>
1919
```
2020

2121
You must initiate the Cluster control with the correct config.
@@ -48,14 +48,6 @@ calicoctl ipam configure --strictaffinity=true
4848

4949
Disable the `Change Source/Dest. Check` option for the network interface attached to your EC2 instance. In AWS, the console option for the network interface is in the **Actions** menu.
5050

51-
### Hacks
52-
53-
k0s offers the following CLI arguments in lieu of a formal means for passing cluster settings from controller plane to worker:
54-
55-
- cidr-range
56-
- cluster-dns
57-
- api-server
58-
5951
## Useful commands
6052

6153
### Run pod with cmd.exe shell

pkg/config/cli.go

+6-2
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ type ControllerOptions struct {
7979

8080
// Shared worker cli flags
8181
type WorkerOptions struct {
82-
CIDRRange string
8382
CloudProvider bool
8483
LogLevels LogLevels
8584
CriSocket string
@@ -257,9 +256,14 @@ func GetWorkerFlags() *pflag.FlagSet {
257256
workerOpts.LogLevels = DefaultLogLevels()
258257
}
259258

259+
flagset.String("cidr-range", "", "")
260+
flagset.VisitAll(func(f *pflag.Flag) {
261+
f.Hidden = true
262+
f.Deprecated = "it has no effect and will be removed in a future release"
263+
})
264+
260265
flagset.String("kubelet-root-dir", "", "Kubelet root directory for k0s")
261266
flagset.StringVar(&workerOpts.WorkerProfile, "profile", "default", "worker profile to use on the node")
262-
flagset.StringVar(&workerOpts.CIDRRange, "cidr-range", "10.96.0.0/12", "HACK: cidr range for the windows worker node")
263267
flagset.BoolVar(&workerOpts.CloudProvider, "enable-cloud-provider", false, "Whether or not to enable cloud provider support in kubelet")
264268
flagset.StringVar(&workerOpts.TokenFile, "token-file", "", "Path to the file containing join-token.")
265269
flagset.VarP((*logLevelsFlag)(&workerOpts.LogLevels), "logging", "l", "Logging Levels for the different components")

0 commit comments

Comments
 (0)