@@ -102,7 +102,7 @@ config-gen programatically generates configuration for a controller-runtime base
102
102
project using the project source code (golang) and a KubebuilderConfigGen resource file.
103
103
104
104
This is an alternative to expressing configuration as a static set of kustomize patches
105
- in the "config" directory.
105
+ in the "config" directory.
106
106
107
107
config-gen may be used as a standalone command run against a file, as a kustomize
108
108
transformer plugin, or as a configuration function (e.g. kpt).
@@ -148,55 +148,55 @@ The KubebuilderConfigGen resource has the following fields:
148
148
crds:
149
149
# path to go module source directory provided to controller-gen libraries
150
150
# optional -- defaults to '.'
151
- sourceDirectory: ./relative/path
151
+ sourceDirectory: ./relative/path
152
152
153
- # configure how the controller-manager is generated
153
+ # configure how the controller-manager is generated
154
154
controllerManager:
155
- # image to run
156
- image: my-org/my-project:v0.1.0
155
+ # image to run
156
+ image: my-org/my-project:v0.1.0
157
157
158
- # if set, use component config for the controller-manager
159
- # optional
160
- componentConfig:
161
- # use component config
158
+ # if set, use component config for the controller-manager
159
+ # optional
160
+ componentConfig:
161
+ # use component config
162
162
enable: true
163
163
164
- # path to component config to put into a ConfigMap
165
- configFilepath: ./path/to/componentconfig.yaml
164
+ # path to component config to put into a ConfigMap
165
+ configFilepath: ./path/to/componentconfig.yaml
166
166
167
- # configure how metrics are exposed
168
- metrics:
169
- # disable the auth proxy required for scraping metrics
167
+ # configure how metrics are exposed
168
+ metrics:
169
+ # disable the auth proxy required for scraping metrics
170
170
# disable: false
171
171
172
- # generate prometheus ServiceMonitor resource
173
- enableServiceMonitor: true
172
+ # generate prometheus ServiceMonitor resource
173
+ enableServiceMonitor: true
174
174
175
175
# configure how webhooks are generated
176
- # optional -- defaults to not generating webhook configuration
176
+ # optional -- defaults to not generating webhook configuration
177
177
webhooks:
178
- # enable will cause webhook config to be generated
179
- enable: true
178
+ # enable will cause webhook config to be generated
179
+ enable: true
180
180
181
- # configures crds which use conversion webhooks
181
+ # configures crds which use conversion webhooks
182
182
enableConversion:
183
- # key is the name of the CRD
183
+ # key is the name of the CRD
184
184
"bars.example.my.domain": true
185
185
186
186
# configures where to get the certificate used for webhooks
187
- # discriminated union
188
- certificateSource:
189
- # type of certificate source
190
- # one of ["certManager", "dev", "manual"] -- defaults to "manual"
191
- # certManager: certmanager is used to manage certificates -- requires CertManager to be installed
192
- # dev: certificate is generated and wired into resources
193
- # manual: no certificate is generated or wired into resources
187
+ # discriminated union
188
+ certificateSource:
189
+ # type of certificate source
190
+ # one of ["certManager", "dev", "manual"] -- defaults to "manual"
191
+ # certManager: certmanager is used to manage certificates -- requires CertManager to be installed
192
+ # dev: certificate is generated and wired into resources
193
+ # manual: no certificate is generated or wired into resources
194
194
type: "dev"
195
195
196
- # options for a dev certificate -- requires "dev" as the type
197
- devCertificate:
198
- duration: 1h
199
- ` )
196
+ # options for a dev certificate -- requires "dev" as the type
197
+ devCertificate:
198
+ duration: 1h
199
+ ` )
200
200
c .Example = strings .TrimSpace (`
201
201
#
202
202
# As command
@@ -209,7 +209,7 @@ apiVersion: kubebuilder.sigs.k8s.io/v1alpha1
209
209
name: project
210
210
spec:
211
211
controllerManager
212
- image: org/project:v0.1.0
212
+ image: org/project:v0.1.0
213
213
EOF
214
214
215
215
# run the config generator
250
250
251
251
# generate configuration from kustomize
252
252
kustomize build --enable-alpha-plugins .
253
- ` )
253
+ ` )
254
254
255
255
dir , dirErr := getPluginDir ()
256
256
pluginFile := filepath .Join (dir , "KubebuilderConfigGen" )
@@ -261,10 +261,10 @@ kustomize build --enable-alpha-plugins .
261
261
Short : "Install config-gen as a kustomize plugin" ,
262
262
Long : strings .TrimSpace (fmt .Sprintf (`
263
263
Write a script to %s for kustomize to locate as a plugin.
264
- ` , pluginFile )),
264
+ ` , pluginFile )),
265
265
Example : strings .TrimSpace (`
266
266
kubebuilder alpha config-gen install-as-plugin
267
- ` ),
267
+ ` ),
268
268
RunE : func (cmd * cobra.Command , args []string ) error {
269
269
if dirErr != nil {
270
270
return dirErr
0 commit comments