Docs: Auto-fix markdownlint issues

This commit is contained in:
Prachi Pendse
2020-07-16 12:57:18 -07:00
parent 0b359d0ef0
commit f9ee578aed
76 changed files with 308 additions and 304 deletions

View File

@@ -33,5 +33,4 @@ We do a [Pull Request](https://github.com/kubernetes-sigs/kustomize/pulls) contr
New users are always welcome! New users are always welcome!
{{% /blocks/feature %}} {{% /blocks/feature %}}
{{< /blocks/section >}} {{< /blocks/section >}}

View File

@@ -8,6 +8,7 @@ description: >
--- ---
# Glossary # Glossary
[CRD spec]: https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ [CRD spec]: https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
[CRD]: #custom-resource-definition [CRD]: #custom-resource-definition
[DAM]: #declarative-application-management [DAM]: #declarative-application-management
@@ -67,7 +68,6 @@ dashboards.
[kustomize] configures k8s resources, and the proposed [kustomize] configures k8s resources, and the proposed
application resource is just another resource. application resource is just another resource.
## apply ## apply
The verb _apply_ in the context of k8s refers to a The verb _apply_ in the context of k8s refers to a
@@ -100,7 +100,6 @@ dedicated to that purpose_. Same with [overlays].
Changes in a repo could generate a build, test and Changes in a repo could generate a build, test and
deploy cycle. deploy cycle.
## bespoke configuration ## bespoke configuration
A _bespoke_ configuration is a [kustomization] and some A _bespoke_ configuration is a [kustomization] and some
@@ -152,7 +151,6 @@ In brief, kustomize should
A generator makes resources that can be used as is, A generator makes resources that can be used as is,
or fed into a [transformer]. or fed into a [transformer].
## gitops ## gitops
Devops or CICD workflows that use a git repository as a Devops or CICD workflows that use a git repository as a
@@ -195,7 +193,6 @@ falling into four categories:
the above. Example fields: _vars_, _namespace_, the above. Example fields: _vars_, _namespace_,
_apiVersion_, _kind_, etc. _apiVersion_, _kind_, etc.
## kustomization root ## kustomization root
The directory that immediately contains a The directory that immediately contains a
@@ -234,7 +231,6 @@ Conventionally, __B__ is in a directory that's sibling
to __A__, or __B__ is off in a completely independent to __A__, or __B__ is off in a completely independent
git repository, referencable from any kustomization. git repository, referencable from any kustomization.
A common layout is A common layout is
> ``` > ```
@@ -291,7 +287,6 @@ resource patching.
kustomize is an implementation of [DAM]. kustomize is an implementation of [DAM].
## off-the-shelf configuration ## off-the-shelf configuration
An _off-the-shelf_ configuration is a kustomization and An _off-the-shelf_ configuration is a kustomization and

View File

@@ -14,4 +14,3 @@ Move entries into the [resources](/kustomize/api-reference/kustomization/resourc
field. This allows bases - which are still a field. This allows bases - which are still a
[central concept](/kustomize/api-reference/kustomization/glossary#base) - to be [central concept](/kustomize/api-reference/kustomization/glossary#base) - to be
ordered relative to other input resources. ordered relative to other input resources.

View File

@@ -55,4 +55,3 @@ metadata:
spec: spec:
... ...
``` ```

View File

@@ -10,6 +10,7 @@ Each entry in this list results in the creation of
one ConfigMap resource (it's a generator of n maps). one ConfigMap resource (it's a generator of n maps).
The example below creates four ConfigMaps: The example below creates four ConfigMaps:
- first, with the names and contents of the given files - first, with the names and contents of the given files
- second, with key/value as data using key/value pairs from files - second, with key/value as data using key/value pairs from files
- third, also with key/value as data, directly specified using `literals` - third, also with key/value as data, directly specified using `literals`

View File

@@ -22,6 +22,7 @@ with namePrefix, nameSuffix, or hashing in the
same way. same way.
The annotations can be put into openAPI definitions are: The annotations can be put into openAPI definitions are:
- "x-kubernetes-annotation": "" - "x-kubernetes-annotation": ""
- "x-kubernetes-label-selector": "" - "x-kubernetes-label-selector": ""
- "x-kubernetes-identity": "" - "x-kubernetes-identity": ""

View File

@@ -32,6 +32,7 @@ patchesStrategicMerge:
``` ```
The patch content can be a inline string as well. The patch content can be a inline string as well.
```yaml ```yaml
apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization

View File

@@ -8,7 +8,7 @@ description: >
Each entry in this list should resolve to a kubernetes object and a JSON patch that will be applied Each entry in this list should resolve to a kubernetes object and a JSON patch that will be applied
to the object. to the object.
The JSON patch is documented at https://tools.ietf.org/html/rfc6902 The JSON patch is documented at <https://tools.ietf.org/html/rfc6902>
target field points to a kubernetes object within the same kustomization target field points to a kubernetes object within the same kustomization
by the object's group, version, kind, name and namespace. by the object's group, version, kind, name and namespace.

View File

@@ -35,6 +35,7 @@ be modified at the same time.
As this declaration does not take in a `kind:` nor a `group:` As this declaration does not take in a `kind:` nor a `group:`
it will match any `group` and `kind` that has a matching name and it will match any `group` and `kind` that has a matching name and
that is one of: that is one of:
- `Deployment` - `Deployment`
- `ReplicationController` - `ReplicationController`
- `ReplicaSet` - `ReplicaSet`

View File

@@ -81,5 +81,3 @@ job. E.g., a Deployment may reference a ConfigMap
by name, and if kustomize changes the name of a by name, and if kustomize changes the name of a
ConfigMap, it knows to change the name reference ConfigMap, it knows to change the name reference
in the Deployment. in the Deployment.

View File

@@ -164,7 +164,6 @@ orphaned cluster resources.
For more information see the For more information see the
[kustomize inventory object documentation]. [kustomize inventory object documentation].
## Field changes / deprecations ## Field changes / deprecations
### `resources` expanded, `bases` deprecated ### `resources` expanded, `bases` deprecated

View File

@@ -17,7 +17,7 @@ floor on a stable API for [plugin] developers
(both _Go_ plugin developers and _exec_ plugin (both _Go_ plugin developers and _exec_ plugin
developers who happen to use Go). developers who happen to use Go).
### Why so soon after v2.1.0? ### Why so soon after v2.1.0
[semantic versioning]: https://semver.org [semantic versioning]: https://semver.org
[Go modules doc]: https://github.com/golang/go/wiki/Modules#releasing-modules-v2-or-higher [Go modules doc]: https://github.com/golang/go/wiki/Modules#releasing-modules-v2-or-higher
@@ -70,6 +70,3 @@ Aside - the set of kustomize packages outside
by package use, this API surface must shrink. by package use, this API surface must shrink.
Such shrinkage will trigger a major version Such shrinkage will trigger a major version
increment. increment.

View File

@@ -7,6 +7,7 @@ description: >
--- ---
## Extended patches ## Extended patches
Since this version, Kustomize allows applying one patch to multiple resources. This works for both Strategic Merge Patch and JSON Patch. Take a look at [patch multiple objects](https://github.com/kubernetes-sigs/kustomize/tree/master/examples/patchMultipleObjects.md). Since this version, Kustomize allows applying one patch to multiple resources. This works for both Strategic Merge Patch and JSON Patch. Take a look at [patch multiple objects](https://github.com/kubernetes-sigs/kustomize/tree/master/examples/patchMultipleObjects.md).
## Improved Resource Matching ## Improved Resource Matching
@@ -52,7 +53,6 @@ spec:
value: PRODVALUE value: PRODVALUE
``` ```
### Variable resolution improvement ### Variable resolution improvement
It is possible to add namespace field to the variable declaration. In the following example, It is possible to add namespace field to the variable declaration. In the following example,
@@ -88,6 +88,7 @@ vars:
Kustomize is now able to deal with simultaneous changes of name and namespace. Kustomize is now able to deal with simultaneous changes of name and namespace.
Special attention has been paid the handling of: Special attention has been paid the handling of:
- ClusterRoleBinding/RoleBinding "subjects" field, - ClusterRoleBinding/RoleBinding "subjects" field,
- ValidatingWebhookConfiguration "webhooks" field. - ValidatingWebhookConfiguration "webhooks" field.
@@ -106,7 +107,7 @@ resources:
... ...
``` ```
### Resource and Kustomize Context matching. ### Resource and Kustomize Context matching
Kustomize is now able to support more aggregation patterns. Kustomize is now able to support more aggregation patterns.

View File

@@ -7,6 +7,7 @@ description: >
--- ---
## Inline Patch ## Inline Patch
Since this version, Kustomize allows inline patches in all three of `patchesStrategicMerge`, `patchesJson6902` and `patches`. Take a look at [inline patch](https://github.com/kubernetes-sigs/kustomize/tree/master/examples/examples/inlinePatch.md). Since this version, Kustomize allows inline patches in all three of `patchesStrategicMerge`, `patchesJson6902` and `patches`. Take a look at [inline patch](https://github.com/kubernetes-sigs/kustomize/tree/master/examples/examples/inlinePatch.md).
## New Subcommand ## New Subcommand
@@ -14,11 +15,13 @@ Since this version, Kustomize allows inline patches in all three of `patchesStra
Since this version, one can create a kustomization.yaml file in a directory through a `create` subcommand. Since this version, one can create a kustomization.yaml file in a directory through a `create` subcommand.
Create a new overlay from the base ../base Create a new overlay from the base ../base
``` ```
kustomize create --resources ../base kustomize create --resources ../base
``` ```
Create a new kustomization detecing resources in the current directory Create a new kustomization detecing resources in the current directory
``` ```
kustomize create --autodetect kustomize create --autodetect
``` ```
@@ -30,5 +33,5 @@ kustomize create --autodetect --recursive
``` ```
### New Example Generator ### New Example Generator
A new example generator of using go-getter to download resources is added. Take a look at [go-getter generator](https://github.com/kubernetes-sigs/kustomize/tree/master/examples/goGetterGeneratorPlugin.md).
A new example generator of using go-getter to download resources is added. Take a look at [go-getter generator](https://github.com/kubernetes-sigs/kustomize/tree/master/examples/goGetterGeneratorPlugin.md).

View File

@@ -12,7 +12,7 @@ description: >
## Summary of changes ## Summary of changes
### First release of the Go API-only module. ### First release of the Go API-only module
Many of the PRs since the last vrelease were Many of the PRs since the last vrelease were
around restructuring the _sigs.k8s.io/kustomize_ around restructuring the _sigs.k8s.io/kustomize_
@@ -43,7 +43,6 @@ any other client.
The new semver-able API will begin with `v4.0.0` (not The new semver-able API will begin with `v4.0.0` (not
yet released) and be a clean break with `v3` etc. yet released) and be a clean break with `v3` etc.
### Change log since v3.2.0 ### Change log since v3.2.0
``` ```

View File

@@ -21,5 +21,3 @@ If you are interested in contributing towards Kustomize or getting more involved
- join the [mailing list] and reach out - join the [mailing list] and reach out
- join the [slack channel] and reach out - join the [slack channel] and reach out
- attend one of the [bi-weekly meetings] (alternating Wednesdays at 9:00am Pacific Time) - attend one of the [bi-weekly meetings] (alternating Wednesdays at 9:00am Pacific Time)

View File

@@ -79,4 +79,3 @@ Changes must be pushed to the fork's **master branch** to be served as the fork'
4. Commit and push the changes to the *remote fork's* **master branch** 4. Commit and push the changes to the *remote fork's* **master branch**
5. After a few minutes, the docs should be served from the fork's GitHub Page 5. After a few minutes, the docs should be served from the fork's GitHub Page
- e.g. [https://pwittrock.github.io/kustomize/](https://pwittrock.github.io/kustomize/) - e.g. [https://pwittrock.github.io/kustomize/](https://pwittrock.github.io/kustomize/)

View File

@@ -15,7 +15,6 @@ description: >
[eschewed feature list]: https://kubernetes-sigs.github.io/kustomize/faq/eschewedfeatures/ [eschewed feature list]: https://kubernetes-sigs.github.io/kustomize/faq/eschewedfeatures/
[kind/feature]: https://github.com/kubernetes-sigs/kustomize/labels/kind%2Ffeature [kind/feature]: https://github.com/kubernetes-sigs/kustomize/labels/kind%2Ffeature
Following is the process for proposing a new Kustomize feature: Following is the process for proposing a new Kustomize feature:
1. Check the [eschewed feature list] to see if the feature has already been proposed 1. Check the [eschewed feature list] to see if the feature has already been proposed

View File

@@ -9,7 +9,8 @@ description: >
This is the PowerShell script to run all go tests for Kustomize on a windows based platform which mimics /build/pre-commit.sh This is the PowerShell script to run all go tests for Kustomize on a windows based platform which mimics /build/pre-commit.sh
## Pre-Reqs: ## Pre-Reqs
- PowerShell installed - PowerShell installed
- PowerShell Core is supported - PowerShell Core is supported
- go installed - go installed
@@ -18,20 +19,23 @@ This is the PowerShell script to run all go tests for Kustomize on a windows bas
This script should output to the current console and return an exit code if all tests are successful(0) or any failed(1). This script should output to the current console and return an exit code if all tests are successful(0) or any failed(1).
### If you are tryin to run these tests locally you can follow these instructions. ### If you are tryin to run these tests locally you can follow these instructions
Assume: Assume:
- Running a stock Windows 10 system - Running a stock Windows 10 system
- Local Admin rights. - Local Admin rights.
- You can open [PowerShell as administrator](http://lmgtfy.com/?iie=1&q=How+to+open+powershell+as+administrator) - You can open [PowerShell as administrator](http://lmgtfy.com/?iie=1&q=How+to+open+powershell+as+administrator)
- You should be knowledgeable enough to pull source for packages into your GO ```src``` directory - You should be knowledgeable enough to pull source for packages into your GO ```src``` directory
- Yes, this means you also need to know a bit about **git** usually - Yes, this means you also need to know a bit about **git** usually
#### Step 1 - Install Go #### Step 1 - Install Go
- [Install Go](https://golang.org/dl/) - please use the msi - [Install Go](https://golang.org/dl/) - please use the msi
- If you use chocolatey - it's using the zip not msi and assumptions on where go is located are made for you. - If you use chocolatey - it's using the zip not msi and assumptions on where go is located are made for you.
#### Step 2 - Install Go Packages #### Step 2 - Install Go Packages
- Open new PowerShell Administrative window - Open new PowerShell Administrative window
- Install golangci-lint - Install golangci-lint
- ```go get -u github.com/golangci/golangci-lint/cmd/golangci-lint``` - ```go get -u github.com/golangci/golangci-lint/cmd/golangci-lint```
@@ -51,6 +55,7 @@ Usage: C:\_go\bin\mdrip.exe {fileName}...
``` ```
#### Step 3 - Get Source and Test #### Step 3 - Get Source and Test
- In your GoRoot src - In your GoRoot src
- ```Example: C:\_go\src``` - ```Example: C:\_go\src```
- Navigate to the Kustomize `travis` directory - Navigate to the Kustomize `travis` directory

View File

@@ -132,7 +132,6 @@ kustomize edit set image nginx:$MY_NGINX_VERSION
as part of some encapsulating work flow executed before as part of some encapsulating work flow executed before
`kustomize build`. `kustomize build`.
## Globs in kustomization files ## Globs in kustomization files
`kustomize` supports the best practice of storing one's `kustomize` supports the best practice of storing one's

View File

@@ -118,10 +118,8 @@ itself is an API client requiring this module.
The clients and API will evolve independently. The clients and API will evolve independently.
## Kustomization File Versioning ## Kustomization File Versioning
The kustomization file is a struct that is part of The kustomization file is a struct that is part of
the kustomize Go API (the `sigs.k8s.io/kustomize` the kustomize Go API (the `sigs.k8s.io/kustomize`
module), but it also evolves as a k8s API object - module), but it also evolves as a k8s API object -

View File

@@ -57,6 +57,7 @@ Run kustomize, and pipe the output to [apply].
> ``` > ```
You can also use [kubectl-v1.14.0] to apply your [variants]. You can also use [kubectl-v1.14.0] to apply your [variants].
>
> ``` > ```
> kubectl apply -k ~/ldap/overlays/staging > kubectl apply -k ~/ldap/overlays/staging
> kubectl apply -k ~/ldap/overlays/production > kubectl apply -k ~/ldap/overlays/production
@@ -78,4 +79,3 @@ You can also use [kubectl-v1.14.0] to apply your [variants].
[workflowBespoke]: /kustomize/images/workflowBespoke.jpg [workflowBespoke]: /kustomize/images/workflowBespoke.jpg
[workflowOts]: /kustomize/images/workflowOts.jpg [workflowOts]: /kustomize/images/workflowOts.jpg
[kubectl-v1.14.0]:https://kubernetes.io/blog/2019/03/25/kubernetes-1-14-release-announcement/ [kubectl-v1.14.0]:https://kubernetes.io/blog/2019/03/25/kubernetes-1-14-release-announcement/

View File

@@ -10,7 +10,6 @@ description: >
In this workflow, all files are owned by the user and maintained in a repository under their control, but In this workflow, all files are owned by the user and maintained in a repository under their control, but
they are based on an [off-the-shelf] configuration that is periodically consulted for updates. they are based on an [off-the-shelf] configuration that is periodically consulted for updates.
![off-the-shelf config workflow image][workflowOts] ![off-the-shelf config workflow image][workflowOts]
#### 1) find and [fork] an [OTS] config #### 1) find and [fork] an [OTS] config
@@ -49,6 +48,7 @@ distinct repository.
> ``` > ```
You can also use [kubectl-v1.14.0] to apply your [variants]. You can also use [kubectl-v1.14.0] to apply your [variants].
>
> ``` > ```
> kubectl apply -k ~/ldap/overlays/staging > kubectl apply -k ~/ldap/overlays/staging
> kubectl apply -k ~/ldap/overlays/production > kubectl apply -k ~/ldap/overlays/production

View File

@@ -63,7 +63,6 @@ in-process kustomization run. Each of the
resulting objects is now further interpreted by resulting objects is now further interpreted by
kustomize as a _plugin configuration_ object. kustomize as a _plugin configuration_ object.
## Configuration ## Configuration
A kustomization file could have the following lines: A kustomization file could have the following lines:
@@ -112,7 +111,6 @@ browse the unit tests below the [plugins] root,
e.g. the tests for [ChartInflator] or e.g. the tests for [ChartInflator] or
[NameTransformer]. [NameTransformer].
## Placement ## Placement
Each plugin gets its own dedicated directory named Each plugin gets its own dedicated directory named
@@ -258,6 +256,7 @@ Resources can be marked as needing to be processed by the internal hash transfor
If this annotation is set on a resource not supported by the hash transformer the build will fail. If this annotation is set on a resource not supported by the hash transformer the build will fail.
Example: Example:
```yaml ```yaml
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap
@@ -274,6 +273,7 @@ data:
The `behavior` annotation will influence how conflicts are handled for resources emitted by the plugin. Valid values include "create", "merge", and "replace" with "create" being the default. The `behavior` annotation will influence how conflicts are handled for resources emitted by the plugin. Valid values include "create", "merge", and "replace" with "create" being the default.
Example: Example:
```yaml ```yaml
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap
@@ -372,4 +372,3 @@ d=$XDG_CONFIG_HOME/kustomize/plugin\
go build -buildmode plugin \ go build -buildmode plugin \
-o $d/${kind}.so $d/${kind}.go -o $d/${kind}.so $d/${kind}.go
``` ```

View File

@@ -29,7 +29,6 @@ power as most of the plugins arguments must
be defaulted. The latter method allows for be defaulted. The latter method allows for
complete plugin argument specification. complete plugin argument specification.
[types.GeneratorOptions]: https://github.com/kubernetes-sigs/kustomize/tree/master/api/types/generatoroptions.go [types.GeneratorOptions]: https://github.com/kubernetes-sigs/kustomize/tree/master/api/types/generatoroptions.go
[types.SecretArgs]: https://github.com/kubernetes-sigs/kustomize/tree/master/api/types/secretargs.go [types.SecretArgs]: https://github.com/kubernetes-sigs/kustomize/tree/master/api/types/secretargs.go
[types.ConfigMapArgs]: https://github.com/kubernetes-sigs/kustomize/tree/master/api/types/configmapargs.go [types.ConfigMapArgs]: https://github.com/kubernetes-sigs/kustomize/tree/master/api/types/configmapargs.go
@@ -42,6 +41,7 @@ complete plugin argument specification.
[image.Image]: https://github.com/kubernetes-sigs/kustomize/tree/master/api/types/image.go [image.Image]: https://github.com/kubernetes-sigs/kustomize/tree/master/api/types/image.go
## _AnnotationTransformer_ ## _AnnotationTransformer_
### Usage via `kustomization.yaml` ### Usage via `kustomization.yaml`
#### field name: `commonAnnotations` #### field name: `commonAnnotations`
@@ -56,6 +56,7 @@ commonAnnotations:
``` ```
### Usage via plugin ### Usage via plugin
#### Arguments #### Arguments
> Annotations map\[string\]string > Annotations map\[string\]string
@@ -63,6 +64,7 @@ commonAnnotations:
> FieldSpecs \[\][config.FieldSpec] > FieldSpecs \[\][config.FieldSpec]
#### Example #### Example
>
> ``` > ```
> apiVersion: builtin > apiVersion: builtin
> kind: AnnotationsTransformer > kind: AnnotationsTransformer
@@ -76,8 +78,6 @@ commonAnnotations:
> create: true > create: true
> ``` > ```
## _ConfigMapGenerator_ ## _ConfigMapGenerator_
### Usage via `kustomization.yaml` ### Usage via `kustomization.yaml`
@@ -156,11 +156,13 @@ configMapGenerator:
``` ```
### Usage via plugin ### Usage via plugin
#### Arguments #### Arguments
> [types.ConfigMapArgs] > [types.ConfigMapArgs]
#### Example #### Example
>
> ``` > ```
> apiVersion: builtin > apiVersion: builtin
> kind: ConfigMapGenerator > kind: ConfigMapGenerator
@@ -174,8 +176,8 @@ configMapGenerator:
> - VEGETABLE=carrot > - VEGETABLE=carrot
> ``` > ```
## _ImageTagTransformer_ ## _ImageTagTransformer_
### Usage via `kustomization.yaml` ### Usage via `kustomization.yaml`
#### field name: `images` #### field name: `images`
@@ -219,6 +221,7 @@ images:
``` ```
### Usage via plugin ### Usage via plugin
#### Arguments #### Arguments
> ImageTag [image.Image] > ImageTag [image.Image]
@@ -226,6 +229,7 @@ images:
> FieldSpecs \[\][config.FieldSpec] > FieldSpecs \[\][config.FieldSpec]
#### Example #### Example
>
> ``` > ```
> apiVersion: builtin > apiVersion: builtin
> kind: ImageTagTransformer > kind: ImageTagTransformer
@@ -236,9 +240,8 @@ images:
> newTag: v2 > newTag: v2
> ``` > ```
## _LabelTransformer_ ## _LabelTransformer_
### Usage via `kustomization.yaml` ### Usage via `kustomization.yaml`
#### field name: `commonLabels` #### field name: `commonLabels`
@@ -253,6 +256,7 @@ commonLabels:
``` ```
### Usage via plugin ### Usage via plugin
#### Arguments #### Arguments
> Labels map\[string\]string > Labels map\[string\]string
@@ -260,6 +264,7 @@ commonLabels:
> FieldSpecs \[\][config.FieldSpec] > FieldSpecs \[\][config.FieldSpec]
#### Example #### Example
>
> ``` > ```
> apiVersion: builtin > apiVersion: builtin
> kind: LabelTransformer > kind: LabelTransformer
@@ -273,14 +278,8 @@ commonLabels:
> create: true > create: true
> ``` > ```
## _NamespaceTransformer_ ## _NamespaceTransformer_
### Usage via `kustomization.yaml` ### Usage via `kustomization.yaml`
#### field name: `namespace` #### field name: `namespace`
@@ -292,6 +291,7 @@ namespace: my-namespace
``` ```
### Usage via plugin ### Usage via plugin
#### Arguments #### Arguments
> [types.ObjectMeta] > [types.ObjectMeta]
@@ -299,6 +299,7 @@ namespace: my-namespace
> FieldSpecs \[\][config.FieldSpec] > FieldSpecs \[\][config.FieldSpec]
#### Example #### Example
>
> ``` > ```
> apiVersion: builtin > apiVersion: builtin
> kind: NamespaceTransformer > kind: NamespaceTransformer
@@ -316,11 +317,8 @@ namespace: my-namespace
> group: rbac.authorization.k8s.io > group: rbac.authorization.k8s.io
> ``` > ```
## _PatchesJson6902_ ## _PatchesJson6902_
### Usage via `kustomization.yaml` ### Usage via `kustomization.yaml`
#### field name: `patchesJson6902` #### field name: `patchesJson6902`
@@ -328,7 +326,7 @@ namespace: my-namespace
Each entry in this list should resolve to Each entry in this list should resolve to
a kubernetes object and a JSON patch that will be applied a kubernetes object and a JSON patch that will be applied
to the object. to the object.
The JSON patch is documented at https://tools.ietf.org/html/rfc6902 The JSON patch is documented at <https://tools.ietf.org/html/rfc6902>
target field points to a kubernetes object within the same kustomization target field points to a kubernetes object within the same kustomization
by the object's group, version, kind, name and namespace. by the object's group, version, kind, name and namespace.
@@ -385,7 +383,9 @@ patchesJson6902:
``` ```
### Usage via plugin ### Usage via plugin
#### Arguments #### Arguments
> Target [types.PatchTarget] > Target [types.PatchTarget]
> >
> Path string > Path string
@@ -393,6 +393,7 @@ patchesJson6902:
> JsonOp string > JsonOp string
#### Example #### Example
>
> ``` > ```
> apiVersion: builtin > apiVersion: builtin
> kind: PatchJson6902Transformer > kind: PatchJson6902Transformer
@@ -406,8 +407,8 @@ patchesJson6902:
> path: jsonpatch.json > path: jsonpatch.json
> ``` > ```
## _PatchesStrategicMerge_ ## _PatchesStrategicMerge_
### Usage via `kustomization.yaml` ### Usage via `kustomization.yaml`
#### field name: `patchesStrategicMerge` #### field name: `patchesStrategicMerge`
@@ -435,6 +436,7 @@ patchesStrategicMerge:
``` ```
The patch content can be a inline string as well. The patch content can be a inline string as well.
``` ```
patchesStrategicMerge: patchesStrategicMerge:
- |- - |-
@@ -463,8 +465,8 @@ patch that performs all the needed deletions.
> >
> Patches string > Patches string
#### Example #### Example
>
> ``` > ```
> apiVersion: builtin > apiVersion: builtin
> kind: PatchStrategicMergeTransformer > kind: PatchStrategicMergeTransformer
@@ -474,8 +476,8 @@ patch that performs all the needed deletions.
> - patch.yaml > - patch.yaml
> ``` > ```
## _PatchTransformer_ ## _PatchTransformer_
### Usage via `kustomization.yaml` ### Usage via `kustomization.yaml`
#### field name: `patches` #### field name: `patches`
@@ -514,6 +516,7 @@ automatically anchored regular expressions. This means that the value `myapp`
is equivalent to `^myapp$`. is equivalent to `^myapp$`.
### Usage via plugin ### Usage via plugin
#### Arguments #### Arguments
> Path string > Path string
@@ -523,6 +526,7 @@ is equivalent to `^myapp$`.
> Target \*[types.Selector] > Target \*[types.Selector]
#### Example #### Example
>
> ``` > ```
> apiVersion: builtin > apiVersion: builtin
> kind: PatchTransformer > kind: PatchTransformer
@@ -534,10 +538,8 @@ is equivalent to `^myapp$`.
> kind: Deployment > kind: Deployment
> ``` > ```
## _PrefixSuffixTransformer_ ## _PrefixSuffixTransformer_
### Usage via `kustomization.yaml` ### Usage via `kustomization.yaml`
#### field names: `namePrefix`, `nameSuffix` #### field names: `namePrefix`, `nameSuffix`
@@ -558,6 +560,7 @@ The suffix is appended before the content hash if
the resource type is ConfigMap or Secret. the resource type is ConfigMap or Secret.
### Usage via plugin ### Usage via plugin
#### Arguments #### Arguments
> Prefix string > Prefix string
@@ -567,6 +570,7 @@ the resource type is ConfigMap or Secret.
> FieldSpecs \[\][config.FieldSpec] > FieldSpecs \[\][config.FieldSpec]
#### Example #### Example
>
> ``` > ```
> apiVersion: builtin > apiVersion: builtin
> kind: PrefixSuffixTransformer > kind: PrefixSuffixTransformer
@@ -578,9 +582,8 @@ the resource type is ConfigMap or Secret.
> - path: metadata/name > - path: metadata/name
> ``` > ```
## _ReplicaCountTransformer_ ## _ReplicaCountTransformer_
### Usage via `kustomization.yaml` ### Usage via `kustomization.yaml`
#### field name: `replicas` #### field name: `replicas`
@@ -612,6 +615,7 @@ be modified at the same time.
As this declaration does not take in a `kind:` nor a `group:` As this declaration does not take in a `kind:` nor a `group:`
it will match any `group` and `kind` that has a matching name and it will match any `group` and `kind` that has a matching name and
that is one of: that is one of:
- `Deployment` - `Deployment`
- `ReplicationController` - `ReplicationController`
- `ReplicaSet` - `ReplicaSet`
@@ -628,6 +632,7 @@ For more complex use cases, revert to using a patch.
> FieldSpecs \[\][config.FieldSpec] > FieldSpecs \[\][config.FieldSpec]
#### Example #### Example
>
> ``` > ```
> apiVersion: builtin > apiVersion: builtin
> kind: ReplicaCountTransformer > kind: ReplicaCountTransformer
@@ -645,8 +650,6 @@ For more complex use cases, revert to using a patch.
> kind: ReplicationController > kind: ReplicationController
> ``` > ```
## _SecretGenerator_ ## _SecretGenerator_
### Usage via `kustomization.yaml` ### Usage via `kustomization.yaml`

View File

@@ -20,7 +20,6 @@ current setup.
* linux, git, curl, Go 1.13 * linux, git, curl, Go 1.13
## Make a place to work ## Make a place to work
``` ```
@@ -128,11 +127,11 @@ EOF
``` ```
Review the files Review the files
``` ```
ls -C1 $MYAPP ls -C1 $MYAPP
``` ```
## Make a home for plugins ## Make a home for plugins
Plugins must live in a particular place for Plugins must live in a particular place for
@@ -205,6 +204,7 @@ chmod a+x $MY_PLUGIN_DIR/SillyConfigMapGenerator
## Install kustomize ## Install kustomize
Per the [instructions](/kustomize/installation): Per the [instructions](/kustomize/installation):
``` ```
curl -s "https://raw.githubusercontent.com/\ curl -s "https://raw.githubusercontent.com/\
kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash
@@ -218,7 +218,7 @@ mv kustomize $DEMO/bin
tree $DEMO tree $DEMO
``` ```
## Build your app, using the plugin: ## Build your app, using the plugin
``` ```
XDG_CONFIG_HOME=$DEMO $DEMO/bin/kustomize build --enable_alpha_plugins $MYAPP XDG_CONFIG_HOME=$DEMO $DEMO/bin/kustomize build --enable_alpha_plugins $MYAPP

View File

@@ -57,6 +57,7 @@ accepting a shared plugin _must compile both
kustomize and the plugin_. kustomize and the plugin_.
This means a one-time run of This means a one-time run of
``` ```
# Or whatever is appropriate at time of reading # Or whatever is appropriate at time of reading
GOPATH=${whatever} GO111MODULE=on go get sigs.k8s.io/kustomize/api GOPATH=${whatever} GO111MODULE=on go get sigs.k8s.io/kustomize/api
@@ -68,13 +69,14 @@ and then a normal development cycle using
go build -buildmode plugin \ go build -buildmode plugin \
-o ${wherever}/${kind}.so ${wherever}/${kind}.go -o ${wherever}/${kind}.so ${wherever}/${kind}.go
``` ```
with paths and the release version tag (e.g. `v3.0.0`) with paths and the release version tag (e.g. `v3.0.0`)
adjusted as needed. adjusted as needed.
For comparison, consider what one For comparison, consider what one
must do to write a [tensorflow plugin]. must do to write a [tensorflow plugin].
## Why support Go plugins? ## Why support Go plugins
### Safety ### Safety

View File

@@ -102,7 +102,7 @@ PLUGIN_ROOT=$DEMO/kustomize/plugin
and ephemerally set `XDG_CONFIG_HOME` on a command and ephemerally set `XDG_CONFIG_HOME` on a command
line below. line below.
### What apiVersion and kind? ### What apiVersion and kind
At this stage in the development of kustomize At this stage in the development of kustomize
plugins, plugin code doesn't know or care what plugins, plugin code doesn't know or care what
@@ -356,7 +356,7 @@ This should look something like:
> └── secGenerator.yaml > └── secGenerator.yaml
> ``` > ```
## Build your app, using the plugin: ## Build your app, using the plugin
```shell ```shell
XDG_CONFIG_HOME=$DEMO $tmpGoPath/bin/kustomize build --enable_alpha_plugins $MYAPP XDG_CONFIG_HOME=$DEMO $tmpGoPath/bin/kustomize build --enable_alpha_plugins $MYAPP

View File

@@ -13,5 +13,6 @@ choco install kustomize
For support on the chocolatey package For support on the chocolatey package
and prior releases, see: and prior releases, see:
- [Choco Package](https://chocolatey.org/packages/kustomize) - [Choco Package](https://chocolatey.org/packages/kustomize)
- [Package Source](https://github.com/kenmaglio/choco-kustomize) - [Package Source](https://github.com/kenmaglio/choco-kustomize)

View File

@@ -18,4 +18,3 @@ For [MacPorts](https://www.macports.org) users:
``` ```
sudo port install kustomize sudo port install kustomize
``` ```

View File

@@ -39,5 +39,4 @@ git checkout kustomize/v3.2.3
~/go/bin/kustomize version ~/go/bin/kustomize version
``` ```
[Go]: https://golang.org [Go]: https://golang.org

View File

@@ -28,7 +28,6 @@ linkTitle = "Kustomize"
{{< blocks/section >}} {{< blocks/section >}}
{{% blocks/feature icon="fab fa-github" title="参与贡献" %}} {{% blocks/feature icon="fab fa-github" title="参与贡献" %}}
欢迎在 **Github** 提交 [RP](https://github.com/kubernetes-sigs/kustomize/pulls),贡献你的力量。 欢迎在 **Github** 提交 [RP](https://github.com/kubernetes-sigs/kustomize/pulls),贡献你的力量。
{{% /blocks/feature %}} {{% /blocks/feature %}}

View File

@@ -9,6 +9,7 @@ description: >
列表中的每个条目都将生成一个 ConfigMap (合计可以生成 n 个 ConfigMap 列表中的每个条目都将生成一个 ConfigMap (合计可以生成 n 个 ConfigMap
以下示例创建四个 ConfigMap 以下示例创建四个 ConfigMap
- 第一个使用给定文件的名称和内容创建数据 - 第一个使用给定文件的名称和内容创建数据
- 第二个使用文件中的键/值对将数据创建为键/值 - 第二个使用文件中的键/值对将数据创建为键/值
- 第三个使用 `literals` 中的键/值对创建数据作为键/值 - 第三个使用 `literals` 中的键/值对创建数据作为键/值

View File

@@ -9,7 +9,6 @@ description: >
[strategic merge]: /kustomize/zh/api-reference/glossary#patchstrategicmerge [strategic merge]: /kustomize/zh/api-reference/glossary#patchstrategicmerge
[JSON]: /kustomize/zh/api-reference/glossary#patchjson6902 [JSON]: /kustomize/zh/api-reference/glossary#patchjson6902
Patches 在资源上添加或覆盖字段Kustomization 使用 `patches` 字段来提供该功能。 Patches 在资源上添加或覆盖字段Kustomization 使用 `patches` 字段来提供该功能。
`patches` 字段包含要按指定顺序应用的 patch 列表。 `patches` 字段包含要按指定顺序应用的 patch 列表。

View File

@@ -23,6 +23,7 @@ patchesStrategicMerge:
``` ```
patch 内容也可以是一个inline string patch 内容也可以是一个inline string
```yaml ```yaml
apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization

View File

@@ -31,6 +31,7 @@ replicas:
该字段内容为列表,所以可以同时修改许多资源。 该字段内容为列表,所以可以同时修改许多资源。
由于这个声明无法设置 `kind:``group:`,所以他只能匹配如下资源中的一种: 由于这个声明无法设置 `kind:``group:`,所以他只能匹配如下资源中的一种:
- `Deployment` - `Deployment`
- `ReplicationController` - `ReplicationController`
- `ReplicaSet` - `ReplicaSet`

View File

@@ -7,6 +7,7 @@ description: >
--- ---
该条目可以是指向本地目录的相对路径,也可以是指向远程仓库中的目录的 URL例如 该条目可以是指向本地目录的相对路径,也可以是指向远程仓库中的目录的 URL例如
```yaml ```yaml
apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization

View File

@@ -164,7 +164,6 @@ orphaned cluster resources.
For more information see the For more information see the
[kustomize inventory object documentation]. [kustomize inventory object documentation].
## Field changes / deprecations ## Field changes / deprecations
### `resources` expanded, `bases` deprecated ### `resources` expanded, `bases` deprecated

View File

@@ -17,7 +17,7 @@ floor on a stable API for [plugin] developers
(both _Go_ plugin developers and _exec_ plugin (both _Go_ plugin developers and _exec_ plugin
developers who happen to use Go). developers who happen to use Go).
### Why so soon after v2.1.0? ### Why so soon after v2.1.0
[semantic versioning]: https://semver.org [semantic versioning]: https://semver.org
[Go modules doc]: https://github.com/golang/go/wiki/Modules#releasing-modules-v2-or-higher [Go modules doc]: https://github.com/golang/go/wiki/Modules#releasing-modules-v2-or-higher
@@ -70,6 +70,3 @@ Aside - the set of kustomize packages outside
by package use, this API surface must shrink. by package use, this API surface must shrink.
Such shrinkage will trigger a major version Such shrinkage will trigger a major version
increment. increment.

View File

@@ -7,6 +7,7 @@ description: >
--- ---
## Extended patches ## Extended patches
Since this version, Kustomize allows applying one patch to multiple resources. This works for both Strategic Merge Patch and JSON Patch. Take a look at [patch multiple objects](https://github.com/kubernetes-sigs/kustomize/tree/master/examples/patchMultipleObjects.md). Since this version, Kustomize allows applying one patch to multiple resources. This works for both Strategic Merge Patch and JSON Patch. Take a look at [patch multiple objects](https://github.com/kubernetes-sigs/kustomize/tree/master/examples/patchMultipleObjects.md).
## Improved Resource Matching ## Improved Resource Matching
@@ -52,7 +53,6 @@ spec:
value: PRODVALUE value: PRODVALUE
``` ```
### Variable resolution improvement ### Variable resolution improvement
It is possible to add namespace field to the variable declaration. In the following example, It is possible to add namespace field to the variable declaration. In the following example,
@@ -88,6 +88,7 @@ vars:
Kustomize is now able to deal with simultaneous changes of name and namespace. Kustomize is now able to deal with simultaneous changes of name and namespace.
Special attention has been paid the handling of: Special attention has been paid the handling of:
- ClusterRoleBinding/RoleBinding "subjects" field, - ClusterRoleBinding/RoleBinding "subjects" field,
- ValidatingWebhookConfiguration "webhooks" field. - ValidatingWebhookConfiguration "webhooks" field.
@@ -106,7 +107,7 @@ resources:
... ...
``` ```
### Resource and Kustomize Context matching. ### Resource and Kustomize Context matching
Kustomize is now able to support more aggregation patterns. Kustomize is now able to support more aggregation patterns.

View File

@@ -7,6 +7,7 @@ description: >
--- ---
## Inline Patch ## Inline Patch
Since this version, Kustomize allows inline patches in all three of `patchesStrategicMerge`, `patchesJson6902` and `patches`. Take a look at [inline patch](https://github.com/kubernetes-sigs/kustomize/tree/master/examples/examples/inlinePatch.md). Since this version, Kustomize allows inline patches in all three of `patchesStrategicMerge`, `patchesJson6902` and `patches`. Take a look at [inline patch](https://github.com/kubernetes-sigs/kustomize/tree/master/examples/examples/inlinePatch.md).
## New Subcommand ## New Subcommand
@@ -14,11 +15,13 @@ Since this version, Kustomize allows inline patches in all three of `patchesStra
Since this version, one can create a kustomization.yaml file in a directory through a `create` subcommand. Since this version, one can create a kustomization.yaml file in a directory through a `create` subcommand.
Create a new overlay from the base ../base Create a new overlay from the base ../base
``` ```
kustomize create --resources ../base kustomize create --resources ../base
``` ```
Create a new kustomization detecing resources in the current directory Create a new kustomization detecing resources in the current directory
``` ```
kustomize create --autodetect kustomize create --autodetect
``` ```
@@ -30,5 +33,5 @@ kustomize create --autodetect --recursive
``` ```
### New Example Generator ### New Example Generator
A new example generator of using go-getter to download resources is added. Take a look at [go-getter generator](https://github.com/kubernetes-sigs/kustomize/tree/master/examples/goGetterGeneratorPlugin.md).
A new example generator of using go-getter to download resources is added. Take a look at [go-getter generator](https://github.com/kubernetes-sigs/kustomize/tree/master/examples/goGetterGeneratorPlugin.md).

View File

@@ -12,7 +12,7 @@ description: >
## Summary of changes ## Summary of changes
### First release of the Go API-only module. ### First release of the Go API-only module
Many of the PRs since the last vrelease were Many of the PRs since the last vrelease were
around restructuring the _sigs.k8s.io/kustomize_ around restructuring the _sigs.k8s.io/kustomize_
@@ -43,7 +43,6 @@ any other client.
The new semver-able API will begin with `v4.0.0` (not The new semver-able API will begin with `v4.0.0` (not
yet released) and be a clean break with `v3` etc. yet released) and be a clean break with `v3` etc.
### Change log since v3.2.0 ### Change log since v3.2.0
``` ```

View File

@@ -21,5 +21,3 @@ If you are interested in contributing towards Kustomize or getting more involved
- join the [mailing list] and reach out - join the [mailing list] and reach out
- join the [slack channel] and reach out - join the [slack channel] and reach out
- attend one of the [bi-weekly meetings] (alternating Wednesdays at 9:00am Pacific Time) - attend one of the [bi-weekly meetings] (alternating Wednesdays at 9:00am Pacific Time)

View File

@@ -79,4 +79,3 @@ Changes must be pushed to the fork's **master branch** to be served as the fork'
4. Commit and push the changes to the *remote fork's* **master branch** 4. Commit and push the changes to the *remote fork's* **master branch**
5. After a few minutes, the docs should be served from the fork's GitHub Page 5. After a few minutes, the docs should be served from the fork's GitHub Page
- e.g. [https://pwittrock.github.io/kustomize/](https://pwittrock.github.io/kustomize/) - e.g. [https://pwittrock.github.io/kustomize/](https://pwittrock.github.io/kustomize/)

View File

@@ -15,7 +15,6 @@ description: >
[eschewed feature list]: https://kubernetes-sigs.github.io/kustomize/faq/eschewedfeatures/ [eschewed feature list]: https://kubernetes-sigs.github.io/kustomize/faq/eschewedfeatures/
[kind/feature]: https://github.com/kubernetes-sigs/kustomize/labels/kind%2Ffeature [kind/feature]: https://github.com/kubernetes-sigs/kustomize/labels/kind%2Ffeature
Following is the process for proposing a new Kustomize feature: Following is the process for proposing a new Kustomize feature:
1. Check the [eschewed feature list] to see if the feature has already been proposed 1. Check the [eschewed feature list] to see if the feature has already been proposed

View File

@@ -9,7 +9,8 @@ description: >
This is the PowerShell script to run all go tests for Kustomize on a windows based platform which mimics /build/pre-commit.sh This is the PowerShell script to run all go tests for Kustomize on a windows based platform which mimics /build/pre-commit.sh
## Pre-Reqs: ## Pre-Reqs
- PowerShell installed - PowerShell installed
- PowerShell Core is supported - PowerShell Core is supported
- go installed - go installed
@@ -18,20 +19,23 @@ This is the PowerShell script to run all go tests for Kustomize on a windows bas
This script should output to the current console and return an exit code if all tests are successful(0) or any failed(1). This script should output to the current console and return an exit code if all tests are successful(0) or any failed(1).
### If you are tryin to run these tests locally you can follow these instructions. ### If you are tryin to run these tests locally you can follow these instructions
Assume: Assume:
- Running a stock Windows 10 system - Running a stock Windows 10 system
- Local Admin rights. - Local Admin rights.
- You can open [PowerShell as administrator](http://lmgtfy.com/?iie=1&q=How+to+open+powershell+as+administrator) - You can open [PowerShell as administrator](http://lmgtfy.com/?iie=1&q=How+to+open+powershell+as+administrator)
- You should be knowledgeable enough to pull source for packages into your GO ```src``` directory - You should be knowledgeable enough to pull source for packages into your GO ```src``` directory
- Yes, this means you also need to know a bit about **git** usually - Yes, this means you also need to know a bit about **git** usually
#### Step 1 - Install Go #### Step 1 - Install Go
- [Install Go](https://golang.org/dl/) - please use the msi - [Install Go](https://golang.org/dl/) - please use the msi
- If you use chocolatey - it's using the zip not msi and assumptions on where go is located are made for you. - If you use chocolatey - it's using the zip not msi and assumptions on where go is located are made for you.
#### Step 2 - Install Go Packages #### Step 2 - Install Go Packages
- Open new PowerShell Administrative window - Open new PowerShell Administrative window
- Install golangci-lint - Install golangci-lint
- ```go get -u github.com/golangci/golangci-lint/cmd/golangci-lint``` - ```go get -u github.com/golangci/golangci-lint/cmd/golangci-lint```
@@ -51,6 +55,7 @@ Usage: C:\_go\bin\mdrip.exe {fileName}...
``` ```
#### Step 3 - Get Source and Test #### Step 3 - Get Source and Test
- In your GoRoot src - In your GoRoot src
- ```Example: C:\_go\src``` - ```Example: C:\_go\src```
- Navigate to the Kustomize `travis` directory - Navigate to the Kustomize `travis` directory

View File

@@ -132,7 +132,6 @@ kustomize edit set image nginx:$MY_NGINX_VERSION
as part of some encapsulating work flow executed before as part of some encapsulating work flow executed before
`kustomize build`. `kustomize build`.
## Globs in kustomization files ## Globs in kustomization files
`kustomize` supports the best practice of storing one's `kustomize` supports the best practice of storing one's

View File

@@ -118,10 +118,8 @@ itself is an API client requiring this module.
The clients and API will evolve independently. The clients and API will evolve independently.
## Kustomization File Versioning ## Kustomization File Versioning
The kustomization file is a struct that is part of The kustomization file is a struct that is part of
the kustomize Go API (the `sigs.k8s.io/kustomize` the kustomize Go API (the `sigs.k8s.io/kustomize`
module), but it also evolves as a k8s API object - module), but it also evolves as a k8s API object -

View File

@@ -51,6 +51,7 @@ description: >
> ``` > ```
也可以在 [kubectl-v1.14.0] 版,使用 ```kubectl``` 命令发布你的 [variants] 。 也可以在 [kubectl-v1.14.0] 版,使用 ```kubectl``` 命令发布你的 [variants] 。
>
> ``` > ```
> kubectl apply -k ~/ldap/overlays/staging > kubectl apply -k ~/ldap/overlays/staging
> kubectl apply -k ~/ldap/overlays/production > kubectl apply -k ~/ldap/overlays/production

View File

@@ -45,6 +45,7 @@ description: >
> ``` > ```
也可以在 [kubectl-v1.14.0] 版,使用 ```kubectl``` 命令发布你的 [variants] 。 也可以在 [kubectl-v1.14.0] 版,使用 ```kubectl``` 命令发布你的 [variants] 。
>
> ```bash > ```bash
> kubectl apply -k ~/ldap/overlays/staging > kubectl apply -k ~/ldap/overlays/staging
> kubectl apply -k ~/ldap/overlays/production > kubectl apply -k ~/ldap/overlays/production

View File

@@ -42,7 +42,6 @@ Kustomize 提供一个插件框架,允许用户开发自己的 _生成器_ 和
从磁盘上读取 YAML 文件kustomization 的路径或 URL 会触发 kustomization 的运行。由此产生的每个的对象都会被 kustomize 进一步解析为 _plugin configuration_ 对象。 从磁盘上读取 YAML 文件kustomization 的路径或 URL 会触发 kustomization 的运行。由此产生的每个的对象都会被 kustomize 进一步解析为 _plugin configuration_ 对象。
## 配置 ## 配置
kustomization 文件可以包含如下内容: kustomization 文件可以包含如下内容:
@@ -173,6 +172,7 @@ kustomize 会使用 exec 插件适配器,为 `stdin` 提供的资源,并获
如果此注释被设置在不受哈希转换器支持的资源上,将导致构建将失败。 如果此注释被设置在不受哈希转换器支持的资源上,将导致构建将失败。
示例: 示例:
```yaml ```yaml
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap
@@ -189,6 +189,7 @@ data:
`behavior` 注释为当资源发生冲突时插件的处理方式,有效值包括:"create"、"merge "和 "replace",默认为 "create"。 `behavior` 注释为当资源发生冲突时插件的处理方式,有效值包括:"create"、"merge "和 "replace",默认为 "create"。
示例: 示例:
```yaml ```yaml
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap

View File

@@ -50,6 +50,7 @@ commonAnnotations:
> FieldSpecs \[\][config.FieldSpec] > FieldSpecs \[\][config.FieldSpec]
#### Example #### Example
>
> ```yaml > ```yaml
> apiVersion: builtin > apiVersion: builtin
> kind: AnnotationsTransformer > kind: AnnotationsTransformer
@@ -63,8 +64,6 @@ commonAnnotations:
> create: true > create: true
> ``` > ```
## _ConfigMapGenerator_ ## _ConfigMapGenerator_
### 使用 `kustomization.yaml` ### 使用 `kustomization.yaml`
@@ -129,6 +128,7 @@ configMapGenerator:
> [types.ConfigMapArgs] > [types.ConfigMapArgs]
#### Example #### Example
>
> ```yaml > ```yaml
> apiVersion: builtin > apiVersion: builtin
> kind: ConfigMapGenerator > kind: ConfigMapGenerator
@@ -142,7 +142,6 @@ configMapGenerator:
> - VEGETABLE=carrot > - VEGETABLE=carrot
> ``` > ```
## _ImageTagTransformer_ ## _ImageTagTransformer_
### 使用 `kustomization.yaml` ### 使用 `kustomization.yaml`
@@ -194,6 +193,7 @@ images:
> FieldSpecs \[\][config.FieldSpec] > FieldSpecs \[\][config.FieldSpec]
#### Example #### Example
>
> ```yaml > ```yaml
> apiVersion: builtin > apiVersion: builtin
> kind: ImageTagTransformer > kind: ImageTagTransformer
@@ -204,8 +204,6 @@ images:
> newTag: v2 > newTag: v2
> ``` > ```
## _LabelTransformer_ ## _LabelTransformer_
### 使用 `kustomization.yaml` ### 使用 `kustomization.yaml`
@@ -230,6 +228,7 @@ commonLabels:
> FieldSpecs \[\][config.FieldSpec] > FieldSpecs \[\][config.FieldSpec]
#### Example #### Example
>
> ```yaml > ```yaml
> apiVersion: builtin > apiVersion: builtin
> kind: LabelTransformer > kind: LabelTransformer
@@ -264,6 +263,7 @@ namespace: my-namespace
> FieldSpecs \[\][config.FieldSpec] > FieldSpecs \[\][config.FieldSpec]
#### Example #### Example
>
> ```yaml > ```yaml
> apiVersion: builtin > apiVersion: builtin
> kind: NamespaceTransformer > kind: NamespaceTransformer
@@ -345,6 +345,7 @@ patchesJson6902:
### 使用插件 ### 使用插件
#### Arguments #### Arguments
> Target [types.PatchTarget] > Target [types.PatchTarget]
> >
> Path string > Path string
@@ -352,6 +353,7 @@ patchesJson6902:
> JsonOp string > JsonOp string
#### Example #### Example
>
> ```yaml > ```yaml
> apiVersion: builtin > apiVersion: builtin
> kind: PatchJson6902Transformer > kind: PatchJson6902Transformer
@@ -385,6 +387,7 @@ patchesStrategicMerge:
``` ```
patch 内容也可以是一个inline string patch 内容也可以是一个inline string
```yaml ```yaml
patchesStrategicMerge: patchesStrategicMerge:
- |- - |-
@@ -411,6 +414,7 @@ patchesStrategicMerge:
> Patches string > Patches string
#### Example #### Example
>
> ```yaml > ```yaml
> apiVersion: builtin > apiVersion: builtin
> kind: PatchStrategicMergeTransformer > kind: PatchStrategicMergeTransformer
@@ -420,7 +424,6 @@ patchesStrategicMerge:
> - patch.yaml > - patch.yaml
> ``` > ```
## _PatchTransformer_ ## _PatchTransformer_
### 使用 `kustomization.yaml` ### 使用 `kustomization.yaml`
@@ -463,6 +466,7 @@ is equivalent to `^myapp$`。
> Target \*[types.Selector] > Target \*[types.Selector]
#### Example #### Example
>
> ```yaml > ```yaml
> apiVersion: builtin > apiVersion: builtin
> kind: PatchTransformer > kind: PatchTransformer
@@ -502,6 +506,7 @@ nameSuffix: -v2
> FieldSpecs \[\][config.FieldSpec] > FieldSpecs \[\][config.FieldSpec]
#### Example #### Example
>
> ```yaml > ```yaml
> apiVersion: builtin > apiVersion: builtin
> kind: PrefixSuffixTransformer > kind: PrefixSuffixTransformer
@@ -542,6 +547,7 @@ replicas:
该字段内容为列表,所以可以同时修改许多资源。 该字段内容为列表,所以可以同时修改许多资源。
由于这个声明无法设置 `kind:``group:`,所以他只能匹配如下资源中的一种: 由于这个声明无法设置 `kind:``group:`,所以他只能匹配如下资源中的一种:
- `Deployment` - `Deployment`
- `ReplicationController` - `ReplicationController`
- `ReplicaSet` - `ReplicaSet`
@@ -558,6 +564,7 @@ replicas:
> FieldSpecs \[\][config.FieldSpec] > FieldSpecs \[\][config.FieldSpec]
#### Example #### Example
>
> ```yaml > ```yaml
> apiVersion: builtin > apiVersion: builtin
> kind: ReplicaCountTransformer > kind: ReplicaCountTransformer

View File

@@ -203,7 +203,7 @@ mv kustomize $DEMO/bin
tree $DEMO tree $DEMO
``` ```
## 使用插件构建 APP: ## 使用插件构建 APP
```bash ```bash
XDG_CONFIG_HOME=$DEMO $DEMO/bin/kustomize build --enable_alpha_plugins $MYAPP XDG_CONFIG_HOME=$DEMO $DEMO/bin/kustomize build --enable_alpha_plugins $MYAPP

View File

@@ -50,7 +50,7 @@ go build -buildmode plugin \
为了进行比较,可以参考编写 [tensorflow plugin] 必须做的事情。 为了进行比较,可以参考编写 [tensorflow plugin] 必须做的事情。
## 为什么支持 Go 插件 ## 为什么支持 Go 插件
### 安全 ### 安全

View File

@@ -75,7 +75,7 @@ PLUGIN_ROOT=$DEMO/kustomize/plugin
并在下面的命令行中临时设置 `XDG_CONFIG_HOME` 并在下面的命令行中临时设置 `XDG_CONFIG_HOME`
### 使用什么 apiVersion 和 kind ### 使用什么 apiVersion 和 kind
在 kustomize 插件的开发时,插件代码不关心也不知道配置文件中的 `apiVersion``kind` 在 kustomize 插件的开发时,插件代码不关心也不知道配置文件中的 `apiVersion``kind`
@@ -296,7 +296,7 @@ tree $DEMO
> └── secGenerator.yaml > └── secGenerator.yaml
> ``` > ```
## 使用插件构建您的应用 ## 使用插件构建您的应用
```shell ```shell
XDG_CONFIG_HOME=$DEMO $tmpGoPath/bin/kustomize build --enable_alpha_plugins $MYAPP XDG_CONFIG_HOME=$DEMO $tmpGoPath/bin/kustomize build --enable_alpha_plugins $MYAPP

View File

@@ -12,5 +12,6 @@ choco install kustomize
``` ```
有关软件包管理器 chocolatey 的使用以及对之前版本的支持,请参考以下链接: 有关软件包管理器 chocolatey 的使用以及对之前版本的支持,请参考以下链接:
- [Choco Package](https://chocolatey.org/packages/kustomize) - [Choco Package](https://chocolatey.org/packages/kustomize)
- [Package Source](https://github.com/kenmaglio/choco-kustomize) - [Package Source](https://github.com/kenmaglio/choco-kustomize)