Skip to content

Commit

Permalink
Merge pull request #7586 from govargo/feature/add-status-node-section
Browse files Browse the repository at this point in the history
Add master node/worker node type to `minikube status`
  • Loading branch information
sharifelgamal authored Apr 15, 2020
2 parents dc834c3 + 9036230 commit 1554d8e
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 6 deletions.
2 changes: 2 additions & 0 deletions cmd/minikube/cmd/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,15 @@ const (
clusterNotRunningStatusFlag = 1 << 1
k8sNotRunningStatusFlag = 1 << 2
defaultStatusFormat = `{{.Name}}
type: Control Plane
host: {{.Host}}
kubelet: {{.Kubelet}}
apiserver: {{.APIServer}}
kubeconfig: {{.Kubeconfig}}
`
workerStatusFormat = `{{.Name}}
type: Worker
host: {{.Host}}
kubelet: {{.Kubelet}}
Expand Down
6 changes: 3 additions & 3 deletions cmd/minikube/cmd/status_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,17 @@ func TestStatusText(t *testing.T) {
{
name: "ok",
state: &Status{Name: "minikube", Host: "Running", Kubelet: "Running", APIServer: "Running", Kubeconfig: Configured},
want: "minikube\nhost: Running\nkubelet: Running\napiserver: Running\nkubeconfig: Configured\n\n",
want: "minikube\ntype: Control Plane\nhost: Running\nkubelet: Running\napiserver: Running\nkubeconfig: Configured\n\n",
},
{
name: "paused",
state: &Status{Name: "minikube", Host: "Running", Kubelet: "Stopped", APIServer: "Paused", Kubeconfig: Configured},
want: "minikube\nhost: Running\nkubelet: Stopped\napiserver: Paused\nkubeconfig: Configured\n\n",
want: "minikube\ntype: Control Plane\nhost: Running\nkubelet: Stopped\napiserver: Paused\nkubeconfig: Configured\n\n",
},
{
name: "down",
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",
want: "minikube\ntype: Control Plane\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 {
Expand Down
2 changes: 1 addition & 1 deletion site/content/en/docs/commands/status.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ minikube status [flags]

```
-f, --format string Go template format string for the status output. The format for Go templates can be found here: https://golang.org/pkg/text/template/
For the list accessible variables for the template, see the struct values here: https://godoc.org/k8s.io/minikube/cmd/minikube/cmd#Status (default "{{.Name}}\nhost: {{.Host}}\nkubelet: {{.Kubelet}}\napiserver: {{.APIServer}}\nkubeconfig: {{.Kubeconfig}}\n\n")
For the list accessible variables for the template, see the struct values here: https://godoc.org/k8s.io/minikube/cmd/minikube/cmd#Status (default "{{.Name}}\ntype: Control Plane\nhost: {{.Host}}\nkubelet: {{.Kubelet}}\napiserver: {{.APIServer}}\nkubeconfig: {{.Kubeconfig}}\n\n")
-h, --help help for status
-o, --output string minikube status --output OUTPUT. json, text (default "text")
```
Expand Down
21 changes: 19 additions & 2 deletions site/content/en/docs/tutorials/multi_node.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ date: 2019-11-24
minikube start --nodes 2 -p multinode-demo --network-plugin=cni --extra-config=kubeadm.pod-network-cidr=10.244.0.0/16
πŸ˜„ [multinode-demo] minikube v1.9.2 on Darwin 10.14.6
✨ Automatically selected the hyperkit driver
πŸ‘ Starting control plane node m01 in cluster multinode-demo
πŸ‘ Starting control plane node multinode-demo in cluster multinode-demo
πŸ”₯ Creating hyperkit VM (CPUs=2, Memory=4000MB, Disk=20000MB) ...
🐳 Preparing Kubernetes v1.18.0 on Docker 19.03.8 ...
β–ͺ kubeadm.pod-network-cidr=10.244.0.0/16
🌟 Enabling addons: default-storageclass, storage-provisioner
πŸ‘ Starting node m02 in cluster multinode-demo
πŸ‘ Starting node multinode-demo-m02 in cluster multinode-demo
πŸ”₯ Creating hyperkit VM (CPUs=2, Memory=4000MB, Disk=20000MB) ...
🌐 Found network options:
β–ͺ NO_PROXY=192.168.64.213
Expand All @@ -42,6 +43,22 @@ multinode-demo Ready master 9m58s v1.18.0
multinode-demo-m02 Ready <none> 9m5s v1.18.0
```

NOTE: You can also check the status of your nodes:
```
$ minikube status
multinode-demo
type: Control Plane
host: Running
kubelet: Running
apiserver: Running
kubeconfig: Configured
multinode-demo-m02
type: Worker
host: Running
kubelet: Running
```

- Install a CNI (e.g. flannel):
NOTE: This currently needs to be done manually after the apiserver is running, the multi-node feature is still experimental as of 1.9.2.
```
Expand Down

0 comments on commit 1554d8e

Please sign in to comment.