config

package
v0.13.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 15, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Copyright 2021 k0s authors

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

View Source
var (
	CfgFile       string
	DataDir       string
	Debug         bool
	DebugListenOn string
	K0sVars       constant.CfgVars
)

Functions

func DefaultLogLevels

func DefaultLogLevels() map[string]string

func GetControllerFlags

func GetControllerFlags() *pflag.FlagSet

func GetKubeCtlFlagSet

func GetKubeCtlFlagSet() *pflag.FlagSet

XX: not a pretty hack, but we need the data-dir flag for the kubectl subcommand XX: when other global flags cannot be used (specifically -d and -c)

func GetPersistentFlagSet

func GetPersistentFlagSet() *pflag.FlagSet

func GetWorkerFlags

func GetWorkerFlags() *pflag.FlagSet

func GetYamlFromFile

func GetYamlFromFile(cfgPath string, k0sVars constant.CfgVars) (clusterConfig *v1beta1.ClusterConfig, err error)

func ValidateYaml

func ValidateYaml(cfgPath string, k0sVars constant.CfgVars) (clusterConfig *v1beta1.ClusterConfig, err error)

Types

type CLIOptions

type CLIOptions struct {
	WorkerOptions
	ControllerOptions
	CfgFile          string
	ClusterConfig    *v1beta1.ClusterConfig
	Debug            bool
	DebugListenOn    string
	DefaultLogLevels map[string]string
	K0sVars          constant.CfgVars
	KubeClient       k8s.Interface
	Logging          map[string]string // merged outcome of default log levels and cmdLoglevels
}

This struct holds all the CLI options & settings required by the different k0s sub-commands

func GetCmdOpts

func GetCmdOpts() CLIOptions

type ControllerOptions

type ControllerOptions struct {
	EnableWorker bool
	SingleNode   bool
}

Shared controller cli flags

type WorkerOptions

type WorkerOptions struct {
	APIServer        string
	CIDRRange        string
	CloudProvider    bool
	ClusterDNS       string
	CmdLogLevels     map[string]string
	CriSocket        string
	KubeletExtraArgs string
	Labels           []string
	TokenFile        string
	TokenArg         string
	WorkerProfile    string
}

Shared worker cli flags

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL