mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-11 00:52:55 +00:00
@@ -107,7 +107,7 @@ Take the work from step (1) above, move it into a
|
|||||||
`someApp` subdirectory called `base`, then
|
`someApp` subdirectory called `base`, then
|
||||||
place overlays in a sibling directory.
|
place overlays in a sibling directory.
|
||||||
|
|
||||||
An overlay is just another kustomization, refering to
|
An overlay is just another kustomization, referring to
|
||||||
the base, and referring to patches to apply to that
|
the base, and referring to patches to apply to that
|
||||||
base.
|
base.
|
||||||
|
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ func (p *NamespaceTransformerPlugin) Transform(m resmap.ResMap) error {
|
|||||||
|
|
||||||
matches := m.GetMatchingResourcesByCurrentId(r.CurId().Equals)
|
matches := m.GetMatchingResourcesByCurrentId(r.CurId().Equals)
|
||||||
if len(matches) != 1 {
|
if len(matches) != 1 {
|
||||||
return fmt.Errorf("namespace tranformation produces ID conflict: %+v", matches)
|
return fmt.Errorf("namespace transformation produces ID conflict: %+v", matches)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
@@ -209,7 +209,7 @@ but they are functional.
|
|||||||
|
|
||||||
## Technical details
|
## Technical details
|
||||||
|
|
||||||
### Overall design and imlpementation
|
### Overall design and implementations
|
||||||
|
|
||||||
There are a few components that are all running together in order to get
|
There are a few components that are all running together in order to get
|
||||||
the overall application to work smoothly. This section will provide a brief
|
the overall application to work smoothly. This section will provide a brief
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
storage:
|
storage:
|
||||||
gcs:
|
gcs:
|
||||||
# the bucket must exist for the snapshot respository to be created successfully.
|
# the bucket must exist for the snapshot repository to be created successfully.
|
||||||
bucket: kustomize-backup
|
bucket: kustomize-backup
|
||||||
# the path does not need to exist.
|
# the path does not need to exist.
|
||||||
# If the path does not exist, the controller will create the folder in the GCS bucket.
|
# If the path does not exist, the controller will create the folder in the GCS bucket.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
Find all the trasnformer files whose `kinds` field includes `HelmValues`, and
|
Find all the transformer files whose `kinds` field includes `HelmValues`, and
|
||||||
only output certain fields of each document:
|
only output certain fields of each document:
|
||||||
```
|
```
|
||||||
curl -s -X GET "${ElasticSearchURL}:9200/${INDEXNAME}/_search?pretty" -H 'Content-Type: application/json' -d'
|
curl -s -X GET "${ElasticSearchURL}:9200/${INDEXNAME}/_search?pretty" -H 'Content-Type: application/json' -d'
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ cluster
|
|||||||
Resources (including configmap and secret generators)
|
Resources (including configmap and secret generators)
|
||||||
can _still be shared_ via the recommended best practice
|
can _still be shared_ via the recommended best practice
|
||||||
of placing them in a directory with their own
|
of placing them in a directory with their own
|
||||||
kustomization file, and refering to this directory as a
|
kustomization file, and referring to this directory as a
|
||||||
[`base`](glossary.md#base) from any kustomization that
|
[`base`](glossary.md#base) from any kustomization that
|
||||||
wants to use it. This encourages modularity and
|
wants to use it. This encourages modularity and
|
||||||
relocatability.
|
relocatability.
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ like adding labels or annotatations, get dedicated
|
|||||||
transformer plugins - `LabelTransformer`,
|
transformer plugins - `LabelTransformer`,
|
||||||
`AnnotationsTransformer`, etc.
|
`AnnotationsTransformer`, etc.
|
||||||
These accept relatively simple YAML configuration
|
These accept relatively simple YAML configuration
|
||||||
allowing easy targetting of any number of resources.
|
allowing easy targeting of any number of resources.
|
||||||
|
|
||||||
Another class of edits take data from one specific
|
Another class of edits take data from one specific
|
||||||
object's field and use it in another (e.g. a service
|
object's field and use it in another (e.g. a service
|
||||||
|
|||||||
@@ -206,7 +206,7 @@ See [field-name-replicas].
|
|||||||
### resources
|
### resources
|
||||||
|
|
||||||
Each entry in this list must be a path to a
|
Each entry in this list must be a path to a
|
||||||
_file_, or a path (or URL) refering to another
|
_file_, or a path (or URL) referring to another
|
||||||
kustomization _directory_, e.g.
|
kustomization _directory_, e.g.
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -273,9 +273,9 @@ more than one version).
|
|||||||
|
|
||||||
_kustomize_ is a command line tool supporting
|
_kustomize_ is a command line tool supporting
|
||||||
template-free, structured customization of declarative
|
template-free, structured customization of declarative
|
||||||
configuration targetted to k8s-style objects.
|
configuration targeted to k8s-style objects.
|
||||||
|
|
||||||
_Targetted to k8s means_ that kustomize has some
|
_Targeted to k8s means_ that kustomize has some
|
||||||
understanding of API resources, k8s concepts like
|
understanding of API resources, k8s concepts like
|
||||||
names, labels, namespaces, etc. and the semantics of
|
names, labels, namespaces, etc. and the semantics of
|
||||||
resource patching.
|
resource patching.
|
||||||
|
|||||||
@@ -209,7 +209,7 @@ a YAML file containing its configuration (the file name
|
|||||||
provided in the kustomization file).
|
provided in the kustomization file).
|
||||||
|
|
||||||
> TODO: restrictions on plugin to allow the _same exec
|
> TODO: restrictions on plugin to allow the _same exec
|
||||||
> plugin_ to be targetted by both the
|
> plugin_ to be targeted by both the
|
||||||
> `generators` and `transformers` fields.
|
> `generators` and `transformers` fields.
|
||||||
>
|
>
|
||||||
> - first arg could be the fixed string
|
> - first arg could be the fixed string
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ a7a2589e Fix yaml in generator examples.
|
|||||||
529db049 Introduce envs field.
|
529db049 Introduce envs field.
|
||||||
6d309b52 Introduce stacked transformers.
|
6d309b52 Introduce stacked transformers.
|
||||||
abf538d8 Keep backward compatibility for image transformer
|
abf538d8 Keep backward compatibility for image transformer
|
||||||
7e12918f Keep var refernce in resources
|
7e12918f Keep var references in resources
|
||||||
7130e3ff Leave defautconfig empty for images
|
7130e3ff Leave defautconfig empty for images
|
||||||
3e85c458 Load default config for image transformer
|
3e85c458 Load default config for image transformer
|
||||||
4162dbc2 Maintain resources in order loaded.
|
4162dbc2 Maintain resources in order loaded.
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ the _kustomize Go API_.
|
|||||||
|
|
||||||
[import path]: https://github.com/golang/go/wiki/Modules#releasing-modules-v2-or-higher
|
[import path]: https://github.com/golang/go/wiki/Modules#releasing-modules-v2-or-higher
|
||||||
|
|
||||||
In `kustomize/v3` (and preceeding major versions), the
|
In `kustomize/v3` (and preceding major versions), the
|
||||||
kustomize program and the API live the same Go
|
kustomize program and the API live the same Go
|
||||||
module at `sigs.k8s.io/kustomize`, at [import path]
|
module at `sigs.k8s.io/kustomize`, at [import path]
|
||||||
`sigs.k8s.io/kustomize/v3`.
|
`sigs.k8s.io/kustomize/v3`.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
# Demo: Inline Patch
|
# Demo: Inline Patch
|
||||||
|
|
||||||
A kustomization file supports patching in three ways:
|
A kustomization file supports patching in three ways:
|
||||||
- patchesStrategicMerge: A list of patch files where each file is parsed as a [Stragetic Merge Patch].
|
- patchesStrategicMerge: A list of patch files where each file is parsed as a [Strategic Merge Patch].
|
||||||
- patchesJSON6902: A list of patches and associated targetes, where each file is parsed as a [JSON Patch] and can only be applied to one target resource.
|
- patchesJSON6902: A list of patches and associated targetes, where each file is parsed as a [JSON Patch] and can only be applied to one target resource.
|
||||||
- patches: A list of patches and their associated targets. The patch can be applied to multiple objects. It auto detects whether the patch is a [Strategic Merge Patch] or [JSON Patch].
|
- patches: A list of patches and their associated targets. The patch can be applied to multiple objects. It auto detects whether the patch is a [Strategic Merge Patch] or [JSON Patch].
|
||||||
|
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ func (p *plugin) Transform(m resmap.ResMap) error {
|
|||||||
|
|
||||||
matches := m.GetMatchingResourcesByCurrentId(r.CurId().Equals)
|
matches := m.GetMatchingResourcesByCurrentId(r.CurId().Equals)
|
||||||
if len(matches) != 1 {
|
if len(matches) != 1 {
|
||||||
return fmt.Errorf("namespace tranformation produces ID conflict: %+v", matches)
|
return fmt.Errorf("namespace transformation produces ID conflict: %+v", matches)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
Reference in New Issue
Block a user