|
| 1 | +--- |
| 2 | +title: kuberc (v1beta1) |
| 3 | +content_type: tool-reference |
| 4 | +package: kubectl.config.k8s.io/v1beta1 |
| 5 | +auto_generated: true |
| 6 | +--- |
| 7 | + |
| 8 | + |
| 9 | +## Resource Types |
| 10 | + |
| 11 | + |
| 12 | +- [Preference](#kubectl-config-k8s-io-v1beta1-Preference) |
| 13 | + |
| 14 | + |
| 15 | +## `Preference` {#kubectl-config-k8s-io-v1beta1-Preference} |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | +<p>Preference stores elements of KubeRC configuration file</p> |
| 20 | + |
| 21 | + |
| 22 | +<table class="table"> |
| 23 | +<thead><tr><th width="30%">Field</th><th>Description</th></tr></thead> |
| 24 | +<tbody> |
| 25 | + |
| 26 | +<tr><td><code>apiVersion</code><br/>string</td><td><code>kubectl.config.k8s.io/v1beta1</code></td></tr> |
| 27 | +<tr><td><code>kind</code><br/>string</td><td><code>Preference</code></td></tr> |
| 28 | + |
| 29 | + |
| 30 | +<tr><td><code>defaults</code> <B>[Required]</B><br/> |
| 31 | +<a href="#kubectl-config-k8s-io-v1beta1-CommandDefaults"><code>[]CommandDefaults</code></a> |
| 32 | +</td> |
| 33 | +<td> |
| 34 | + <p>defaults allow changing default option values of commands. |
| 35 | +This is especially useful, when user doesn't want to explicitly |
| 36 | +set options each time.</p> |
| 37 | +</td> |
| 38 | +</tr> |
| 39 | +<tr><td><code>aliases</code> <B>[Required]</B><br/> |
| 40 | +<a href="#kubectl-config-k8s-io-v1beta1-AliasOverride"><code>[]AliasOverride</code></a> |
| 41 | +</td> |
| 42 | +<td> |
| 43 | + <p>aliases allow defining command aliases for existing kubectl commands, with optional default option values. |
| 44 | +If the alias name collides with a built-in command, built-in command always takes precedence. |
| 45 | +Option overrides defined in the defaults section do NOT apply to aliases for the same command. |
| 46 | +kubectl [ALIAS NAME] [USER_OPTIONS] [USER_EXPLICIT_ARGS] expands to |
| 47 | +kubectl [COMMAND] # built-in command alias points to |
| 48 | +[KUBERC_PREPEND_ARGS] |
| 49 | +[USER_OPTIONS] |
| 50 | +[KUBERC_OPTIONS] # rest of the options that are not passed by user in [USER_OPTIONS] |
| 51 | +[USER_EXPLICIT_ARGS] |
| 52 | +[KUBERC_APPEND_ARGS] |
| 53 | +e.g.</p> |
| 54 | +<ul> |
| 55 | +<li>name: runx |
| 56 | +command: run |
| 57 | +options: |
| 58 | +<ul> |
| 59 | +<li>name: image |
| 60 | +default: nginx |
| 61 | +appendArgs:</li> |
| 62 | +</ul> |
| 63 | +<hr> |
| 64 | +<ul> |
| 65 | +<li>custom-arg1 |
| 66 | +For example, if user invokes "kubectl runx test-pod" command, |
| 67 | +this will be expanded to "kubectl run --image=nginx test-pod -- custom-arg1"</li> |
| 68 | +</ul> |
| 69 | +</li> |
| 70 | +<li>name: getn |
| 71 | +command: get |
| 72 | +options: |
| 73 | +<ul> |
| 74 | +<li>name: output |
| 75 | +default: wide |
| 76 | +prependArgs:</li> |
| 77 | +<li>node |
| 78 | +"kubectl getn control-plane-1" expands to "kubectl get node control-plane-1 --output=wide" |
| 79 | +"kubectl getn control-plane-1 --output=json" expands to "kubectl get node --output=json control-plane-1"</li> |
| 80 | +</ul> |
| 81 | +</li> |
| 82 | +</ul> |
| 83 | +</td> |
| 84 | +</tr> |
| 85 | +</tbody> |
| 86 | +</table> |
| 87 | + |
| 88 | +## `AliasOverride` {#kubectl-config-k8s-io-v1beta1-AliasOverride} |
| 89 | + |
| 90 | + |
| 91 | +**Appears in:** |
| 92 | + |
| 93 | +- [Preference](#kubectl-config-k8s-io-v1beta1-Preference) |
| 94 | + |
| 95 | + |
| 96 | +<p>AliasOverride stores the alias definitions.</p> |
| 97 | + |
| 98 | + |
| 99 | +<table class="table"> |
| 100 | +<thead><tr><th width="30%">Field</th><th>Description</th></tr></thead> |
| 101 | +<tbody> |
| 102 | + |
| 103 | + |
| 104 | +<tr><td><code>name</code> <B>[Required]</B><br/> |
| 105 | +<code>string</code> |
| 106 | +</td> |
| 107 | +<td> |
| 108 | + <p>name is the name of alias that can only include alphabetical characters |
| 109 | +If the alias name conflicts with the built-in command, |
| 110 | +built-in command will be used.</p> |
| 111 | +</td> |
| 112 | +</tr> |
| 113 | +<tr><td><code>command</code> <B>[Required]</B><br/> |
| 114 | +<code>string</code> |
| 115 | +</td> |
| 116 | +<td> |
| 117 | + <p>command is the single or set of commands to execute, such as "set env" or "create"</p> |
| 118 | +</td> |
| 119 | +</tr> |
| 120 | +<tr><td><code>prependArgs</code> <B>[Required]</B><br/> |
| 121 | +<code>[]string</code> |
| 122 | +</td> |
| 123 | +<td> |
| 124 | + <p>prependArgs stores the arguments such as resource names, etc. |
| 125 | +These arguments are inserted after the alias name.</p> |
| 126 | +</td> |
| 127 | +</tr> |
| 128 | +<tr><td><code>appendArgs</code> <B>[Required]</B><br/> |
| 129 | +<code>[]string</code> |
| 130 | +</td> |
| 131 | +<td> |
| 132 | + <p>appendArgs stores the arguments such as resource names, etc. |
| 133 | +These arguments are appended to the USER_ARGS.</p> |
| 134 | +</td> |
| 135 | +</tr> |
| 136 | +<tr><td><code>options</code> <B>[Required]</B><br/> |
| 137 | +<a href="#kubectl-config-k8s-io-v1beta1-CommandOptionDefault"><code>[]CommandOptionDefault</code></a> |
| 138 | +</td> |
| 139 | +<td> |
| 140 | + <p>options is allocated to store the option definitions of alias. |
| 141 | +options only modify the default value of the option and if |
| 142 | +user explicitly passes a value, explicit one is used.</p> |
| 143 | +</td> |
| 144 | +</tr> |
| 145 | +</tbody> |
| 146 | +</table> |
| 147 | + |
| 148 | +## `CommandDefaults` {#kubectl-config-k8s-io-v1beta1-CommandDefaults} |
| 149 | + |
| 150 | + |
| 151 | +**Appears in:** |
| 152 | + |
| 153 | +- [Preference](#kubectl-config-k8s-io-v1beta1-Preference) |
| 154 | + |
| 155 | + |
| 156 | +<p>CommandDefaults stores the commands and their associated option's |
| 157 | +default values.</p> |
| 158 | + |
| 159 | + |
| 160 | +<table class="table"> |
| 161 | +<thead><tr><th width="30%">Field</th><th>Description</th></tr></thead> |
| 162 | +<tbody> |
| 163 | + |
| 164 | + |
| 165 | +<tr><td><code>command</code> <B>[Required]</B><br/> |
| 166 | +<code>string</code> |
| 167 | +</td> |
| 168 | +<td> |
| 169 | + <p>command refers to a command whose option's default value is changed.</p> |
| 170 | +</td> |
| 171 | +</tr> |
| 172 | +<tr><td><code>options</code> <B>[Required]</B><br/> |
| 173 | +<a href="#kubectl-config-k8s-io-v1beta1-CommandOptionDefault"><code>[]CommandOptionDefault</code></a> |
| 174 | +</td> |
| 175 | +<td> |
| 176 | + <p>options is a list of options storing different default values.</p> |
| 177 | +</td> |
| 178 | +</tr> |
| 179 | +</tbody> |
| 180 | +</table> |
| 181 | + |
| 182 | +## `CommandOptionDefault` {#kubectl-config-k8s-io-v1beta1-CommandOptionDefault} |
| 183 | + |
| 184 | + |
| 185 | +**Appears in:** |
| 186 | + |
| 187 | +- [AliasOverride](#kubectl-config-k8s-io-v1beta1-AliasOverride) |
| 188 | + |
| 189 | +- [CommandDefaults](#kubectl-config-k8s-io-v1beta1-CommandDefaults) |
| 190 | + |
| 191 | + |
| 192 | +<p>CommandOptionDefault stores the name and the specified default |
| 193 | +value of an option.</p> |
| 194 | + |
| 195 | + |
| 196 | +<table class="table"> |
| 197 | +<thead><tr><th width="30%">Field</th><th>Description</th></tr></thead> |
| 198 | +<tbody> |
| 199 | + |
| 200 | + |
| 201 | +<tr><td><code>name</code> <B>[Required]</B><br/> |
| 202 | +<code>string</code> |
| 203 | +</td> |
| 204 | +<td> |
| 205 | + <p>Option name (long form, without dashes).</p> |
| 206 | +</td> |
| 207 | +</tr> |
| 208 | +<tr><td><code>default</code> <B>[Required]</B><br/> |
| 209 | +<code>string</code> |
| 210 | +</td> |
| 211 | +<td> |
| 212 | + <p>In a string format of a default value. It will be parsed |
| 213 | +by kubectl to the compatible value of the option.</p> |
| 214 | +</td> |
| 215 | +</tr> |
| 216 | +</tbody> |
| 217 | +</table> |
| 218 | + |
0 commit comments