Skip to content

Commit d1bb063

Browse files
authored
Merge pull request kubernetes-sigs#395 from tengqm/add-kuberc
Update config API generator to include kuberc
2 parents aa3707b + f1482a4 commit d1bb063

File tree

4 files changed

+227
-1
lines changed

4 files changed

+227
-1
lines changed

genref/config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ stripPrefix:
3939
- github.com/tengqm/kubeconfig/config/bootstraptoken/v1.
4040

4141
apis:
42+
- name: kuberc
43+
title: kuberc (v1alpha1)
44+
package: k8s.io/kubectl
45+
path: pkg/config/v1alpha1
46+
4247
- name: kubeconfig
4348
title: kubeconfig (v1)
4449
package: k8s.io/client-go

genref/go.mod

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ module github.com/kubernetes-sigs/reference-docs/genref
33
go 1.24.0
44

55
require (
6+
github.com/tengqm/kubeconfig v0.0.0-20250424004001-34e545f62a22
67
github.com/yuin/goldmark v1.7.8
78
github.com/yuin/goldmark-highlighting v0.0.0-20210516132338-9216f9c5aa01
89
k8s.io/api v0.33.0
@@ -18,6 +19,7 @@ require (
1819
k8s.io/kube-controller-manager v0.33.0
1920
k8s.io/kube-proxy v0.33.0
2021
k8s.io/kube-scheduler v0.33.0
22+
k8s.io/kubectl v0.33.0
2123
k8s.io/kubelet v0.33.0
2224
k8s.io/metrics v0.33.0
2325
sigs.k8s.io/yaml v1.4.0
@@ -45,7 +47,6 @@ require (
4547
github.com/modern-go/reflect2 v1.0.2 // indirect
4648
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
4749
github.com/pkg/errors v0.9.1 // indirect
48-
github.com/tengqm/kubeconfig v0.0.0-20250424004001-34e545f62a22 // indirect
4950
github.com/x448/float16 v0.8.4 // indirect
5051
golang.org/x/net v0.38.0 // indirect
5152
golang.org/x/oauth2 v0.27.0 // indirect

genref/go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,8 @@ k8s.io/kube-proxy v0.33.0 h1:Sayf1JKu5toDhJeDYCNcucSyyqnHdMHU/JcFi5g2008=
205205
k8s.io/kube-proxy v0.33.0/go.mod h1:C0ZiTrHD2A3yL830p4/6bgUD2h5Mh5DfPwgL/JYXS3M=
206206
k8s.io/kube-scheduler v0.33.0 h1:G5psn7ynB5Vjfo0ia8uz32Gv46TRa5RgTq4PTm+yjR0=
207207
k8s.io/kube-scheduler v0.33.0/go.mod h1:I+0aqwJ3G9f9pyfKfoN5b0uP9M6MinNpxXRlCXkM17E=
208+
k8s.io/kubectl v0.33.0 h1:HiRb1yqibBSCqic4pRZP+viiOBAnIdwYDpzUFejs07g=
209+
k8s.io/kubectl v0.33.0/go.mod h1:gAlGBuS1Jq1fYZ9AjGWbI/5Vk3M/VW2DK4g10Fpyn/0=
208210
k8s.io/kubelet v0.33.0 h1:4pJA2Ge6Rp0kDNV76KH7pTBiaV2T1a1874QHMcubuSU=
209211
k8s.io/kubelet v0.33.0/go.mod h1:iDnxbJQMy9DUNaML5L/WUlt3uJtNLWh7ZAe0JSp4Yi0=
210212
k8s.io/metrics v0.33.0 h1:sKe5sC9qb1RakMhs8LWYNuN2ne6OTCWexj8Jos3rO2Y=

genref/output/md/kuberc.v1alpha1.md

Lines changed: 218 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,218 @@
1+
---
2+
title: kuberc (v1alpha1)
3+
content_type: tool-reference
4+
package: kubectl.config.k8s.io/v1alpha1
5+
auto_generated: true
6+
---
7+
8+
9+
## Resource Types
10+
11+
12+
- [Preference](#kubectl-config-k8s-io-v1alpha1-Preference)
13+
14+
15+
## `Preference` {#kubectl-config-k8s-io-v1alpha1-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/v1alpha1</code></td></tr>
27+
<tr><td><code>kind</code><br/>string</td><td><code>Preference</code></td></tr>
28+
29+
30+
<tr><td><code>overrides</code> <B>[Required]</B><br/>
31+
<a href="#kubectl-config-k8s-io-v1alpha1-CommandOverride"><code>[]CommandOverride</code></a>
32+
</td>
33+
<td>
34+
<p>overrides allows changing default flag values of commands.
35+
This is especially useful, when user doesn't want to explicitly
36+
set flags each time.</p>
37+
</td>
38+
</tr>
39+
<tr><td><code>aliases</code> <B>[Required]</B><br/>
40+
<a href="#kubectl-config-k8s-io-v1alpha1-AliasOverride"><code>[]AliasOverride</code></a>
41+
</td>
42+
<td>
43+
<p>aliases allows defining command aliases for existing kubectl commands, with optional default flag values.
44+
If the alias name collides with a built-in command, built-in command always takes precedence.
45+
Flag overrides defined in the overrides section do NOT apply to aliases for the same command.
46+
kubectl [ALIAS NAME] [USER_FLAGS] [USER_EXPLICIT_ARGS] expands to
47+
kubectl [COMMAND] # built-in command alias points to
48+
[KUBERC_PREPEND_ARGS]
49+
[USER_FLAGS]
50+
[KUBERC_FLAGS] # rest of the flags that are not passed by user in [USER_FLAGS]
51+
[USER_EXPLICIT_ARGS]
52+
[KUBERC_APPEND_ARGS]
53+
e.g.</p>
54+
<ul>
55+
<li>name: runx
56+
command: run
57+
flags:
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 &quot;kubectl runx test-pod&quot; command,
67+
this will be expanded to &quot;kubectl run --image=nginx test-pod -- custom-arg1&quot;</li>
68+
</ul>
69+
</li>
70+
<li>name: getn
71+
command: get
72+
flags:
73+
<ul>
74+
<li>name: output
75+
default: wide
76+
prependArgs:</li>
77+
<li>node
78+
&quot;kubectl getn control-plane-1&quot; expands to &quot;kubectl get node control-plane-1 --output=wide&quot;
79+
&quot;kubectl getn control-plane-1 --output=json&quot; expands to &quot;kubectl get node --output=json control-plane-1&quot;</li>
80+
</ul>
81+
</li>
82+
</ul>
83+
</td>
84+
</tr>
85+
</tbody>
86+
</table>
87+
88+
## `AliasOverride` {#kubectl-config-k8s-io-v1alpha1-AliasOverride}
89+
90+
91+
**Appears in:**
92+
93+
- [Preference](#kubectl-config-k8s-io-v1alpha1-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 &quot;set env&quot; or &quot;create&quot;</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>flags</code> <B>[Required]</B><br/>
137+
<a href="#kubectl-config-k8s-io-v1alpha1-CommandOverrideFlag"><code>[]CommandOverrideFlag</code></a>
138+
</td>
139+
<td>
140+
<p>Flag is allocated to store the flag definitions of alias.
141+
Flag only modifies the default value of the flag and if
142+
user explicitly passes a value, explicit one is used.</p>
143+
</td>
144+
</tr>
145+
</tbody>
146+
</table>
147+
148+
## `CommandOverride` {#kubectl-config-k8s-io-v1alpha1-CommandOverride}
149+
150+
151+
**Appears in:**
152+
153+
- [Preference](#kubectl-config-k8s-io-v1alpha1-Preference)
154+
155+
156+
<p>CommandOverride stores the commands and their associated flag'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 flag's default value is changed.</p>
170+
</td>
171+
</tr>
172+
<tr><td><code>flags</code> <B>[Required]</B><br/>
173+
<a href="#kubectl-config-k8s-io-v1alpha1-CommandOverrideFlag"><code>[]CommandOverrideFlag</code></a>
174+
</td>
175+
<td>
176+
<p>Flags is a list of flags storing different default values.</p>
177+
</td>
178+
</tr>
179+
</tbody>
180+
</table>
181+
182+
## `CommandOverrideFlag` {#kubectl-config-k8s-io-v1alpha1-CommandOverrideFlag}
183+
184+
185+
**Appears in:**
186+
187+
- [AliasOverride](#kubectl-config-k8s-io-v1alpha1-AliasOverride)
188+
189+
- [CommandOverride](#kubectl-config-k8s-io-v1alpha1-CommandOverride)
190+
191+
192+
<p>CommandOverrideFlag stores the name and the specified default
193+
value of the flag.</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>Flag 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 flag.</p>
214+
</td>
215+
</tr>
216+
</tbody>
217+
</table>
218+

0 commit comments

Comments
 (0)