-
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy path_minikube
198 lines (189 loc) · 9.04 KB
/
_minikube
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
#compdef minikube
# -----------------------------------------------------------------------------
# The BSD-3-Clause License
#
# Copyright (c) 2017, Koichi Shiraishi
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# * Neither the name of que nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
# -----------------------------------------------------------------------------
#
# k8s.io/minikube/cmd/minikube
#
# Minikube is a CLI tool that provisions and manages single-node Kubernetes clusters optimized for development workflows.
#
# Usage:
# minikube [command]
#
# Available Commands:
# addons Modify minikube's kubernetes addons
# cache Add or delete an image from the local cache.
# completion Outputs minikube shell completion for the given shell (bash or zsh)
# config Modify minikube config
# dashboard Opens/displays the kubernetes dashboard URL for your local cluster
# delete Deletes a local kubernetes cluster
# docker-env Sets up docker env variables; similar to '$(docker-machine env)'
# get-k8s-versions Gets the list of Kubernetes versions available for minikube when using the localkube bootstrapper
# ip Retrieves the IP address of the running cluster
# logs Gets the logs of the running localkube instance, used for debugging minikube, not user code
# mount Mounts the specified directory into minikube
# profile Profile sets the current minikube profile
# service Gets the kubernetes URL(s) for the specified service in your local cluster
# ssh Log into or run a command on a machine with SSH; similar to 'docker-machine ssh'
# ssh-key Retrieve the ssh identity key path of the specified cluster
# start Starts a local kubernetes cluster
# status Gets the status of a local kubernetes cluster
# stop Stops a running local kubernetes cluster
# update-check Print current and latest version number
# update-context Verify the IP address of the running cluster in kubeconfig.
# version Print the version of minikube
#
# Flags:
# --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 "localkube")
# --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
# --loglevel int Log level (0 = DEBUG, 5 = FATAL) (default 1)
# --logtostderr log to standard error instead of files
# -p, --profile string The name of the minikube VM being used.
# This can be modified to allow for multiple minikube instances to be run independently (default "minikube")
# --stderrthreshold severity logs at or above this threshold go to stderr (default 2)
# -v, --v Level log level for V logs
# --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
#
# Use "minikube [command] --help" for more information about a command.
#
# -----------------------------------------------------------------------------
typeset -A opt_args
_minikube() {
local -a commands
commands=(
'dashboard:Opens/displays the kubernetes dashboard URL for your local cluster'
'delete:Deletes a local kubernetes cluster'
"docker-env:sets up docker env variables; similar to '\$(docker-machine env)'"
'get-k8s-versions:Gets the list of available kubernetes versions available for minikube'
'ip:Retrieve the IP address of the running cluster'
'logs:Gets the logs of the running localkube instance, used for debugging minikube, not user code'
'service:Gets the kubernetes URL for the specified service in your local cluster'
"ssh:Log into or run a command on a machine with SSH; similar to 'docker-machine ssh'"
'start:Starts a local kubernetes cluster'
'status:Gets the status of a local kubernetes cluster'
'stop:Stops a running local kubernetes cluster'
'version:Print the version of minikube'
'help:more information about a command'
)
# TODO(zchee): display global_flags
_arguments \
"1: :{_describe 'minikube command' commands}" \
'*:: :->args'
case $state in
args)
global_flags() {
_values \
'global flags' \
'--alsologtostderr[log to standard error as well as files]' \
'--log-flush-frequency[Maximum number of seconds between log flushes]:frequency time (default\: 5s)' \
'--log_backtrace_at[when logging hits line file:N, emit a stack trace]:log backtrace (default\: 0)' \
'--log_dir[If non-empty, write log files in this directory]:log directory:_files' \
'--logtostderr[log to standard error instead of files]' \
'--show-libmachine-logs[Whether or not to show logs from libmachine]' \
'--stderrthreshold[logs at or above this threshold go to stderr:stderr threshold (default\: 2)]' \
'--v[log level for V logs]:Log level' \
'--vmodule[comma-separated list of pattern=N settings for file-filtered logging]'
}
case $words[1] in
dashboard)
_arguments \
'--url[Display the kubernetes dashboard in the CLI instead of opening it in the default browser]' \
'*: :global_flags'
;;
docker-env)
_arguments \
'--no-proxy[Add machine IP to NO_PROXY environment variable]' \
'--shell=[Force environment to be configured for a specified shell, default is auto-detect]:shell:(fish cmd powershell tcsh bash zsh)' \
{-u,--unset}'[Unset variables instead of setting them]' \
'*: :global_flags'
;;
delete)
_arguments \
'*: :global_flags'
;;
get-k8s-versions)
_arguments \
'*: :global_flags'
;;
ip)
_arguments \
'*: :global_flags'
;;
logs)
_arguments \
'*: :global_flags'
;;
service)
_arguments \
{-n,--namespace}='[The service namespace]:service namespace' \
'--url=[Display the kubernetes service URL in the CLI instead of opening it in the default browser]:url' \
'*: :global_flags'
;;
ssh)
_arguments \
'*: :global_flags'
;;
start)
_arguments \
'--cpus=[Number of CPUs allocated to the minikube VM]:CPU size (default\: 1)' \
'--disk-size=[Disk size allocated to the minikube VM]:Disk size (default\: 20g)' \
'--docker-env=[Environment variables to pass to the Docker daemon]:format(key=value)' \
'--insecure-registry=[Insecure Docker registries to pass to the Docker daemon]' \
'--iso-url=[Location of the minikube iso]:ISO url' \
'--kubernetes-version=[The kubernetes version that the minikube VM will]:kubernetes version' \
'--memory=[Amount of RAM allocated to the minikube VM]:memory size (default\: 1024)' \
'--vm-driver=[VM driver]:vm driver (default\: virtualbox):(virtualbox xhyve vmwarefusion)' \
'*: :global_flags'
;;
status)
_arguments \
'*: :global_flags'
;;
stop)
_arguments \
'*: :global_flags'
;;
version)
_arguments \
'*: :global_flags'
;;
help)
_arguments "1: :{_describe 'command' commands -- topics}"
;;
esac
;;
esac
}
_minikube "$*"
# vim:ft=zsh:et:sts=2:sw=2