mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-29 17:41:13 +00:00
Deprecate 'bases:' field.
This commit is contained in:
@@ -9,9 +9,8 @@ What existing things should be customized.
|
||||
|
||||
| Field | Type | Explanation |
|
||||
|---|---|---|
|
||||
|[resources](#resources) | list |completely specified k8s API objects, e.g. deployment.yaml, configmap.yaml, etc|
|
||||
|[bases](#bases)| list |paths or github URLs specifying directories containing a kustomization. These bases may be subjected to more customization, or merely included in the output.|
|
||||
|[CRDs](#crds)| list |custom resource definition files, to allow specification of the custom resources in the resources list. |
|
||||
|[resources](#resources) | list |Files containing k8s API objects, or directories containing other kustomizations. |
|
||||
|[CRDs](#crds)| list |Custom resource definition files, to allow specification of the custom resources in the resources list. |
|
||||
|
||||
## Generators
|
||||
|
||||
@@ -62,33 +61,15 @@ If missing, this field's value defaults to
|
||||
```
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
```
|
||||
|
||||
### bases
|
||||
|
||||
Each entry in this list should resolve to a directory
|
||||
containing a kustomization file, else the
|
||||
customization fails.
|
||||
|
||||
The entry could be a relative path pointing to a local directory
|
||||
or a url pointing to a directory in a remote repo.
|
||||
The url should follow hashicorp/go-getter URL format
|
||||
https://github.com/hashicorp/go-getter#url-format
|
||||
|
||||
The presence of this field means this file (the file
|
||||
you a reading) is an _overlay_ that further
|
||||
customizes information coming from these _bases_.
|
||||
|
||||
Typical use case: a dev, staging and production
|
||||
environment that are mostly identical but differing
|
||||
crucial ways (image tags, a few server arguments,
|
||||
etc. that differ from the common base).
|
||||
|
||||
```
|
||||
bases:
|
||||
- ../../base
|
||||
- github.com/kubernetes-sigs/kustomize//examples/multibases?ref=v1.0.6
|
||||
- github.com/kubernets-sigs/kustomize//examples/helloWorld?ref=test-branch
|
||||
```
|
||||
The `bases` field was deprecated in v2.1.0.
|
||||
|
||||
Move entries into the [resources](#resources)
|
||||
field. This allows bases - which are still a
|
||||
[central concept](glossary.md#base) - to be
|
||||
ordered relative to other input resources.
|
||||
|
||||
### commonLabels
|
||||
|
||||
@@ -288,11 +269,10 @@ Each entry in this list should be a relative path
|
||||
resolving to a partial or complete resource
|
||||
definition file.
|
||||
|
||||
The names in these (possibly partial) resource files
|
||||
must match names already loaded via the `resources`
|
||||
field or via `resources` loaded transitively via the
|
||||
`bases` entries. These entries are used to _patch_
|
||||
(modify) the known resources.
|
||||
The names in these (possibly partial) resource
|
||||
files must match names already loaded via the
|
||||
`resources` field. These entries are used to
|
||||
_patch_ (modify) the known resources.
|
||||
|
||||
Small patches that do one thing are best, e.g. modify
|
||||
a memory request/limit, change an env var in a
|
||||
@@ -389,18 +369,37 @@ For more complex use cases, revert to using a patch.
|
||||
|
||||
### resources
|
||||
|
||||
Each entry in this list must resolve to an existing
|
||||
resource definition in YAML. These are the resource
|
||||
files that kustomize reads, modifies and emits as a
|
||||
YAML string, with resources separated by document
|
||||
markers ("---").
|
||||
Each entry in this list must be a path to a
|
||||
_file_, or a path (or URL) refering to another
|
||||
kustomization _directory_, e.g.
|
||||
|
||||
```
|
||||
resource:
|
||||
- some-service.yaml
|
||||
- myNamespace.yaml
|
||||
- sub-dir/some-deployment.yaml
|
||||
- ../../commonbase
|
||||
- github.com/kubernetes-sigs/kustomize//examples/multibases?ref=v1.0.6
|
||||
- deployment.yaml
|
||||
- github.com/kubernets-sigs/kustomize//examples/helloWorld?ref=test-branch
|
||||
```
|
||||
|
||||
Resources will be read and processed in
|
||||
depth-first order.
|
||||
|
||||
Files should contain k8s resources in YAML form.
|
||||
A file may contain multiple resources separated by
|
||||
the document marker `---`. File paths should be
|
||||
specified _relative_ to the directory holding the
|
||||
kustomization file containing the `resources`
|
||||
field.
|
||||
|
||||
[hashicorp URL]: https://github.com/hashicorp/go-getter#url-format
|
||||
|
||||
Directory specification can be relative, absolute,
|
||||
or part of a URL. URL specifications should
|
||||
follow the [hashicorp URL] format. The directory
|
||||
must contain a `kustomization.yaml` file.
|
||||
|
||||
|
||||
### secretGenerator
|
||||
|
||||
|
||||
@@ -62,9 +62,26 @@ commonAnnotations:
|
||||
# 一个 YAML 资源描述文件可以含有多个由(“---”)分隔的资源。
|
||||
# kustomize 将读取这些YAML文件中的资源,对其进行修改并
|
||||
# 发布在 kustomize 的输出中。
|
||||
#
|
||||
# 此列表中的每个条目都应解析为包含 kustomization 文件的目录,否则定制将失败
|
||||
#
|
||||
# 该条目可以是指向本地目录的相对路径
|
||||
# 也可以是指向远程仓库中的目录的 URL
|
||||
# URL 应该遵循 hashicorp/go-getter 中的 URL 格式
|
||||
# https://github.com/hashicorp/go-getter#url-format
|
||||
#
|
||||
# 此字段的存在意味着此文件(您正在阅读的文件)是 _overlay_
|
||||
# 它将进一步定制这些来自 _bases_ 文件中的配置
|
||||
#
|
||||
# 典型用例:开发,演示和生产环境
|
||||
# 这些环境大部分相同但有些关键方式存在差异(镜像标签,一些服务器参数等,与公共 base 不同的配置)
|
||||
resources:
|
||||
- some-service.yaml
|
||||
- sub-dir/some-deployment.yaml
|
||||
- ../../base
|
||||
- github.com/kubernetes-sigs/kustomize/examples/multibases?ref=v1.0.6
|
||||
- github.com/Liujingfang1/mysql
|
||||
- github.com/Liujingfang1/kustomize/examples/helloWorld?ref=test-branch
|
||||
|
||||
# 列表中的每个条目都将创建一个 ConfigMap (它是n个 ConfigMap 的生成器)
|
||||
# 下面的示例创建了两个 ConfigMaps
|
||||
@@ -113,24 +130,6 @@ generatorOptions:
|
||||
# disableNameSuffixHash 为 true 时将禁止默认的在名称后添加哈希值后缀的行为
|
||||
disableNameSuffixHash: true
|
||||
|
||||
# 此列表中的每个条目都应解析为包含 kustomization 文件的目录,否则定制将失败
|
||||
#
|
||||
# 该条目可以是指向本地目录的相对路径
|
||||
# 也可以是指向远程仓库中的目录的 URL
|
||||
# URL 应该遵循 hashicorp/go-getter 中的 URL 格式
|
||||
# https://github.com/hashicorp/go-getter#url-format
|
||||
#
|
||||
# 此字段的存在意味着此文件(您正在阅读的文件)是 _overlay_
|
||||
# 它将进一步定制这些来自 _bases_ 文件中的配置
|
||||
#
|
||||
# 典型用例:开发,演示和生产环境
|
||||
# 这些环境大部分相同但有些关键方式存在差异(镜像标签,一些服务器参数等,与公共 base 不同的配置)
|
||||
bases:
|
||||
- ../../base
|
||||
- github.com/kubernetes-sigs/kustomize/examples/multibases?ref=v1.0.6
|
||||
- github.com/Liujingfang1/mysql
|
||||
- github.com/Liujingfang1/kustomize/examples/helloWorld?ref=test-branch
|
||||
|
||||
# 此列表中的每个条目都应可以解析为部分或完整的资源定义文件
|
||||
#
|
||||
# 这些(也可能是部分的)资源文件中的 name 必须与已经通过 `resources` 加载的 name 字段匹配
|
||||
|
||||
Reference in New Issue
Block a user