mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-07-17 09:49:13 +00:00
generate site
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<meta name="generator" content="Hugo 0.76.5" />
|
||||
<meta name="generator" content="Hugo 0.74.3" />
|
||||
|
||||
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
||||
|
||||
@@ -39,8 +39,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="preload" href="/kustomize/scss/main.min.0084926537b5667d9dea1d1fd692923ad85f8bcab133e53e7ec8af9ce8dd2ca5.css" as="style">
|
||||
<link href="/kustomize/scss/main.min.0084926537b5667d9dea1d1fd692923ad85f8bcab133e53e7ec8af9ce8dd2ca5.css" rel="stylesheet" integrity="">
|
||||
<link rel="preload" href="/kustomize/scss/main.min.818a933df0186c907f1faea6730835dd5fa01c3b53af36bb68396dc80a2d3c45.css" as="style">
|
||||
<link href="/kustomize/scss/main.min.818a933df0186c907f1faea6730835dd5fa01c3b53af36bb68396dc80a2d3c45.css" rel="stylesheet" integrity="">
|
||||
|
||||
|
||||
<script
|
||||
@@ -438,100 +438,8 @@
|
||||
<div class="td-content">
|
||||
<h1>Writing Code</h1>
|
||||
<div class="lead">How to modify Kustomize</div>
|
||||
|
||||
|
||||
<div class="pageinfo pageinfo-info">
|
||||
<p>To build kustomize using the locally modified modules, <code>replace</code> statements must be added to
|
||||
the <code>kustomize/go.mod</code>.</p>
|
||||
<p>e.g. if code in <code>api</code> was modified, a <code>replace</code> statement would need to be added for the
|
||||
<code>kustomize/api</code> module.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<p>Call stack when running <code>kustomize build</code>, with links to code.</p>
|
||||
<h2 id="run-build">Run build</h2>
|
||||
<ul>
|
||||
<li><a href="https://github.com/kubernetes-sigs/kustomize/blob/c7d78970fb86782dbdded3a93944b774f826071f/kustomize/internal/commands/build/build.go#L121">RunBuild</a>
|
||||
<ul>
|
||||
<li><a href="https://github.com/kubernetes-sigs/kustomize/blob/c7d78970fb86782dbdded3a93944b774f826071f/api/krusty/kustomizer.go#L32">MakeKustomizer</a></li>
|
||||
<li><a href="https://github.com/kubernetes-sigs/kustomize/blob/c7d78970fb86782dbdded3a93944b774f826071f/api/krusty/kustomizer.go#L47">Run</a>: performs a kustomization. It uses its internal filesystem reference to read the file at the given path argument, interpret it as a kustomization.yaml file, perform the kustomization it represents, and return the resulting resources.
|
||||
<ul>
|
||||
<li>Create factories
|
||||
<ul>
|
||||
<li><a href="https://github.com/kubernetes-sigs/kustomize/blob/c7d78970fb86782dbdded3a93944b774f826071f/api/internal/k8sdeps/transformer/factory.go#L17">tranformer.NewFactoryImpl</a></li>
|
||||
<li><a href="https://github.com/kubernetes-sigs/kustomize/blob/c7d78970fb86782dbdded3a93944b774f826071f/api/resmap/factory.go#L21">resmap.NewFactory</a>
|
||||
<ul>
|
||||
<li><a href="https://github.com/kubernetes-sigs/kustomize/blob/c7d78970fb86782dbdded3a93944b774f826071f/api/resource/factory.go#L23">resource.NewFactory</a>
|
||||
<ul>
|
||||
<li><a href="https://github.com/kubernetes-sigs/kustomize/blob/c7d78970fb86782dbdded3a93944b774f826071f/api/k8sdeps/kunstruct/factory.go#L28">kustruct.NewKunstructuredFactoryImpl</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="https://github.com/kubernetes-sigs/kustomize/blob/c7d78970fb86782dbdded3a93944b774f826071f/api/loader/loader.go#L19">loader.NewLoader</a></li>
|
||||
<li><a href="https://github.com/kubernetes-sigs/kustomize/blob/c7d78970fb86782dbdded3a93944b774f826071f/api/k8sdeps/validator/validators.go#L23">validator.NewKustValidator</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="https://github.com/kubernetes-sigs/kustomize/blob/c7d78970fb86782dbdded3a93944b774f826071f/api/internal/target/kusttarget.go#L38">NewKustTarget</a></li>
|
||||
<li><a href="https://github.com/kubernetes-sigs/kustomize/blob/c7d78970fb86782dbdded3a93944b774f826071f/api/internal/target/kusttarget.go#L54">Load</a></li>
|
||||
<li><a href="https://github.com/kubernetes-sigs/kustomize/blob/c7d78970fb86782dbdded3a93944b774f826071f/api/internal/target/kusttarget.go#L109">MakeCustomizeResMap</a>: details in next section</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="https://github.com/kubernetes-sigs/kustomize/blob/c7d78970fb86782dbdded3a93944b774f826071f/kustomize/internal/commands/build/build.go#L143">emitResources</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<h2 id="make-resource-map">Make resource map</h2>
|
||||
<ul>
|
||||
<li><a href="https://github.com/kubernetes-sigs/kustomize/blob/c7d78970fb86782dbdded3a93944b774f826071f/api/internal/target/kusttarget.go#L117">makeCustomizeResMap</a>
|
||||
<ul>
|
||||
<li><a href="https://github.com/kubernetes-sigs/kustomize/blob/c7d78970fb86782dbdded3a93944b774f826071f/api/internal/target/kusttarget.go#L196">AccumulateTarget</a>: returns a new ResAccumulator, holding customized resources and the data/rules used to do so. The name back references and vars are not yet fixed.
|
||||
<ul>
|
||||
<li><a href="https://github.com/kubernetes-sigs/kustomize/blob/c7d78970fb86782dbdded3a93944b774f826071f/api/internal/target/kusttarget.go#L302">accummulateResources</a>: fills the given resourceAccumulator with resources read from the given list of paths.</li>
|
||||
<li>Merge config from builtin and CRDs</li>
|
||||
<li><a href="https://github.com/kubernetes-sigs/kustomize/blob/c7d78970fb86782dbdded3a93944b774f826071f/api/internal/target/kusttarget.go#L239">runGenerators</a>
|
||||
<ul>
|
||||
<li><a href="https://github.com/kubernetes-sigs/kustomize/blob/c7d78970fb86782dbdded3a93944b774f826071f/api/internal/target/kusttarget_configplugin.go#L28">configureBuiltinGenerators</a>
|
||||
<ul>
|
||||
<li>ConfigMapGenerator</li>
|
||||
<li>SecretGenerator</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="">configureExternalGenerators</a></li>
|
||||
<li>Iterate all generators</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="https://github.com/kubernetes-sigs/kustomize/blob/c7d78970fb86782dbdded3a93944b774f826071f/api/internal/target/kusttarget.go#L274">runTransfomers</a>
|
||||
<ul>
|
||||
<li><a href="https://github.com/kubernetes-sigs/kustomize/blob/c7d78970fb86782dbdded3a93944b774f826071f/api/internal/target/kusttarget_configplugin.go#L44">configureBuiltinTransformers</a>
|
||||
<ul>
|
||||
<li>PatchStrategicMergeTransformer</li>
|
||||
<li>PatchTransformer</li>
|
||||
<li>NamespaceTransformer</li>
|
||||
<li>PrefixSuffixTransformer</li>
|
||||
<li>LabelTransformer</li>
|
||||
<li>AnnotationsTransformer</li>
|
||||
<li>PatchJson6902Transformer</li>
|
||||
<li>ReplicaCountTransformer</li>
|
||||
<li>ImageTagTransformer</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="https://github.com/kubernetes-sigs/kustomize/blob/c7d78970fb86782dbdded3a93944b774f826071f/api/internal/target/kusttarget.go#L291">configureExternalTransformers</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="https://github.com/kubernetes-sigs/kustomize/blob/c7d78970fb86782dbdded3a93944b774f826071f/api/internal/accumulator/resaccumulator.go#L64">MergeVars</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>The following steps must be done last, not as part of the recursion implicit in AccumulateTarget.
|
||||
<ul>
|
||||
<li><a href="https://github.com/kubernetes-sigs/kustomize/blob/c7d78970fb86782dbdded3a93944b774f826071f/api/internal/target/kusttarget.go#L153">addHashesToNames</a></li>
|
||||
<li><a href="https://github.com/kubernetes-sigs/kustomize/blob/c7d78970fb86782dbdded3a93944b774f826071f/api/internal/accumulator/resaccumulator.go#L160">FixBackReferences</a>: Given that names have changed (prefixs/suffixes added), fix all the back references to those names.</li>
|
||||
<li><a href="https://github.com/kubernetes-sigs/kustomize/blob/c7d78970fb86782dbdded3a93944b774f826071f/api/internal/accumulator/resaccumulator.go#L141">ResolveVars</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/zh/contributing/howitworks/" />
|
||||
<p>Moved to <a href="https://github.com/kubernetes-sigs/cli-experimental">https://github.com/kubernetes-sigs/cli-experimental</a></p>
|
||||
|
||||
<div class="section-index">
|
||||
|
||||
@@ -561,7 +469,7 @@ the <code>kustomize/go.mod</code>.</p>
|
||||
|
||||
|
||||
|
||||
<div class="text-muted mt-5 pt-3 border-top">最后修改 2020年07月16日: <a href="https://github.com/kubernetes-sigs/kustomize/commit/f9ee578aed600136133c3232fff03029cdfc526e">Docs: Auto-fix markdownlint issues (f9ee578a)</a>
|
||||
<div class="text-muted mt-5 pt-3 border-top">最后修改 2020年11月25日: <a href="https://github.com/kubernetes-sigs/kustomize/commit/14eac6020f43cd07a86722f5e937ae8c75873e43">remove duplicate contents and redirect (14eac602)</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user