Merge branch 'master' into add_desc_node_to_minikube_logs

pull/7105/head
Prasad Katti 2020-03-20 22:39:18 -07:00
commit a880bb706b
111 changed files with 928 additions and 809 deletions

View File

@ -23,10 +23,9 @@ import (
// nodeCmd represents the set of node subcommands
var nodeCmd = &cobra.Command{
Use: "node",
Short: "Node operations",
Long: "Operations on nodes",
Hidden: true, // This won't be fully functional and thus should not be documented yet
Use: "node",
Short: "Node operations",
Long: "Operations on nodes",
Run: func(cmd *cobra.Command, args []string) {
exit.UsageT("Usage: minikube node [add|start|stop|delete]")
},

View File

@ -17,12 +17,11 @@ limitations under the License.
package cmd
import (
"fmt"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"github.com/spf13/viper"
"k8s.io/minikube/pkg/minikube/config"
"k8s.io/minikube/pkg/minikube/driver"
"k8s.io/minikube/pkg/minikube/exit"
"k8s.io/minikube/pkg/minikube/node"
"k8s.io/minikube/pkg/minikube/out"
@ -43,19 +42,25 @@ var nodeAddCmd = &cobra.Command{
exit.WithError("Error getting config", err)
}
//name := profile + strconv.Itoa(len(mc.Nodes)+1)
name := fmt.Sprintf("m%d", len(cc.Nodes)+1)
if driver.BareMetal(cc.Driver) {
out.ErrT(out.FailureType, "none driver does not support multi-node clusters")
}
name := node.Name(len(cc.Nodes) + 1)
out.T(out.Happy, "Adding node {{.name}} to cluster {{.cluster}}", out.V{"name": name, "cluster": profile})
n, err := node.Add(cc, name, cp, worker, "", profile)
if err != nil {
exit.WithError("Error adding node to cluster", err)
// TODO: Deal with parameters better. Ideally we should be able to acceot any node-specific minikube start params here.
n := config.Node{
Name: name,
Worker: worker,
ControlPlane: cp,
KubernetesVersion: cc.KubernetesConfig.KubernetesVersion,
}
_, err = node.Start(*cc, *n, false, nil)
err = node.Add(cc, n)
if err != nil {
exit.WithError("Error starting node", err)
exit.WithError("Error adding node to cluster", err)
}
out.T(out.Ready, "Successfully added {{.name}} to {{.cluster}}!", out.V{"name": name, "cluster": profile})

View File

@ -46,7 +46,7 @@ var nodeDeleteCmd = &cobra.Command{
err = node.Delete(*cc, name)
if err != nil {
out.FatalT("Failed to delete node {{.name}}", out.V{"name": name})
exit.WithError("deleting node", err)
}
out.T(out.Deleted, "Node {{.name}} was successfully deleted.", out.V{"name": name})

View File

@ -61,10 +61,7 @@ var nodeStartCmd = &cobra.Command{
}
// Start it up baby
_, err = node.Start(*cc, *n, false, nil)
if err != nil {
out.FatalT("Failed to start node {{.name}}", out.V{"name": name})
}
node.Start(*cc, *n, nil, false)
},
}

View File

@ -27,6 +27,7 @@ import (
"k8s.io/minikube/pkg/minikube/driver"
"k8s.io/minikube/pkg/minikube/exit"
"k8s.io/minikube/pkg/minikube/machine"
"k8s.io/minikube/pkg/minikube/node"
"k8s.io/minikube/pkg/minikube/out"
)
@ -49,12 +50,20 @@ var sshCmd = &cobra.Command{
if err != nil {
exit.WithError("Error getting config", err)
}
// TODO: allow choice of node to ssh into
cp, err := config.PrimaryControlPlane(cc)
if err != nil {
exit.WithError("Error getting primary control plane", err)
var n *config.Node
if nodeName == "" {
cp, err := config.PrimaryControlPlane(cc)
if err != nil {
exit.WithError("Getting primary control plane", err)
}
n = &cp
} else {
n, _, err = node.Retrieve(cc, nodeName)
if err != nil {
exit.WithCodeT(exit.Unavailable, "Node {{.nodeName}} does not exist.", out.V{"nodeName": nodeName})
}
}
host, err := machine.LoadHost(api, driver.MachineName(*cc, cp))
host, err := machine.LoadHost(api, driver.MachineName(*cc, *n))
if err != nil {
exit.WithError("Error getting host", err)
}
@ -67,7 +76,7 @@ var sshCmd = &cobra.Command{
ssh.SetDefaultClient(ssh.External)
}
err = machine.CreateSSHShell(api, *cc, cp, args)
err = machine.CreateSSHShell(api, *cc, *n, args)
if err != nil {
// This is typically due to a non-zero exit code, so no need for flourish.
out.ErrLn("ssh: %v", err)
@ -78,5 +87,6 @@ var sshCmd = &cobra.Command{
}
func init() {
sshCmd.Flags().BoolVar(&nativeSSHClient, nativeSSH, true, "Use native Golang SSH client (default true). Set to 'false' to use the command line 'ssh' command when accessing the docker machine. Useful for the machine drivers when they will not start with 'Waiting for SSH'.")
sshCmd.Flags().Bool(nativeSSH, true, "Use native Golang SSH client (default true). Set to 'false' to use the command line 'ssh' command when accessing the docker machine. Useful for the machine drivers when they will not start with 'Waiting for SSH'.")
sshCmd.Flags().StringVarP(&nodeName, "node", "n", "", "The node to ssh into. Defaults to the primary control plane.")
}

View File

@ -120,6 +120,7 @@ const (
autoUpdate = "auto-update-drivers"
hostOnlyNicType = "host-only-nic-type"
natNicType = "nat-nic-type"
nodes = "nodes"
)
var (
@ -162,7 +163,7 @@ func initMinikubeFlags() {
startCmd.Flags().String(containerRuntime, "docker", "The container runtime to be used (docker, crio, containerd).")
startCmd.Flags().Bool(createMount, false, "This will start the mount daemon and automatically mount files into minikube.")
startCmd.Flags().String(mountString, constants.DefaultMountDir+":/minikube-host", "The argument to pass the minikube mount command on start.")
startCmd.Flags().StringArrayVar(&node.AddonList, "addons", nil, "Enable addons. see `minikube addons list` for a list of valid addon names.")
startCmd.Flags().StringArrayVar(&config.AddonList, "addons", nil, "Enable addons. see `minikube addons list` for a list of valid addon names.")
startCmd.Flags().String(criSocket, "", "The cri socket path to be used.")
startCmd.Flags().String(networkPlugin, "", "The name of the network plugin.")
startCmd.Flags().Bool(enableDefaultCNI, false, "Enable the default CNI plugin (/etc/cni/net.d/k8s.conf). Used in conjunction with \"--network-plugin=cni\".")
@ -171,12 +172,13 @@ func initMinikubeFlags() {
startCmd.Flags().Bool(nativeSSH, true, "Use native Golang SSH client (default true). Set to 'false' to use the command line 'ssh' command when accessing the docker machine. Useful for the machine drivers when they will not start with 'Waiting for SSH'.")
startCmd.Flags().Bool(autoUpdate, true, "If set, automatically updates drivers to the latest version. Defaults to true.")
startCmd.Flags().Bool(installAddons, true, "If set, install addons. Defaults to true.")
startCmd.Flags().IntP(nodes, "n", 1, "The number of nodes to spin up. Defaults to 1.")
}
// initKubernetesFlags inits the commandline flags for kubernetes related options
func initKubernetesFlags() {
startCmd.Flags().String(kubernetesVersion, "", "The kubernetes version that the minikube VM will use (ex: v1.2.3)")
startCmd.Flags().Var(&node.ExtraOptions, "extra-config",
startCmd.Flags().Var(&config.ExtraOptions, "extra-config",
`A set of key=value pairs that describe configuration that may be passed to different components.
The key should be '.' separated, and the first part before the dot is the component to apply the configuration to.
Valid components are: kubelet, kubeadm, apiserver, controller-manager, etcd, proxy, scheduler
@ -229,8 +231,8 @@ func initNetworkingFlags() {
startCmd.Flags().String(imageRepository, "", "Alternative image repository to pull docker images from. This can be used when you have limited access to gcr.io. Set it to \"auto\" to let minikube decide one for you. For Chinese mainland users, you may use local gcr.io mirrors such as registry.cn-hangzhou.aliyuncs.com/google_containers")
startCmd.Flags().String(imageMirrorCountry, "", "Country code of the image mirror to be used. Leave empty to use the global one. For Chinese mainland users, set it to cn.")
startCmd.Flags().String(serviceCIDR, constants.DefaultServiceCIDR, "The CIDR to be used for service cluster IPs.")
startCmd.Flags().StringArrayVar(&node.DockerEnv, "docker-env", nil, "Environment variables to pass to the Docker daemon. (format: key=value)")
startCmd.Flags().StringArrayVar(&node.DockerOpt, "docker-opt", nil, "Specify arbitrary flags to pass to the Docker daemon. (format: key=value)")
startCmd.Flags().StringArrayVar(&config.DockerEnv, "docker-env", nil, "Environment variables to pass to the Docker daemon. (format: key=value)")
startCmd.Flags().StringArrayVar(&config.DockerOpt, "docker-opt", nil, "Specify arbitrary flags to pass to the Docker daemon. (format: key=value)")
}
// startCmd represents the start command
@ -313,7 +315,7 @@ func runStart(cmd *cobra.Command, args []string) {
}
k8sVersion := getKubernetesVersion(existing)
mc, n, err := generateCfgFromFlags(cmd, k8sVersion, driverName)
cc, n, err := generateCfgFromFlags(cmd, k8sVersion, driverName)
if err != nil {
exit.WithError("Failed to generate config", err)
}
@ -324,12 +326,12 @@ func runStart(cmd *cobra.Command, args []string) {
return
}
if !driver.BareMetal(driverName) && !driver.IsKIC(driverName) {
if driver.IsVM(driverName) {
url, err := download.ISO(viper.GetStringSlice(isoURL), cmd.Flags().Changed(isoURL))
if err != nil {
exit.WithError("Failed to cache ISO", err)
}
mc.MinikubeISO = url
cc.MinikubeISO = url
}
if viper.GetBool(nativeSSH) {
@ -338,12 +340,41 @@ func runStart(cmd *cobra.Command, args []string) {
ssh.SetDefaultClient(ssh.External)
}
kubeconfig, err := startNode(existing, mc, n)
if err != nil {
exit.WithError("Starting node", err)
var existingAddons map[string]bool
if viper.GetBool(installAddons) {
existingAddons = map[string]bool{}
if existing != nil && existing.Addons != nil {
existingAddons = existing.Addons
}
}
if err := showKubectlInfo(kubeconfig, k8sVersion, mc.Name); err != nil {
kubeconfig := node.Start(cc, n, existingAddons, true)
numNodes := viper.GetInt(nodes)
if numNodes == 1 && existing != nil {
numNodes = len(existing.Nodes)
}
if numNodes > 1 {
if driver.BareMetal(driverName) {
exit.WithCodeT(exit.Config, "The none driver is not compatible with multi-node clusters.")
} else {
for i := 1; i < numNodes; i++ {
nodeName := node.Name(i + 1)
n := config.Node{
Name: nodeName,
Worker: true,
ControlPlane: false,
KubernetesVersion: cc.KubernetesConfig.KubernetesVersion,
}
err := node.Add(&cc, n)
if err != nil {
exit.WithError("adding node", err)
}
}
}
}
if err := showKubectlInfo(kubeconfig, k8sVersion, cc.Name); err != nil {
glog.Errorf("kubectl info: %v", err)
}
}
@ -383,17 +414,6 @@ func displayEnviron(env []string) {
}
}
func startNode(existing *config.ClusterConfig, mc config.ClusterConfig, n config.Node) (*kubeconfig.Settings, error) {
var existingAddons map[string]bool
if viper.GetBool(installAddons) {
existingAddons = map[string]bool{}
if existing != nil && existing.Addons != nil {
existingAddons = existing.Addons
}
}
return node.Start(mc, n, true, existingAddons)
}
func showKubectlInfo(kcs *kubeconfig.Settings, k8sVersion string, machineName string) error {
if kcs.KeepContext {
out.T(out.Kubectl, "To connect to this cluster, use: kubectl --context={{.name}}", out.V{"name": kcs.ClusterName})
@ -802,7 +822,7 @@ func validateFlags(cmd *cobra.Command, drvName string) {
}
// check that kubeadm extra args contain only whitelisted parameters
for param := range node.ExtraOptions.AsMap().Get(bsutil.Kubeadm) {
for param := range config.ExtraOptions.AsMap().Get(bsutil.Kubeadm) {
if !config.ContainsParam(bsutil.KubeadmExtraArgsWhitelist[bsutil.KubeadmCmdParam], param) &&
!config.ContainsParam(bsutil.KubeadmExtraArgsWhitelist[bsutil.KubeadmConfigParam], param) {
exit.UsageT("Sorry, the kubeadm.{{.parameter_name}} parameter is currently not supported by --extra-config", out.V{"parameter_name": param})
@ -930,8 +950,8 @@ func createNode(cmd *cobra.Command, k8sVersion, kubeNodeName, drvName, repositor
HyperkitVSockPorts: viper.GetStringSlice(vsockPorts),
NFSShare: viper.GetStringSlice(nfsShare),
NFSSharesRoot: viper.GetString(nfsSharesRoot),
DockerEnv: node.DockerEnv,
DockerOpt: node.DockerOpt,
DockerEnv: config.DockerEnv,
DockerOpt: config.DockerOpt,
InsecureRegistry: insecureRegistry,
RegistryMirror: registryMirror,
HostOnlyCIDR: viper.GetString(hostOnlyCIDR),
@ -962,7 +982,7 @@ func createNode(cmd *cobra.Command, k8sVersion, kubeNodeName, drvName, repositor
NetworkPlugin: selectedNetworkPlugin,
ServiceCIDR: viper.GetString(serviceCIDR),
ImageRepository: repository,
ExtraOptions: node.ExtraOptions,
ExtraOptions: config.ExtraOptions,
ShouldLoadCachedImages: viper.GetBool(cacheImages),
EnableDefaultCNI: selectedEnableDefaultCNI,
},
@ -984,7 +1004,7 @@ func setDockerProxy() {
continue
}
}
node.DockerEnv = append(node.DockerEnv, fmt.Sprintf("%s=%s", k, v))
config.DockerEnv = append(config.DockerEnv, fmt.Sprintf("%s=%s", k, v))
}
}
}
@ -996,7 +1016,7 @@ func autoSetDriverOptions(cmd *cobra.Command, drvName string) (err error) {
if !cmd.Flags().Changed("extra-config") && len(hints.ExtraOptions) > 0 {
for _, eo := range hints.ExtraOptions {
glog.Infof("auto setting extra-config to %q.", eo)
err = node.ExtraOptions.Set(eo)
err = config.ExtraOptions.Set(eo)
if err != nil {
err = errors.Wrapf(err, "setting extra option %s", eo)
}

View File

@ -56,24 +56,35 @@ const (
// Nonexistent means nonexistent
Nonexistent = "Nonexistent" // ~state.None
// Irrelevant is used for statuses that aren't meaningful for worker nodes
Irrelevant = "Irrelevant"
)
// Status holds string representations of component states
type Status struct {
Name string
Host string
Kubelet string
APIServer string
Kubeconfig string
Worker bool
}
const (
minikubeNotRunningStatusFlag = 1 << 0
clusterNotRunningStatusFlag = 1 << 1
k8sNotRunningStatusFlag = 1 << 2
defaultStatusFormat = `host: {{.Host}}
defaultStatusFormat = `{{.Name}}
host: {{.Host}}
kubelet: {{.Kubelet}}
apiserver: {{.APIServer}}
kubeconfig: {{.Kubeconfig}}
`
workerStatusFormat = `{{.Name}}
host: {{.Host}}
kubelet: {{.Kubelet}}
`
)
@ -104,31 +115,29 @@ var statusCmd = &cobra.Command{
exit.WithError("getting config", err)
}
cp, err := config.PrimaryControlPlane(cc)
if err != nil {
exit.WithError("getting primary control plane", err)
}
machineName := driver.MachineName(*cc, cp)
st, err := status(api, machineName)
if err != nil {
glog.Errorf("status error: %v", err)
}
if st.Host == Nonexistent {
glog.Errorf("The %q cluster does not exist!", machineName)
}
switch strings.ToLower(output) {
case "text":
if err := statusText(st, os.Stdout); err != nil {
exit.WithError("status text failure", err)
var st *Status
for _, n := range cc.Nodes {
machineName := driver.MachineName(*cc, n)
st, err = status(api, machineName, n.ControlPlane)
if err != nil {
glog.Errorf("status error: %v", err)
}
case "json":
if err := statusJSON(st, os.Stdout); err != nil {
exit.WithError("status json failure", err)
if st.Host == Nonexistent {
glog.Errorf("The %q host does not exist!", machineName)
}
switch strings.ToLower(output) {
case "text":
if err := statusText(st, os.Stdout); err != nil {
exit.WithError("status text failure", err)
}
case "json":
if err := statusJSON(st, os.Stdout); err != nil {
exit.WithError("status json failure", err)
}
default:
exit.WithCodeT(exit.BadUsage, fmt.Sprintf("invalid output format: %s. Valid values: 'text', 'json'", output))
}
default:
exit.WithCodeT(exit.BadUsage, fmt.Sprintf("invalid output format: %s. Valid values: 'text', 'json'", output))
}
os.Exit(exitCode(st))
@ -140,21 +149,26 @@ func exitCode(st *Status) int {
if st.Host != state.Running.String() {
c |= minikubeNotRunningStatusFlag
}
if st.APIServer != state.Running.String() || st.Kubelet != state.Running.String() {
if (st.APIServer != state.Running.String() && st.APIServer != Irrelevant) || st.Kubelet != state.Running.String() {
c |= clusterNotRunningStatusFlag
}
if st.Kubeconfig != Configured {
if st.Kubeconfig != Configured && st.Kubeconfig != Irrelevant {
c |= k8sNotRunningStatusFlag
}
return c
}
func status(api libmachine.API, name string) (*Status, error) {
func status(api libmachine.API, name string, controlPlane bool) (*Status, error) {
profile, node := driver.ClusterNameFromMachine(name)
st := &Status{
Name: node,
Host: Nonexistent,
APIServer: Nonexistent,
Kubelet: Nonexistent,
Kubeconfig: Nonexistent,
Worker: !controlPlane,
}
hs, err := machine.Status(api, name)
@ -193,10 +207,17 @@ func status(api libmachine.API, name string) (*Status, error) {
}
st.Kubeconfig = Misconfigured
ok, err := kubeconfig.IsClusterInConfig(ip, name)
glog.Infof("%s is in kubeconfig at ip %s: %v (err=%v)", name, ip, ok, err)
if ok {
st.Kubeconfig = Configured
if !controlPlane {
st.Kubeconfig = Irrelevant
st.APIServer = Irrelevant
}
if st.Kubeconfig != Irrelevant {
ok, err := kubeconfig.IsClusterInConfig(ip, profile)
glog.Infof("%s is in kubeconfig at ip %s: %v (err=%v)", name, ip, ok, err)
if ok {
st.Kubeconfig = Configured
}
}
host, err := machine.LoadHost(api, name)
@ -219,14 +240,16 @@ func status(api libmachine.API, name string) (*Status, error) {
st.Kubelet = stk.String()
}
sta, err := kverify.APIServerStatus(cr, ip, port)
glog.Infof("%s apiserver status = %s (err=%v)", name, stk, err)
if st.APIServer != Irrelevant {
sta, err := kverify.APIServerStatus(cr, ip, port)
glog.Infof("%s apiserver status = %s (err=%v)", name, stk, err)
if err != nil {
glog.Errorln("Error apiserver status:", err)
st.APIServer = state.Error.String()
} else {
st.APIServer = sta.String()
if err != nil {
glog.Errorln("Error apiserver status:", err)
st.APIServer = state.Error.String()
} else {
st.APIServer = sta.String()
}
}
return st, nil
@ -242,6 +265,9 @@ For the list accessible variables for the template, see the struct values here:
func statusText(st *Status, w io.Writer) error {
tmpl, err := template.New("status").Parse(statusFormat)
if st.Worker && statusFormat == defaultStatusFormat {
tmpl, err = template.New("worker-status").Parse(workerStatusFormat)
}
if err != nil {
return err
}

View File

@ -51,18 +51,18 @@ func TestStatusText(t *testing.T) {
}{
{
name: "ok",
state: &Status{Host: "Running", Kubelet: "Running", APIServer: "Running", Kubeconfig: Configured},
want: "host: Running\nkubelet: Running\napiserver: Running\nkubeconfig: Configured\n",
state: &Status{Name: "minikube", Host: "Running", Kubelet: "Running", APIServer: "Running", Kubeconfig: Configured},
want: "minikube\nhost: Running\nkubelet: Running\napiserver: Running\nkubeconfig: Configured\n\n",
},
{
name: "paused",
state: &Status{Host: "Running", Kubelet: "Stopped", APIServer: "Paused", Kubeconfig: Configured},
want: "host: Running\nkubelet: Stopped\napiserver: Paused\nkubeconfig: Configured\n",
state: &Status{Name: "minikube", Host: "Running", Kubelet: "Stopped", APIServer: "Paused", Kubeconfig: Configured},
want: "minikube\nhost: Running\nkubelet: Stopped\napiserver: Paused\nkubeconfig: Configured\n\n",
},
{
name: "down",
state: &Status{Host: "Stopped", Kubelet: "Stopped", APIServer: "Stopped", Kubeconfig: Misconfigured},
want: "host: Stopped\nkubelet: Stopped\napiserver: Stopped\nkubeconfig: Misconfigured\n\nWARNING: Your kubectl is pointing to stale minikube-vm.\nTo fix the kubectl context, run `minikube update-context`\n",
state: &Status{Name: "minikube", Host: "Stopped", Kubelet: "Stopped", APIServer: "Stopped", Kubeconfig: Misconfigured},
want: "minikube\nhost: Stopped\nkubelet: Stopped\napiserver: Stopped\nkubeconfig: Misconfigured\n\n\nWARNING: Your kubectl is pointing to stale minikube-vm.\nTo fix the kubectl context, run `minikube update-context`\n",
},
}
for _, tc := range tests {

View File

@ -88,7 +88,7 @@ func stop(api libmachine.API, cluster config.ClusterConfig, n config.Node) bool
switch err := errors.Cause(err).(type) {
case mcnerror.ErrHostDoesNotExist:
out.T(out.Meh, `"{{.profile_name}}" does not exist, nothing to stop`, out.V{"profile_name": cluster})
out.T(out.Meh, `"{{.machineName}}" does not exist, nothing to stop`, out.V{"machineName": machineName})
nonexistent = true
return nil
default:

View File

@ -23,6 +23,7 @@ import (
"k8s.io/minikube/pkg/minikube/bootstrapper/images"
"k8s.io/minikube/pkg/minikube/config"
"k8s.io/minikube/pkg/minikube/constants"
"k8s.io/minikube/pkg/minikube/cruntime"
)
// LogOptions are options to be passed to LogCommands
@ -38,7 +39,10 @@ type Bootstrapper interface {
StartCluster(config.ClusterConfig) error
UpdateCluster(config.ClusterConfig) error
DeleteCluster(config.KubernetesConfig) error
WaitForCluster(config.ClusterConfig, time.Duration) error
WaitForNode(config.ClusterConfig, config.Node, time.Duration) error
JoinCluster(config.ClusterConfig, config.Node, string) error
UpdateNode(config.ClusterConfig, config.Node, cruntime.Manager) error
GenerateToken(config.ClusterConfig) (string, error)
// LogCommands returns a map of log type to a command which will display that log.
LogCommands(config.ClusterConfig, LogOptions) map[string]string
SetupCerts(config.KubernetesConfig, config.Node) error

View File

@ -56,7 +56,7 @@ kind: ClusterConfiguration
{{range $i, $val := .FeatureArgs}}{{$i}}: {{$val}}
{{end -}}{{end -}}
certificatesDir: {{.CertDir}}
clusterName: kubernetes
clusterName: mk
controlPlaneEndpoint: {{.ControlPlaneAddress}}:{{.APIServerPort}}
dns:
type: CoreDNS

View File

@ -29,6 +29,7 @@ import (
"k8s.io/minikube/pkg/minikube/config"
"k8s.io/minikube/pkg/minikube/constants"
"k8s.io/minikube/pkg/minikube/cruntime"
"k8s.io/minikube/pkg/minikube/driver"
"k8s.io/minikube/pkg/minikube/vmpath"
"k8s.io/minikube/pkg/util"
)
@ -37,8 +38,8 @@ import (
const remoteContainerRuntime = "remote"
// GenerateKubeadmYAML generates the kubeadm.yaml file
func GenerateKubeadmYAML(mc config.ClusterConfig, r cruntime.Manager, n config.Node) ([]byte, error) {
k8s := mc.KubernetesConfig
func GenerateKubeadmYAML(cc config.ClusterConfig, n config.Node, r cruntime.Manager) ([]byte, error) {
k8s := cc.KubernetesConfig
version, err := util.ParseKubernetesVersion(k8s.KubernetesVersion)
if err != nil {
return nil, errors.Wrap(err, "parsing kubernetes version")
@ -51,7 +52,7 @@ func GenerateKubeadmYAML(mc config.ClusterConfig, r cruntime.Manager, n config.N
}
// In case of no port assigned, use default
cp, err := config.PrimaryControlPlane(&mc)
cp, err := config.PrimaryControlPlane(&cc)
if err != nil {
return nil, errors.Wrap(err, "getting control plane")
}
@ -87,22 +88,23 @@ func GenerateKubeadmYAML(mc config.ClusterConfig, r cruntime.Manager, n config.N
CertDir: vmpath.GuestKubernetesCertsDir,
ServiceCIDR: constants.DefaultServiceCIDR,
PodSubnet: k8s.ExtraOptions.Get("pod-network-cidr", Kubeadm),
AdvertiseAddress: cp.IP,
AdvertiseAddress: n.IP,
APIServerPort: nodePort,
KubernetesVersion: k8s.KubernetesVersion,
EtcdDataDir: EtcdDataDir(),
ClusterName: k8s.ClusterName,
NodeName: cp.Name,
CRISocket: r.SocketPath(),
ImageRepository: k8s.ImageRepository,
ComponentOptions: componentOpts,
FeatureArgs: kubeadmFeatureArgs,
NoTaintMaster: false, // That does not work with k8s 1.12+
DNSDomain: k8s.DNSDomain,
NodeIP: n.IP,
ClusterName: cc.Name,
//kubeadm uses NodeName as the --hostname-override parameter, so this needs to be the name of the machine
NodeName: driver.MachineName(cc, n),
CRISocket: r.SocketPath(),
ImageRepository: k8s.ImageRepository,
ComponentOptions: componentOpts,
FeatureArgs: kubeadmFeatureArgs,
NoTaintMaster: false, // That does not work with k8s 1.12+
DNSDomain: k8s.DNSDomain,
NodeIP: n.IP,
// NOTE: If set to an specific VM IP, things may break if the IP changes on host restart
// For multi-node, we may need to figure out an alternate strategy, like DNS or hosts files
ControlPlaneAddress: "localhost",
ControlPlaneAddress: cp.IP,
}
if k8s.ServiceCIDR != "" {

View File

@ -108,7 +108,7 @@ func TestGenerateKubeadmYAMLDNS(t *testing.T) {
shouldErr bool
cfg config.ClusterConfig
}{
{"dns", "docker", false, config.ClusterConfig{KubernetesConfig: config.KubernetesConfig{DNSDomain: "1.1.1.1"}}},
{"dns", "docker", false, config.ClusterConfig{Name: "mk", KubernetesConfig: config.KubernetesConfig{DNSDomain: "1.1.1.1"}}},
}
for _, version := range versions {
for _, tc := range tests {
@ -129,7 +129,7 @@ func TestGenerateKubeadmYAMLDNS(t *testing.T) {
cfg.KubernetesConfig.KubernetesVersion = version + ".0"
cfg.KubernetesConfig.ClusterName = "kubernetes"
got, err := GenerateKubeadmYAML(cfg, runtime, cfg.Nodes[0])
got, err := GenerateKubeadmYAML(cfg, cfg.Nodes[0], runtime)
if err != nil && !tc.shouldErr {
t.Fatalf("got unexpected error generating config: %v", err)
}
@ -174,15 +174,15 @@ func TestGenerateKubeadmYAML(t *testing.T) {
shouldErr bool
cfg config.ClusterConfig
}{
{"default", "docker", false, config.ClusterConfig{}},
{"containerd", "containerd", false, config.ClusterConfig{}},
{"crio", "crio", false, config.ClusterConfig{}},
{"options", "docker", false, config.ClusterConfig{KubernetesConfig: config.KubernetesConfig{ExtraOptions: extraOpts}}},
{"crio-options-gates", "crio", false, config.ClusterConfig{KubernetesConfig: config.KubernetesConfig{ExtraOptions: extraOpts, FeatureGates: "a=b"}}},
{"unknown-component", "docker", true, config.ClusterConfig{KubernetesConfig: config.KubernetesConfig{ExtraOptions: config.ExtraOptionSlice{config.ExtraOption{Component: "not-a-real-component", Key: "killswitch", Value: "true"}}}}},
{"containerd-api-port", "containerd", false, config.ClusterConfig{Nodes: []config.Node{{Port: 12345}}}},
{"containerd-pod-network-cidr", "containerd", false, config.ClusterConfig{KubernetesConfig: config.KubernetesConfig{ExtraOptions: extraOptsPodCidr}}},
{"image-repository", "docker", false, config.ClusterConfig{KubernetesConfig: config.KubernetesConfig{ImageRepository: "test/repo"}}},
{"default", "docker", false, config.ClusterConfig{Name: "mk"}},
{"containerd", "containerd", false, config.ClusterConfig{Name: "mk"}},
{"crio", "crio", false, config.ClusterConfig{Name: "mk"}},
{"options", "docker", false, config.ClusterConfig{Name: "mk", KubernetesConfig: config.KubernetesConfig{ExtraOptions: extraOpts}}},
{"crio-options-gates", "crio", false, config.ClusterConfig{Name: "mk", KubernetesConfig: config.KubernetesConfig{ExtraOptions: extraOpts, FeatureGates: "a=b"}}},
{"unknown-component", "docker", true, config.ClusterConfig{Name: "mk", KubernetesConfig: config.KubernetesConfig{ExtraOptions: config.ExtraOptionSlice{config.ExtraOption{Component: "not-a-real-component", Key: "killswitch", Value: "true"}}}}},
{"containerd-api-port", "containerd", false, config.ClusterConfig{Name: "mk", Nodes: []config.Node{{Port: 12345}}}},
{"containerd-pod-network-cidr", "containerd", false, config.ClusterConfig{Name: "mk", KubernetesConfig: config.KubernetesConfig{ExtraOptions: extraOptsPodCidr}}},
{"image-repository", "docker", false, config.ClusterConfig{Name: "mk", KubernetesConfig: config.KubernetesConfig{ImageRepository: "test/repo"}}},
}
for _, version := range versions {
for _, tc := range tests {
@ -210,7 +210,7 @@ func TestGenerateKubeadmYAML(t *testing.T) {
cfg.KubernetesConfig.KubernetesVersion = version + ".0"
cfg.KubernetesConfig.ClusterName = "kubernetes"
got, err := GenerateKubeadmYAML(cfg, runtime, cfg.Nodes[0])
got, err := GenerateKubeadmYAML(cfg, cfg.Nodes[0], runtime)
if err != nil && !tc.shouldErr {
t.Fatalf("got unexpected error generating config: %v", err)
}

View File

@ -26,6 +26,7 @@ import (
"k8s.io/minikube/pkg/minikube/bootstrapper/images"
"k8s.io/minikube/pkg/minikube/config"
"k8s.io/minikube/pkg/minikube/cruntime"
"k8s.io/minikube/pkg/minikube/driver"
"k8s.io/minikube/pkg/util"
)
@ -60,7 +61,7 @@ func extraKubeletOpts(mc config.ClusterConfig, nc config.Node, r cruntime.Manage
extraOpts["node-ip"] = cp.IP
}
if nc.Name != "" {
extraOpts["hostname-override"] = nc.Name
extraOpts["hostname-override"] = driver.MachineName(mc, nc)
}
pauseImage := images.Pause(version, k8s.ImageRepository)

View File

@ -37,6 +37,7 @@ func TestGenerateKubeletConfig(t *testing.T) {
{
description: "old docker",
cfg: config.ClusterConfig{
Name: "minikube",
KubernetesConfig: config.KubernetesConfig{
KubernetesVersion: constants.OldestKubernetesVersion,
ContainerRuntime: "docker",
@ -62,6 +63,7 @@ ExecStart=/var/lib/minikube/binaries/v1.11.10/kubelet --allow-privileged=true --
{
description: "newest cri runtime",
cfg: config.ClusterConfig{
Name: "minikube",
KubernetesConfig: config.KubernetesConfig{
KubernetesVersion: constants.NewestKubernetesVersion,
ContainerRuntime: "cri-o",
@ -87,6 +89,7 @@ ExecStart=/var/lib/minikube/binaries/v1.18.0-rc.1/kubelet --authorization-mode=W
{
description: "default containerd runtime",
cfg: config.ClusterConfig{
Name: "minikube",
KubernetesConfig: config.KubernetesConfig{
KubernetesVersion: constants.DefaultKubernetesVersion,
ContainerRuntime: "containerd",
@ -112,6 +115,7 @@ ExecStart=/var/lib/minikube/binaries/v1.18.0-rc.1/kubelet --authorization-mode=W
{
description: "default containerd runtime with IP override",
cfg: config.ClusterConfig{
Name: "minikube",
KubernetesConfig: config.KubernetesConfig{
KubernetesVersion: constants.DefaultKubernetesVersion,
ContainerRuntime: "containerd",
@ -144,6 +148,7 @@ ExecStart=/var/lib/minikube/binaries/v1.18.0-rc.1/kubelet --authorization-mode=W
{
description: "docker with custom image repository",
cfg: config.ClusterConfig{
Name: "minikube",
KubernetesConfig: config.KubernetesConfig{
KubernetesVersion: constants.DefaultKubernetesVersion,
ContainerRuntime: "docker",

View File

@ -47,7 +47,7 @@ func AdjustResourceLimits(c command.Runner) error {
return nil
}
// ExistingConfig checks if there are config files from possible previous kubernets cluster
// ExistingConfig checks if there are config files from possible previous kubernetes cluster
func ExistingConfig(c command.Runner) error {
args := append([]string{"ls"}, expectedRemoteArtifacts...)
_, err := c.RunCmd(exec.Command("sudo", args...))

View File

@ -4,7 +4,7 @@ noTaintMaster: true
api:
advertiseAddress: 1.1.1.1
bindPort: 12345
controlPlaneEndpoint: localhost
controlPlaneEndpoint: 1.1.1.1
kubernetesVersion: v1.11.0
certificatesDir: /var/lib/minikube/certs
networking:

View File

@ -4,7 +4,7 @@ noTaintMaster: true
api:
advertiseAddress: 1.1.1.1
bindPort: 8443
controlPlaneEndpoint: localhost
controlPlaneEndpoint: 1.1.1.1
kubernetesVersion: v1.11.0
certificatesDir: /var/lib/minikube/certs
networking:

View File

@ -4,7 +4,7 @@ noTaintMaster: true
api:
advertiseAddress: 1.1.1.1
bindPort: 8443
controlPlaneEndpoint: localhost
controlPlaneEndpoint: 1.1.1.1
kubernetesVersion: v1.11.0
certificatesDir: /var/lib/minikube/certs
networking:

View File

@ -4,7 +4,7 @@ noTaintMaster: true
api:
advertiseAddress: 1.1.1.1
bindPort: 8443
controlPlaneEndpoint: localhost
controlPlaneEndpoint: 1.1.1.1
kubernetesVersion: v1.11.0
certificatesDir: /var/lib/minikube/certs
networking:

View File

@ -4,7 +4,7 @@ noTaintMaster: true
api:
advertiseAddress: 1.1.1.1
bindPort: 8443
controlPlaneEndpoint: localhost
controlPlaneEndpoint: 1.1.1.1
kubernetesVersion: v1.11.0
certificatesDir: /var/lib/minikube/certs
networking:

View File

@ -4,7 +4,7 @@ noTaintMaster: true
api:
advertiseAddress: 1.1.1.1
bindPort: 8443
controlPlaneEndpoint: localhost
controlPlaneEndpoint: 1.1.1.1
kubernetesVersion: v1.11.0
certificatesDir: /var/lib/minikube/certs
networking:

View File

@ -4,7 +4,7 @@ noTaintMaster: true
api:
advertiseAddress: 1.1.1.1
bindPort: 8443
controlPlaneEndpoint: localhost
controlPlaneEndpoint: 1.1.1.1
kubernetesVersion: v1.11.0
certificatesDir: /var/lib/minikube/certs
networking:

View File

@ -4,7 +4,7 @@ noTaintMaster: true
api:
advertiseAddress: 1.1.1.1
bindPort: 8443
controlPlaneEndpoint: localhost
controlPlaneEndpoint: 1.1.1.1
kubernetesVersion: v1.11.0
certificatesDir: /var/lib/minikube/certs
networking:

View File

@ -22,9 +22,9 @@ kind: ClusterConfiguration
apiServerExtraArgs:
enable-admission-plugins: "Initializers,NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
clusterName: mk
apiServerCertSANs: ["127.0.0.1", "localhost", "1.1.1.1"]
controlPlaneEndpoint: localhost:12345
controlPlaneEndpoint: 1.1.1.1:12345
etcd:
local:
dataDir: /var/lib/minikube/etcd

View File

@ -22,9 +22,9 @@ kind: ClusterConfiguration
apiServerExtraArgs:
enable-admission-plugins: "Initializers,NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
clusterName: mk
apiServerCertSANs: ["127.0.0.1", "localhost", "1.1.1.1"]
controlPlaneEndpoint: localhost:8443
controlPlaneEndpoint: 1.1.1.1:8443
etcd:
local:
dataDir: /var/lib/minikube/etcd

View File

@ -22,9 +22,9 @@ kind: ClusterConfiguration
apiServerExtraArgs:
enable-admission-plugins: "Initializers,NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
clusterName: mk
apiServerCertSANs: ["127.0.0.1", "localhost", "1.1.1.1"]
controlPlaneEndpoint: localhost:8443
controlPlaneEndpoint: 1.1.1.1:8443
etcd:
local:
dataDir: /var/lib/minikube/etcd

View File

@ -30,9 +30,9 @@ schedulerExtraArgs:
feature-gates: "a=b"
scheduler-name: "mini-scheduler"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
clusterName: mk
apiServerCertSANs: ["127.0.0.1", "localhost", "1.1.1.1"]
controlPlaneEndpoint: localhost:8443
controlPlaneEndpoint: 1.1.1.1:8443
etcd:
local:
dataDir: /var/lib/minikube/etcd

View File

@ -22,9 +22,9 @@ kind: ClusterConfiguration
apiServerExtraArgs:
enable-admission-plugins: "Initializers,NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
clusterName: mk
apiServerCertSANs: ["127.0.0.1", "localhost", "1.1.1.1"]
controlPlaneEndpoint: localhost:8443
controlPlaneEndpoint: 1.1.1.1:8443
etcd:
local:
dataDir: /var/lib/minikube/etcd

View File

@ -22,9 +22,9 @@ kind: ClusterConfiguration
apiServerExtraArgs:
enable-admission-plugins: "Initializers,NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
clusterName: mk
apiServerCertSANs: ["127.0.0.1", "localhost", "1.1.1.1"]
controlPlaneEndpoint: localhost:8443
controlPlaneEndpoint: 1.1.1.1:8443
etcd:
local:
dataDir: /var/lib/minikube/etcd

View File

@ -22,9 +22,9 @@ kind: ClusterConfiguration
apiServerExtraArgs:
enable-admission-plugins: "Initializers,NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
clusterName: mk
apiServerCertSANs: ["127.0.0.1", "localhost", "1.1.1.1"]
controlPlaneEndpoint: localhost:8443
controlPlaneEndpoint: 1.1.1.1:8443
etcd:
local:
dataDir: /var/lib/minikube/etcd

View File

@ -23,9 +23,9 @@ imageRepository: test/repo
apiServerExtraArgs:
enable-admission-plugins: "Initializers,NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
clusterName: mk
apiServerCertSANs: ["127.0.0.1", "localhost", "1.1.1.1"]
controlPlaneEndpoint: localhost:8443
controlPlaneEndpoint: 1.1.1.1:8443
etcd:
local:
dataDir: /var/lib/minikube/etcd

View File

@ -27,9 +27,9 @@ controllerManagerExtraArgs:
schedulerExtraArgs:
scheduler-name: "mini-scheduler"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
clusterName: mk
apiServerCertSANs: ["127.0.0.1", "localhost", "1.1.1.1"]
controlPlaneEndpoint: localhost:8443
controlPlaneEndpoint: 1.1.1.1:8443
etcd:
local:
dataDir: /var/lib/minikube/etcd

View File

@ -22,9 +22,9 @@ kind: ClusterConfiguration
apiServerExtraArgs:
enable-admission-plugins: "Initializers,NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
clusterName: mk
apiServerCertSANs: ["127.0.0.1", "localhost", "1.1.1.1"]
controlPlaneEndpoint: localhost:12345
controlPlaneEndpoint: 1.1.1.1:12345
etcd:
local:
dataDir: /var/lib/minikube/etcd

View File

@ -22,9 +22,9 @@ kind: ClusterConfiguration
apiServerExtraArgs:
enable-admission-plugins: "Initializers,NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
clusterName: mk
apiServerCertSANs: ["127.0.0.1", "localhost", "1.1.1.1"]
controlPlaneEndpoint: localhost:8443
controlPlaneEndpoint: 1.1.1.1:8443
etcd:
local:
dataDir: /var/lib/minikube/etcd

View File

@ -22,9 +22,9 @@ kind: ClusterConfiguration
apiServerExtraArgs:
enable-admission-plugins: "Initializers,NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
clusterName: mk
apiServerCertSANs: ["127.0.0.1", "localhost", "1.1.1.1"]
controlPlaneEndpoint: localhost:8443
controlPlaneEndpoint: 1.1.1.1:8443
etcd:
local:
dataDir: /var/lib/minikube/etcd

View File

@ -30,9 +30,9 @@ schedulerExtraArgs:
feature-gates: "a=b"
scheduler-name: "mini-scheduler"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
clusterName: mk
apiServerCertSANs: ["127.0.0.1", "localhost", "1.1.1.1"]
controlPlaneEndpoint: localhost:8443
controlPlaneEndpoint: 1.1.1.1:8443
etcd:
local:
dataDir: /var/lib/minikube/etcd

View File

@ -22,9 +22,9 @@ kind: ClusterConfiguration
apiServerExtraArgs:
enable-admission-plugins: "Initializers,NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
clusterName: mk
apiServerCertSANs: ["127.0.0.1", "localhost", "1.1.1.1"]
controlPlaneEndpoint: localhost:8443
controlPlaneEndpoint: 1.1.1.1:8443
etcd:
local:
dataDir: /var/lib/minikube/etcd

View File

@ -22,9 +22,9 @@ kind: ClusterConfiguration
apiServerExtraArgs:
enable-admission-plugins: "Initializers,NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
clusterName: mk
apiServerCertSANs: ["127.0.0.1", "localhost", "1.1.1.1"]
controlPlaneEndpoint: localhost:8443
controlPlaneEndpoint: 1.1.1.1:8443
etcd:
local:
dataDir: /var/lib/minikube/etcd

View File

@ -22,9 +22,9 @@ kind: ClusterConfiguration
apiServerExtraArgs:
enable-admission-plugins: "Initializers,NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
clusterName: mk
apiServerCertSANs: ["127.0.0.1", "localhost", "1.1.1.1"]
controlPlaneEndpoint: localhost:8443
controlPlaneEndpoint: 1.1.1.1:8443
etcd:
local:
dataDir: /var/lib/minikube/etcd

View File

@ -23,9 +23,9 @@ imageRepository: test/repo
apiServerExtraArgs:
enable-admission-plugins: "Initializers,NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
clusterName: mk
apiServerCertSANs: ["127.0.0.1", "localhost", "1.1.1.1"]
controlPlaneEndpoint: localhost:8443
controlPlaneEndpoint: 1.1.1.1:8443
etcd:
local:
dataDir: /var/lib/minikube/etcd

View File

@ -27,9 +27,9 @@ controllerManagerExtraArgs:
schedulerExtraArgs:
scheduler-name: "mini-scheduler"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
clusterName: mk
apiServerCertSANs: ["127.0.0.1", "localhost", "1.1.1.1"]
controlPlaneEndpoint: localhost:8443
controlPlaneEndpoint: 1.1.1.1:8443
etcd:
local:
dataDir: /var/lib/minikube/etcd

View File

@ -24,8 +24,8 @@ apiServer:
extraArgs:
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:12345
clusterName: mk
controlPlaneEndpoint: 1.1.1.1:12345
dns:
type: CoreDNS
etcd:

View File

@ -24,8 +24,8 @@ apiServer:
extraArgs:
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
clusterName: mk
controlPlaneEndpoint: 1.1.1.1:8443
dns:
type: CoreDNS
etcd:

View File

@ -24,8 +24,8 @@ apiServer:
extraArgs:
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
clusterName: mk
controlPlaneEndpoint: 1.1.1.1:8443
dns:
type: CoreDNS
etcd:

View File

@ -34,8 +34,8 @@ scheduler:
feature-gates: "a=b"
scheduler-name: "mini-scheduler"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
clusterName: mk
controlPlaneEndpoint: 1.1.1.1:8443
dns:
type: CoreDNS
etcd:

View File

@ -24,8 +24,8 @@ apiServer:
extraArgs:
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
clusterName: mk
controlPlaneEndpoint: 1.1.1.1:8443
dns:
type: CoreDNS
etcd:

View File

@ -24,8 +24,8 @@ apiServer:
extraArgs:
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
clusterName: mk
controlPlaneEndpoint: 1.1.1.1:8443
dns:
type: CoreDNS
etcd:

View File

@ -24,8 +24,8 @@ apiServer:
extraArgs:
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
clusterName: mk
controlPlaneEndpoint: 1.1.1.1:8443
dns:
type: CoreDNS
etcd:

View File

@ -25,8 +25,8 @@ apiServer:
extraArgs:
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
clusterName: mk
controlPlaneEndpoint: 1.1.1.1:8443
dns:
type: CoreDNS
etcd:

View File

@ -31,8 +31,8 @@ scheduler:
extraArgs:
scheduler-name: "mini-scheduler"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
clusterName: mk
controlPlaneEndpoint: 1.1.1.1:8443
dns:
type: CoreDNS
etcd:

View File

@ -24,8 +24,8 @@ apiServer:
extraArgs:
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:12345
clusterName: mk
controlPlaneEndpoint: 1.1.1.1:12345
dns:
type: CoreDNS
etcd:

View File

@ -24,8 +24,8 @@ apiServer:
extraArgs:
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
clusterName: mk
controlPlaneEndpoint: 1.1.1.1:8443
dns:
type: CoreDNS
etcd:

View File

@ -24,8 +24,8 @@ apiServer:
extraArgs:
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
clusterName: mk
controlPlaneEndpoint: 1.1.1.1:8443
dns:
type: CoreDNS
etcd:

View File

@ -34,8 +34,8 @@ scheduler:
feature-gates: "a=b"
scheduler-name: "mini-scheduler"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
clusterName: mk
controlPlaneEndpoint: 1.1.1.1:8443
dns:
type: CoreDNS
etcd:

View File

@ -24,8 +24,8 @@ apiServer:
extraArgs:
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
clusterName: mk
controlPlaneEndpoint: 1.1.1.1:8443
dns:
type: CoreDNS
etcd:

View File

@ -24,8 +24,8 @@ apiServer:
extraArgs:
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
clusterName: mk
controlPlaneEndpoint: 1.1.1.1:8443
dns:
type: CoreDNS
etcd:

View File

@ -24,8 +24,8 @@ apiServer:
extraArgs:
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
clusterName: mk
controlPlaneEndpoint: 1.1.1.1:8443
dns:
type: CoreDNS
etcd:

View File

@ -25,8 +25,8 @@ apiServer:
extraArgs:
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
clusterName: mk
controlPlaneEndpoint: 1.1.1.1:8443
dns:
type: CoreDNS
etcd:

View File

@ -31,8 +31,8 @@ scheduler:
extraArgs:
scheduler-name: "mini-scheduler"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
clusterName: mk
controlPlaneEndpoint: 1.1.1.1:8443
dns:
type: CoreDNS
etcd:

View File

@ -24,8 +24,8 @@ apiServer:
extraArgs:
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:12345
clusterName: mk
controlPlaneEndpoint: 1.1.1.1:12345
dns:
type: CoreDNS
etcd:

View File

@ -24,8 +24,8 @@ apiServer:
extraArgs:
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
clusterName: mk
controlPlaneEndpoint: 1.1.1.1:8443
dns:
type: CoreDNS
etcd:

View File

@ -24,8 +24,8 @@ apiServer:
extraArgs:
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
clusterName: mk
controlPlaneEndpoint: 1.1.1.1:8443
dns:
type: CoreDNS
etcd:

View File

@ -34,8 +34,8 @@ scheduler:
feature-gates: "a=b"
scheduler-name: "mini-scheduler"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
clusterName: mk
controlPlaneEndpoint: 1.1.1.1:8443
dns:
type: CoreDNS
etcd:

View File

@ -24,8 +24,8 @@ apiServer:
extraArgs:
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
clusterName: mk
controlPlaneEndpoint: 1.1.1.1:8443
dns:
type: CoreDNS
etcd:

View File

@ -24,8 +24,8 @@ apiServer:
extraArgs:
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
clusterName: mk
controlPlaneEndpoint: 1.1.1.1:8443
dns:
type: CoreDNS
etcd:

View File

@ -24,8 +24,8 @@ apiServer:
extraArgs:
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
clusterName: mk
controlPlaneEndpoint: 1.1.1.1:8443
dns:
type: CoreDNS
etcd:

View File

@ -25,8 +25,8 @@ apiServer:
extraArgs:
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
clusterName: mk
controlPlaneEndpoint: 1.1.1.1:8443
dns:
type: CoreDNS
etcd:

View File

@ -31,8 +31,8 @@ scheduler:
extraArgs:
scheduler-name: "mini-scheduler"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
clusterName: mk
controlPlaneEndpoint: 1.1.1.1:8443
dns:
type: CoreDNS
etcd:

View File

@ -24,8 +24,8 @@ apiServer:
extraArgs:
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:12345
clusterName: mk
controlPlaneEndpoint: 1.1.1.1:12345
dns:
type: CoreDNS
etcd:

View File

@ -24,8 +24,8 @@ apiServer:
extraArgs:
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
clusterName: mk
controlPlaneEndpoint: 1.1.1.1:8443
dns:
type: CoreDNS
etcd:

View File

@ -24,8 +24,8 @@ apiServer:
extraArgs:
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
clusterName: mk
controlPlaneEndpoint: 1.1.1.1:8443
dns:
type: CoreDNS
etcd:

View File

@ -34,8 +34,8 @@ scheduler:
feature-gates: "a=b"
scheduler-name: "mini-scheduler"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
clusterName: mk
controlPlaneEndpoint: 1.1.1.1:8443
dns:
type: CoreDNS
etcd:

View File

@ -24,8 +24,8 @@ apiServer:
extraArgs:
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
clusterName: mk
controlPlaneEndpoint: 1.1.1.1:8443
dns:
type: CoreDNS
etcd:

View File

@ -24,8 +24,8 @@ apiServer:
extraArgs:
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
clusterName: mk
controlPlaneEndpoint: 1.1.1.1:8443
dns:
type: CoreDNS
etcd:

View File

@ -24,8 +24,8 @@ apiServer:
extraArgs:
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
clusterName: mk
controlPlaneEndpoint: 1.1.1.1:8443
dns:
type: CoreDNS
etcd:

View File

@ -25,8 +25,8 @@ apiServer:
extraArgs:
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
clusterName: mk
controlPlaneEndpoint: 1.1.1.1:8443
dns:
type: CoreDNS
etcd:

View File

@ -31,8 +31,8 @@ scheduler:
extraArgs:
scheduler-name: "mini-scheduler"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
clusterName: mk
controlPlaneEndpoint: 1.1.1.1:8443
dns:
type: CoreDNS
etcd:

View File

@ -24,8 +24,8 @@ apiServer:
extraArgs:
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:12345
clusterName: mk
controlPlaneEndpoint: 1.1.1.1:12345
dns:
type: CoreDNS
etcd:

View File

@ -24,8 +24,8 @@ apiServer:
extraArgs:
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
clusterName: mk
controlPlaneEndpoint: 1.1.1.1:8443
dns:
type: CoreDNS
etcd:

View File

@ -24,8 +24,8 @@ apiServer:
extraArgs:
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
clusterName: mk
controlPlaneEndpoint: 1.1.1.1:8443
dns:
type: CoreDNS
etcd:

View File

@ -34,8 +34,8 @@ scheduler:
feature-gates: "a=b"
scheduler-name: "mini-scheduler"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
clusterName: mk
controlPlaneEndpoint: 1.1.1.1:8443
dns:
type: CoreDNS
etcd:

View File

@ -24,8 +24,8 @@ apiServer:
extraArgs:
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
clusterName: mk
controlPlaneEndpoint: 1.1.1.1:8443
dns:
type: CoreDNS
etcd:

View File

@ -24,8 +24,8 @@ apiServer:
extraArgs:
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
clusterName: mk
controlPlaneEndpoint: 1.1.1.1:8443
dns:
type: CoreDNS
etcd:

View File

@ -24,8 +24,8 @@ apiServer:
extraArgs:
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
clusterName: mk
controlPlaneEndpoint: 1.1.1.1:8443
dns:
type: CoreDNS
etcd:

View File

@ -25,8 +25,8 @@ apiServer:
extraArgs:
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
clusterName: mk
controlPlaneEndpoint: 1.1.1.1:8443
dns:
type: CoreDNS
etcd:

View File

@ -31,8 +31,8 @@ scheduler:
extraArgs:
scheduler-name: "mini-scheduler"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
clusterName: mk
controlPlaneEndpoint: 1.1.1.1:8443
dns:
type: CoreDNS
etcd:

View File

@ -24,8 +24,8 @@ apiServer:
extraArgs:
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:12345
clusterName: mk
controlPlaneEndpoint: 1.1.1.1:12345
dns:
type: CoreDNS
etcd:

View File

@ -24,8 +24,8 @@ apiServer:
extraArgs:
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
clusterName: mk
controlPlaneEndpoint: 1.1.1.1:8443
dns:
type: CoreDNS
etcd:

View File

@ -24,8 +24,8 @@ apiServer:
extraArgs:
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
clusterName: mk
controlPlaneEndpoint: 1.1.1.1:8443
dns:
type: CoreDNS
etcd:

View File

@ -34,8 +34,8 @@ scheduler:
feature-gates: "a=b"
scheduler-name: "mini-scheduler"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
clusterName: mk
controlPlaneEndpoint: 1.1.1.1:8443
dns:
type: CoreDNS
etcd:

View File

@ -24,8 +24,8 @@ apiServer:
extraArgs:
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
clusterName: mk
controlPlaneEndpoint: 1.1.1.1:8443
dns:
type: CoreDNS
etcd:

View File

@ -24,8 +24,8 @@ apiServer:
extraArgs:
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
clusterName: mk
controlPlaneEndpoint: 1.1.1.1:8443
dns:
type: CoreDNS
etcd:

View File

@ -24,8 +24,8 @@ apiServer:
extraArgs:
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
clusterName: mk
controlPlaneEndpoint: 1.1.1.1:8443
dns:
type: CoreDNS
etcd:

View File

@ -25,8 +25,8 @@ apiServer:
extraArgs:
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
clusterName: mk
controlPlaneEndpoint: 1.1.1.1:8443
dns:
type: CoreDNS
etcd:

View File

@ -31,8 +31,8 @@ scheduler:
extraArgs:
scheduler-name: "mini-scheduler"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
clusterName: mk
controlPlaneEndpoint: 1.1.1.1:8443
dns:
type: CoreDNS
etcd:

View File

@ -121,8 +121,10 @@ func SetupCerts(cmd command.Runner, k8s config.KubernetesConfig, n config.Node)
return errors.Wrap(err, "encoding kubeconfig")
}
kubeCfgFile := assets.NewMemoryAsset(data, vmpath.GuestPersistentDir, "kubeconfig", "0644")
copyableFiles = append(copyableFiles, kubeCfgFile)
if n.ControlPlane {
kubeCfgFile := assets.NewMemoryAsset(data, vmpath.GuestPersistentDir, "kubeconfig", "0644")
copyableFiles = append(copyableFiles, kubeCfgFile)
}
for _, f := range copyableFiles {
if err := cmd.Copy(f); err != nil {

View File

@ -171,6 +171,13 @@ func (k *Bootstrapper) StartCluster(cfg config.ClusterConfig) error {
glog.Infof("StartCluster complete in %s", time.Since(start))
}()
// Remove admin.conf from any previous run
c := exec.Command("/bin/bash", "-c", "sudo rm -f /etc/kubernetes/admin.conf")
_, err = k.c.RunCmd(c)
if err != nil {
return errors.Wrap(err, "deleting admin.conf")
}
version, err := util.ParseKubernetesVersion(cfg.KubernetesConfig.KubernetesVersion)
if err != nil {
return errors.Wrap(err, "parsing kubernetes version")
@ -208,7 +215,7 @@ func (k *Bootstrapper) StartCluster(cfg config.ClusterConfig) error {
}
c := exec.Command("/bin/bash", "-c", fmt.Sprintf("%s init --config %s %s --ignore-preflight-errors=%s", bsutil.InvokeKubeadm(cfg.KubernetesConfig.KubernetesVersion), bsutil.KubeadmYamlPath, extraFlags, strings.Join(ignore, ",")))
c = exec.Command("/bin/bash", "-c", fmt.Sprintf("%s init --config %s %s --ignore-preflight-errors=%s", bsutil.InvokeKubeadm(cfg.KubernetesConfig.KubernetesVersion), bsutil.KubeadmYamlPath, extraFlags, strings.Join(ignore, ",")))
rr, err := k.c.RunCmd(c)
if err != nil {
return errors.Wrapf(err, "init failed. output: %q", rr.Output())
@ -258,35 +265,37 @@ func (k *Bootstrapper) client(ip string, port int) (*kubernetes.Clientset, error
return c, err
}
// WaitForCluster blocks until the cluster appears to be healthy
func (k *Bootstrapper) WaitForCluster(cfg config.ClusterConfig, timeout time.Duration) error {
// WaitForNode blocks until the node appears to be healthy
func (k *Bootstrapper) WaitForNode(cfg config.ClusterConfig, n config.Node, timeout time.Duration) error {
start := time.Now()
out.T(out.Waiting, "Waiting for cluster to come online ...")
cp, err := config.PrimaryControlPlane(&cfg)
if err != nil {
return err
}
cr, err := cruntime.New(cruntime.Config{Type: cfg.KubernetesConfig.ContainerRuntime, Runner: k.c})
if err != nil {
return err
}
if err := kverify.WaitForAPIServerProcess(cr, k, cfg, k.c, start, timeout); err != nil {
return err
}
ip := cp.IP
port := cp.Port
if driver.IsKIC(cfg.Driver) {
ip = oci.DefaultBindIPV4
port, err = oci.ForwardedPort(cfg.Driver, cfg.Name, port)
if err != nil {
return errors.Wrapf(err, "get host-bind port %d for container %s", port, cfg.Name)
if n.ControlPlane {
if err := kverify.WaitForAPIServerProcess(cr, k, cfg, k.c, start, timeout); err != nil {
return err
}
}
if err := kverify.WaitForHealthyAPIServer(cr, k, cfg, k.c, start, ip, port, timeout); err != nil {
return err
ip := n.IP
port := n.Port
if driver.IsKIC(cfg.Driver) {
ip = oci.DefaultBindIPV4
p, err := oci.ForwardedPort(cfg.Driver, driver.MachineName(cfg, n), port)
if err != nil {
return errors.Wrapf(err, "get host-bind port %d for container %s", port, cfg.Name)
}
port = p
}
if n.ControlPlane {
if err := kverify.WaitForHealthyAPIServer(cr, k, cfg, k.c, start, ip, port, timeout); err != nil {
return err
}
}
c, err := k.client(ip, port)
@ -351,37 +360,76 @@ func (k *Bootstrapper) restartCluster(cfg config.ClusterConfig) error {
return errors.Wrap(err, "apiserver healthz")
}
for _, n := range cfg.Nodes {
ip := n.IP
port := n.Port
if driver.IsKIC(cfg.Driver) {
ip = oci.DefaultBindIPV4
port, err = oci.ForwardedPort(cfg.Driver, cfg.Name, port)
if err != nil {
return errors.Wrapf(err, "get host-bind port %d for container %s", port, cfg.Name)
}
}
client, err := k.client(ip, port)
cp, err := config.PrimaryControlPlane(&cfg)
if err != nil {
return errors.Wrap(err, "getting control plane")
}
ip := cp.IP
port := cp.Port
if driver.IsKIC(cfg.Driver) {
ip = oci.DefaultBindIPV4
port, err = oci.ForwardedPort(cfg.Driver, driver.MachineName(cfg, cp), port)
if err != nil {
return errors.Wrap(err, "getting k8s client")
}
if err := kverify.WaitForSystemPods(cr, k, cfg, k.c, client, time.Now(), kconst.DefaultControlPlaneTimeout); err != nil {
return errors.Wrap(err, "system pods")
}
// Explicitly re-enable kubeadm addons (proxy, coredns) so that they will check for IP or configuration changes.
if rr, err := k.c.RunCmd(exec.Command("/bin/bash", "-c", fmt.Sprintf("%s phase addon all --config %s", baseCmd, bsutil.KubeadmYamlPath))); err != nil {
return errors.Wrapf(err, fmt.Sprintf("addon phase cmd:%q", rr.Command()))
}
if err := bsutil.AdjustResourceLimits(k.c); err != nil {
glog.Warningf("unable to adjust resource limits: %v", err)
return errors.Wrapf(err, "get host-bind port %d for container %s", port, driver.MachineName(cfg, cp))
}
}
client, err := k.client(ip, port)
if err != nil {
return errors.Wrap(err, "getting k8s client")
}
if err := kverify.WaitForSystemPods(cr, k, cfg, k.c, client, time.Now(), kconst.DefaultControlPlaneTimeout); err != nil {
return errors.Wrap(err, "system pods")
}
// Explicitly re-enable kubeadm addons (proxy, coredns) so that they will check for IP or configuration changes.
if rr, err := k.c.RunCmd(exec.Command("/bin/bash", "-c", fmt.Sprintf("%s phase addon all --config %s", baseCmd, bsutil.KubeadmYamlPath))); err != nil {
return errors.Wrapf(err, fmt.Sprintf("addon phase cmd:%q", rr.Command()))
}
if err := bsutil.AdjustResourceLimits(k.c); err != nil {
glog.Warningf("unable to adjust resource limits: %v", err)
}
return nil
}
// JoinCluster adds a node to an existing cluster
func (k *Bootstrapper) JoinCluster(cc config.ClusterConfig, n config.Node, joinCmd string) error {
start := time.Now()
glog.Infof("JoinCluster: %+v", cc)
defer func() {
glog.Infof("JoinCluster complete in %s", time.Since(start))
}()
// Join the master by specifying its token
joinCmd = fmt.Sprintf("%s --v=10 --node-name=%s", joinCmd, driver.MachineName(cc, n))
out, err := k.c.RunCmd(exec.Command("/bin/bash", "-c", joinCmd))
if err != nil {
return errors.Wrapf(err, "cmd failed: %s\n%+v\n", joinCmd, out)
}
if _, err := k.c.RunCmd(exec.Command("/bin/bash", "-c", "sudo systemctl daemon-reload && sudo systemctl enable kubelet && sudo systemctl start kubelet")); err != nil {
return errors.Wrap(err, "starting kubelet")
}
return nil
}
// GenerateToken creates a token and returns the appropriate kubeadm join command to run
func (k *Bootstrapper) GenerateToken(cc config.ClusterConfig) (string, error) {
tokenCmd := exec.Command("/bin/bash", "-c", fmt.Sprintf("%s token create --print-join-command --ttl=0", bsutil.InvokeKubeadm(cc.KubernetesConfig.KubernetesVersion)))
r, err := k.c.RunCmd(tokenCmd)
if err != nil {
return "", errors.Wrap(err, "generating bootstrap token")
}
joinCmd := r.Stdout.String()
joinCmd = strings.Replace(joinCmd, "kubeadm", bsutil.InvokeKubeadm(cc.KubernetesConfig.KubernetesVersion), 1)
joinCmd = fmt.Sprintf("%s --ignore-preflight-errors=all", strings.TrimSpace(joinCmd))
return joinCmd, nil
}
// DeleteCluster removes the components that were started earlier
func (k *Bootstrapper) DeleteCluster(k8s config.KubernetesConfig) error {
version, err := util.ParseKubernetesVersion(k8s.KubernetesVersion)
@ -406,7 +454,7 @@ func (k *Bootstrapper) SetupCerts(k8s config.KubernetesConfig, n config.Node) er
return bootstrapper.SetupCerts(k.c, k8s, n)
}
// UpdateCluster updates the cluster
// UpdateCluster updates the cluster.
func (k *Bootstrapper) UpdateCluster(cfg config.ClusterConfig) error {
images, err := images.Kubeadm(cfg.KubernetesConfig.ImageRepository, cfg.KubernetesConfig.KubernetesVersion)
if err != nil {
@ -424,14 +472,24 @@ func (k *Bootstrapper) UpdateCluster(cfg config.ClusterConfig) error {
return errors.Wrap(err, "runtime")
}
// TODO: multiple nodes
kubeadmCfg, err := bsutil.GenerateKubeadmYAML(cfg, r, cfg.Nodes[0])
for _, n := range cfg.Nodes {
err := k.UpdateNode(cfg, n, r)
if err != nil {
return errors.Wrap(err, "updating node")
}
}
return nil
}
// UpdateNode updates a node.
func (k *Bootstrapper) UpdateNode(cfg config.ClusterConfig, n config.Node, r cruntime.Manager) error {
kubeadmCfg, err := bsutil.GenerateKubeadmYAML(cfg, n, r)
if err != nil {
return errors.Wrap(err, "generating kubeadm cfg")
}
// TODO: multiple nodes
kubeletCfg, err := bsutil.NewKubeletConfig(cfg, cfg.Nodes[0], r)
kubeletCfg, err := bsutil.NewKubeletConfig(cfg, n, r)
if err != nil {
return errors.Wrap(err, "generating kubelet config")
}

View File

@ -52,6 +52,14 @@ const (
var (
// ErrKeyNotFound is the error returned when a key doesn't exist in the config file
ErrKeyNotFound = errors.New("specified key could not be found in config")
// DockerEnv contains the environment variables
DockerEnv []string
// DockerOpt contains the option parameters
DockerOpt []string
// ExtraOptions contains extra options (if any)
ExtraOptions ExtraOptionSlice
// AddonList contains the list of addons
AddonList []string
)
// ErrNotExist is the error returned when a config does not exist

View File

@ -1,36 +0,0 @@
/*
Copyright 2019 The Kubernetes Authors All rights reserved.
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.
*/
package config
// AddNode adds a new node config to an existing cluster.
func AddNode(cc *ClusterConfig, name string, controlPlane bool, k8sVersion string, profileName string) error {
node := Node{
Name: name,
Worker: true,
}
if controlPlane {
node.ControlPlane = true
}
if k8sVersion != "" {
node.KubernetesVersion = k8sVersion
}
cc.Nodes = append(cc.Nodes, node)
return SaveProfile(profileName, cc)
}

Some files were not shown because too many files have changed in this diff Show More