1. minikube profile list
查看所有的 minikube 配置文件,并检查配置文件的有效性。
minikube profile list [flags]
1.1. Options
-l, --light If true, returns list of profiles faster by skipping validating the status of the cluster.
-o, --output string The output format. One of 'json', 'table' (default "table")
1.2. 从父命令继承的选项
--add_dir_header If true, adds the file directory to the header of the log messages
--alsologtostderr log to standard error as well as files
-b, --bootstrapper string The name of the cluster bootstrapper that will set up the Kubernetes cluster. (default "kubeadm")
-h, --help
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--log_file string If non-empty, use this log file
--log_file_max_size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
--logtostderr log to standard error instead of files
--one_output If true, only write logs to their native severity level (vs also writing to each lower severity level)
-p, --profile string The name of the minikube VM being used. This can be set to allow having multiple instances of minikube independently. (default "minikube")
--skip_headers If true, avoid header prefixes in the log messages
--skip_log_headers If true, avoid headers when opening log files
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
--user string Specifies the user executing the operation. Useful for auditing operations executed by 3rd party tools. Defaults to the operating system username.
-v, --v Level number for the log level verbosity
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
1.3. 参数描述
选项 | 默认值 | 描述 |
---|---|---|
-l, --light | false | 如果设置为 true,返回的配置列表时会调整集群状态的验证 |
-o, --output string | table | 输出内容的格式,支持 'json' 和 'table' (默认 "table") |
1.4. 示例
1.4.1. 查看本机器上 minikube 集群的配置文件列表
默认会列出本机器上所有的 Profile 配置文件列表,默认是 table 表格的方式显示,如果想以 json 的方式显示可以通过 --output='json'
指定。
[minikube@localhost ~]$ minikube profile list
|---------|-----------|---------|--------------|------|---------|---------|-------|
| Profile | VM Driver | Runtime | IP | Port | Version | Status | Nodes |
|---------|-----------|---------|--------------|------|---------|---------|-------|
| k8s1 | docker | docker | 192.168.49.2 | 8443 | v1.22.3 | Running | 3 |
| k8s2 | docker | docker | 192.168.58.2 | 8443 | v1.22.3 | Running | 2 |
|---------|-----------|---------|--------------|------|---------|---------|-------|
通过 -p
来指定对应的集群配置文件
[minikube@localhost ~]$ minikube -p k8s2 status
k8s2
type: Control Plane
host: Running
kubelet: Running
apiserver: Running
kubeconfig: Configured
k8s2-m02
type: Worker
host: Running
kubelet: Running
1.4.2. 查看本机器上 minikube 集群的配置文件列表,并跳过集群状态验证
通过 -l
选项会跳过集群状态的验证,如下 Status 字段不在是 Running,而是 Skipped
[minikube@localhost ~]$ minikube profile list -l
|---------|-----------|---------|--------------|------|---------|---------|-------|
| Profile | VM Driver | Runtime | IP | Port | Version | Status | Nodes |
|---------|-----------|---------|--------------|------|---------|---------|-------|
| k8s1 | docker | docker | 192.168.49.2 | 8443 | v1.22.3 | Skipped | 3 |
| k8s2 | docker | docker | 192.168.58.2 | 8443 | v1.22.3 | Skipped | 2 |
|---------|-----------|---------|--------------|------|---------|---------|-------|