Address review comments, rename to ssh-ip-address

pull/10099/head
Anders F Björklund 2021-01-16 14:43:40 +01:00
parent 4611e2fe76
commit 541193c945
6 changed files with 11 additions and 13 deletions

View File

@ -110,7 +110,7 @@ const (
network = "network"
startNamespace = "namespace"
trace = "trace"
sshIPAddress = "ip-address"
sshIPAddress = "ssh-ip-address"
sshSSHUser = "ssh-user"
sshSSHKey = "ssh-key"
sshSSHPort = "ssh-port"
@ -347,7 +347,7 @@ func generateClusterConfig(cmd *cobra.Command, existing *config.ClusterConfig, k
NatNicType: viper.GetString(natNicType),
StartHostTimeout: viper.GetDuration(waitTimeout),
ExposedPorts: viper.GetStringSlice(ports),
IPAddress: viper.GetString(sshIPAddress),
SSHIPAddress: viper.GetString(sshIPAddress),
SSHUser: viper.GetString(sshSSHUser),
SSHKey: viper.GetString(sshSSHKey),
SSHPort: viper.GetInt(sshSSHPort),

View File

@ -102,8 +102,6 @@ func (d *Driver) PreCreateCheck() error {
if _, err := os.Stat(d.SSHKey); os.IsNotExist(err) {
return fmt.Errorf("SSH key does not exist: %q", d.SSHKey)
}
// TODO: validate the key is a valid key
}
return nil

View File

@ -66,10 +66,10 @@ type ClusterConfig struct {
HostDNSResolver bool // Only used by virtualbox
HostOnlyNicType string // Only used by virtualbox
NatNicType string // Only used by virtualbox
IPAddress string // Only used by ssh
SSHUser string // Only used by ssh
SSHKey string // Only used by ssh
SSHPort int // Only used by ssh
SSHIPAddress string // Only used by ssh driver
SSHUser string // Only used by ssh driver
SSHKey string // Only used by ssh driver
SSHPort int // Only used by ssh driver
KubernetesConfig KubernetesConfig
Nodes []Node
Addons map[string]bool

View File

@ -50,17 +50,17 @@ func configure(cc config.ClusterConfig, n config.Node) (interface{}, error) {
ContainerRuntime: cc.KubernetesConfig.ContainerRuntime,
})
if cc.IPAddress == "" {
if cc.SSHIPAddress == "" {
return nil, errors.Errorf("please provide an IP address")
}
// We don't want the API server listening on loopback interface,
// even if we might use a tunneled VM port for the SSH service
if cc.IPAddress == "127.0.0.1" || cc.IPAddress == "localhost" {
if cc.SSHIPAddress == "127.0.0.1" || cc.SSHIPAddress == "localhost" {
return nil, errors.Errorf("please provide real IP address")
}
d.IPAddress = cc.IPAddress
d.IPAddress = cc.SSHIPAddress
d.SSHUser = cc.SSHUser
d.SSHKey = cc.SSHKey
d.SSHPort = cc.SSHPort

View File

@ -64,7 +64,6 @@ minikube start [flags]
--insecure-registry strings Insecure Docker registries to pass to the Docker daemon. The default service CIDR range will automatically be added.
--install-addons If set, install addons. Defaults to true. (default true)
--interactive Allow user prompts for more information (default true)
--ip-address string IP address (ssh driver only)
--iso-url strings Locations to fetch the minikube ISO from. (default [https://storage.googleapis.com/minikube/iso/minikube-v1.16.0.iso,https://github.com/kubernetes/minikube/releases/download/v1.16.0/minikube-v1.16.0.iso,https://kubernetes.oss-cn-hangzhou.aliyuncs.com/minikube/iso/minikube-v1.16.0.iso])
--keep-context This will keep the existing kubectl context and will create a minikube context.
--kubernetes-version string The Kubernetes version that the minikube VM will use (ex: v1.2.3, 'stable' for v1.20.0, 'latest' for v1.20.0). Defaults to 'stable'.
@ -89,6 +88,7 @@ minikube start [flags]
--preload If set, download tarball of preloaded images if available to improve start time. Defaults to true. (default true)
--registry-mirror strings Registry mirrors to pass to the Docker daemon
--service-cluster-ip-range string The CIDR to be used for service cluster IPs. (default "10.96.0.0/12")
--ssh-ip-address string IP address (ssh driver only)
--ssh-key string SSH key (ssh driver only)
--ssh-port int SSH port (ssh driver only) (default 22)
--ssh-user string SSH user (ssh driver only) (default "root")

View File

@ -20,6 +20,6 @@ This VM must also meet the [kubeadm requirements](https://kubernetes.io/docs/set
The ssh driver requires the IP address of the VM to use.
```shell
minikube start --driver=ssh --ip-address=vm.example.com
minikube start --driver=ssh --ssh-ip-address=vm.example.com
```