mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-09-15 12:18:57 +00:00
update docs site
This commit is contained in:
@@ -702,37 +702,6 @@
|
||||
|
||||
|
||||
|
||||
<nav id="TableOfContents">
|
||||
<ul>
|
||||
<li><a href="#application">application</a></li>
|
||||
<li><a href="#apply">apply</a></li>
|
||||
<li><a href="#base">base</a></li>
|
||||
<li><a href="#bespoke-configuration">bespoke configuration</a></li>
|
||||
<li><a href="#custom-resource-definition">custom resource definition</a></li>
|
||||
<li><a href="#declarative-application-management">declarative application management</a></li>
|
||||
<li><a href="#generator">generator</a></li>
|
||||
<li><a href="#gitops">gitops</a></li>
|
||||
<li><a href="#kustomization">kustomization</a></li>
|
||||
<li><a href="#kustomization-root">kustomization root</a></li>
|
||||
<li><a href="#kubernetes">kubernetes</a></li>
|
||||
<li><a href="#kubernetes-style-object">kubernetes-style object</a></li>
|
||||
<li><a href="#kustomize">kustomize</a></li>
|
||||
<li><a href="#off-the-shelf-configuration">off-the-shelf configuration</a></li>
|
||||
<li><a href="#overlay">overlay</a></li>
|
||||
<li><a href="#package">package</a></li>
|
||||
<li><a href="#patch">patch</a></li>
|
||||
<li><a href="#patchstrategicmerge">patchStrategicMerge</a></li>
|
||||
<li><a href="#patchjson6902">patchJson6902</a></li>
|
||||
<li><a href="#plugin">plugin</a></li>
|
||||
<li><a href="#resource">resource</a></li>
|
||||
<li><a href="#root">root</a></li>
|
||||
<li><a href="#sub-target--sub-application--sub-package">sub-target / sub-application / sub-package</a></li>
|
||||
<li><a href="#target">target</a></li>
|
||||
<li><a href="#transformer">transformer</a></li>
|
||||
<li><a href="#variant">variant</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
@@ -769,331 +738,6 @@
|
||||
<h1>Glossary</h1>
|
||||
<div class="lead">Glossary of terms</div>
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/references/kustomize/glossary/" />
|
||||
<h1 id="glossary">Glossary</h1>
|
||||
<h2 id="application">application</h2>
|
||||
<p>An <em>application</em> is a group of k8s resources related by
|
||||
some common purpose, e.g. a load balancer in front of a
|
||||
webserver backed by a database.
|
||||
<a href="#resource">Resource</a> labelling, naming and metadata schemes have
|
||||
historically served to group resources together for
|
||||
collective operations like <em>list</em> and <em>remove</em>.</p>
|
||||
<p>This <a href="https://github.com/kubernetes/community/pull/1629">proposal</a> describes a new k8s resource called
|
||||
<em>application</em> to more formally describe this idea and
|
||||
provide support for application-level operations and
|
||||
dashboards.</p>
|
||||
<p><a href="#kustomize">kustomize</a> configures k8s resources, and the proposed
|
||||
application resource is just another resource.</p>
|
||||
<h2 id="apply">apply</h2>
|
||||
<p>The verb <em>apply</em> in the context of k8s refers to a
|
||||
kubectl command and an in-progress <a href="https://goo.gl/UbCRuf">API
|
||||
endpoint</a> for mutating a
|
||||
cluster.</p>
|
||||
<p>One <em>applies</em> a statement of what one wants to a
|
||||
cluster in the form of a complete resource list.</p>
|
||||
<p>The cluster merges this with the previously applied
|
||||
state and the actual state to arrive at a new desired
|
||||
state, which the cluster’s reconciliation loop attempts
|
||||
to create. This is the foundation of level-based state
|
||||
management in k8s.</p>
|
||||
<h2 id="base">base</h2>
|
||||
<p>A <em>base</em> is a <a href="#kustomization">kustomization</a> referred to
|
||||
by some other <a href="#kustomization">kustomization</a>.</p>
|
||||
<p>Any kustomization, including an <a href="#overlay">overlay</a>, can be a base to
|
||||
another kustomization.</p>
|
||||
<p>A base has no knowledge of the overlays that refer to it.</p>
|
||||
<p>For simple <a href="#gitops">gitops</a> management, a base configuration
|
||||
could be the <em>sole content of a git repository
|
||||
dedicated to that purpose</em>. Same with <a href="#overlay">overlays</a>.
|
||||
Changes in a repo could generate a build, test and
|
||||
deploy cycle.</p>
|
||||
<h2 id="bespoke-configuration">bespoke configuration</h2>
|
||||
<p>A <em>bespoke</em> configuration is a <a href="#kustomization">kustomization</a> and some
|
||||
<a href="#resource">resources</a> created and maintained internally by some
|
||||
organization for their own purposes.</p>
|
||||
<p>The <a href="/kustomize/guides">workflow</a> associated with a <em>bespoke</em> config is
|
||||
simpler than the workflow associated with an
|
||||
<a href="#off-the-shelf-configuration">off-the-shelf</a> config, because there’s no notion of
|
||||
periodically capturing someone else’s upgrades to the
|
||||
<a href="#off-the-shelf-configuration">off-the-shelf</a> config.</p>
|
||||
<h2 id="custom-resource-definition">custom resource definition</h2>
|
||||
<p>One can extend the k8s API by making a
|
||||
Custom Resource Definition (<a href="https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/">CRD spec</a>).</p>
|
||||
<p>This defines a custom <a href="#resource">resource</a> (CD), an entirely
|
||||
new resource that can be used alongside <em>native</em>
|
||||
resources like ConfigMaps, Deployments, etc.</p>
|
||||
<p>Kustomize can customize a CD, but to do so
|
||||
kustomize must also be given the corresponding CRD
|
||||
so that it can interpret the structure correctly.</p>
|
||||
<h2 id="declarative-application-management">declarative application management</h2>
|
||||
<p>Kustomize aspires to support <a href="https://github.com/kubernetes/community/blob/master/contributors/design-proposals/architecture/declarative-application-management.md">Declarative Application Management</a>,
|
||||
a set of best practices around managing k8s clusters.</p>
|
||||
<p>In brief, kustomize should</p>
|
||||
<ul>
|
||||
<li>Work with any configuration, be it bespoke,
|
||||
off-the-shelf, stateless, stateful, etc.</li>
|
||||
<li>Support common customizations, and creation of
|
||||
<a href="#variant">variants</a> (e.g. <em>development</em> vs.
|
||||
<em>staging</em> vs. <em>production</em>).</li>
|
||||
<li>Expose and teach native k8s APIs, rather than
|
||||
hide them.</li>
|
||||
<li>Add no friction to version control integration to
|
||||
support reviews and audit trails.</li>
|
||||
<li>Compose with other tools in a unix sense.</li>
|
||||
<li>Eschew crossing the line into templating, domain
|
||||
specific languages, etc., frustrating the other
|
||||
goals.</li>
|
||||
</ul>
|
||||
<h2 id="generator">generator</h2>
|
||||
<p>A generator makes resources that can be used as is,
|
||||
or fed into a <a href="#transformer">transformer</a>.</p>
|
||||
<h2 id="gitops">gitops</h2>
|
||||
<p>Devops or CICD workflows that use a git repository as a
|
||||
single source of truth and take action (e.g., build,
|
||||
test or deploy) when that truth changes.</p>
|
||||
<h2 id="kustomization">kustomization</h2>
|
||||
<p>The term <em>kustomization</em> refers to a
|
||||
<code>kustomization.yaml</code> file, or more generally to a
|
||||
directory (the <a href="#kustomization-root">root</a>) containing the
|
||||
<code>kustomization.yaml</code> file and all the relative file
|
||||
paths that it immediately references (all the local
|
||||
data that doesn’t require a URL specification).</p>
|
||||
<p>I.e. if someone gives you a <em>kustomization</em> for use
|
||||
with <a href="#kustomize">kustomize</a>, it could be in the form of</p>
|
||||
<ul>
|
||||
<li>one file called <code>kustomization.yaml</code>,</li>
|
||||
<li>a tarball (containing that YAML file plus what it references),</li>
|
||||
<li>a git archive (ditto),</li>
|
||||
<li>a URL to a git repo (ditto), etc.</li>
|
||||
</ul>
|
||||
<p>A kustomization file contains <a href="fields.md">fields</a>
|
||||
falling into four categories:</p>
|
||||
<ul>
|
||||
<li>
|
||||
<p><em>resources</em> - what existing <a href="#resource">resources</a> are to be customized.
|
||||
Example fields: <em>resources</em>, <em>crds</em>.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><em>generators</em> - what <em>new</em> resources should be created.
|
||||
Example fields: <em>configMapGenerator</em> (legacy),
|
||||
<em>secretGenerator</em> (legacy), <em>generators</em> (v2.1).</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><em>transformers</em> - what to <em>do</em> to the aforementioned resources.
|
||||
Example fields: <em>namePrefix</em>, <em>nameSuffix</em>, <em>images</em>,
|
||||
<em>commonLabels</em>, <em>patchesJson6902</em>, etc. and the more
|
||||
general <em>transformers</em> (v2.1) field.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><em>meta</em> - fields which may influence all or some of
|
||||
the above. Example fields: <em>vars</em>, <em>namespace</em>,
|
||||
<em>apiVersion</em>, <em>kind</em>, etc.</p>
|
||||
</li>
|
||||
</ul>
|
||||
<h2 id="kustomization-root">kustomization root</h2>
|
||||
<p>The directory that immediately contains a
|
||||
<code>kustomization.yaml</code> file.</p>
|
||||
<p>When a kustomization file is processed, it may or may
|
||||
not be able to access files outside its root.</p>
|
||||
<p>Data files like resource YAML files, or text files
|
||||
containing <em>name=value</em> pairs intended for a ConfigMap
|
||||
or Secret, or files representing a patch to be used in
|
||||
a patch transformation, must live <em>within or below</em> the
|
||||
root, and as such are specified via <em>relative
|
||||
paths</em> exclusively.</p>
|
||||
<p>A special flag (in v2.1), <code>--load_restrictions none</code>,
|
||||
is provided to relax this security feature, to, say,
|
||||
allow a patch file to be shared by more than one
|
||||
kustomization.</p>
|
||||
<p>Other kustomizations (other directories containing a
|
||||
<code>kustomization.yaml</code> file) may be referred to by URL, by
|
||||
absolute path, or by relative path.</p>
|
||||
<p>If kustomization <strong>A</strong> depends on kustomization <strong>B</strong>, then</p>
|
||||
<ul>
|
||||
<li><strong>B</strong> may not <em>contain</em> <strong>A</strong>.</li>
|
||||
<li><strong>B</strong> may not <em>depend on</em> <strong>A</strong>, even transitively.</li>
|
||||
</ul>
|
||||
<p><strong>A</strong> may contain <strong>B</strong>, but in this case it might be
|
||||
simplest to have <strong>A</strong> directly depend on <strong>B</strong>’s
|
||||
resources and eliminate <strong>B</strong>’s kustomization.yaml file
|
||||
(i.e. absorb <strong>B</strong> into <strong>A</strong>).</p>
|
||||
<p>Conventionally, <strong>B</strong> is in a directory that’s sibling
|
||||
to <strong>A</strong>, or <strong>B</strong> is off in a completely independent
|
||||
git repository, referencable from any kustomization.</p>
|
||||
<p>A common layout is</p>
|
||||
<blockquote>
|
||||
<pre><code>├── base
|
||||
│ ├── deployment.yaml
|
||||
│ ├── kustomization.yaml
|
||||
│ └── service.yaml
|
||||
└── overlays
|
||||
├── dev
|
||||
│ ├── kustomization.yaml
|
||||
│ └── patch.yaml
|
||||
├── prod
|
||||
│ ├── kustomization.yaml
|
||||
│ └── patch.yaml
|
||||
└── staging
|
||||
├── kustomization.yaml
|
||||
└── patch.yaml
|
||||
</code></pre></blockquote>
|
||||
<p>The three roots <code>dev</code>, <code>prod</code> and <code>staging</code>
|
||||
(presumably) all refer to the <code>base</code> root. One would
|
||||
have to inspect the <code>kustomization.yaml</code> files to be
|
||||
sure.</p>
|
||||
<h2 id="kubernetes">kubernetes</h2>
|
||||
<p><a href="https://kubernetes.io">Kubernetes</a> is an open-source
|
||||
system for automating deployment, scaling, and
|
||||
management of containerized applications.</p>
|
||||
<p>It’s often abbreviated as <em>k8s</em>.</p>
|
||||
<h2 id="kubernetes-style-object">kubernetes-style object</h2>
|
||||
<p>An object, expressed in a YAML or JSON file, with the
|
||||
<a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/#required-fields">fields required</a> by kubernetes. Basically just a
|
||||
<em>kind</em> field to identify the type, a <em>metadata/name</em>
|
||||
field to identify the particular instance, and an
|
||||
<em>apiVersion</em> field to identify the version (if there’s
|
||||
more than one version).</p>
|
||||
<h2 id="kustomize">kustomize</h2>
|
||||
<p><em>kustomize</em> is a command line tool supporting
|
||||
template-free, structured customization of declarative
|
||||
configuration targeted to k8s-style objects.</p>
|
||||
<p><em>Targeted to k8s means</em> that kustomize has some
|
||||
understanding of API resources, k8s concepts like
|
||||
names, labels, namespaces, etc. and the semantics of
|
||||
resource patching.</p>
|
||||
<p>kustomize is an implementation of <a href="#declarative-application-management">DAM</a>.</p>
|
||||
<h2 id="off-the-shelf-configuration">off-the-shelf configuration</h2>
|
||||
<p>An <em>off-the-shelf</em> configuration is a kustomization and
|
||||
resources intentionally published somewhere for others
|
||||
to use.</p>
|
||||
<p>E.g. one might create a github repository like this:</p>
|
||||
<blockquote>
|
||||
<pre><code>github.com/username/someapp/
|
||||
kustomization.yaml
|
||||
deployment.yaml
|
||||
configmap.yaml
|
||||
README.md
|
||||
</code></pre></blockquote>
|
||||
<p>Someone could then <em>fork</em> this repo (on github) and
|
||||
<em>clone</em> their fork to their local disk for
|
||||
customization.</p>
|
||||
<p>This clone could act as a <a href="#base">base</a> for the user’s
|
||||
own <a href="#overlay">overlays</a> to do further customization.</p>
|
||||
<h2 id="overlay">overlay</h2>
|
||||
<p>An <em>overlay</em> is a kustomization that depends on
|
||||
another kustomization.</p>
|
||||
<p>The <a href="#kustomization">kustomizations</a> an overlay refers to (via file
|
||||
path, URI or other method) are called <a href="#base">bases</a>.</p>
|
||||
<p>An overlay is unusable without its bases.</p>
|
||||
<p>An overlay may act as a base to another overlay.</p>
|
||||
<p>Overlays make the most sense when there is <em>more than
|
||||
one</em>, because they create different <a href="#variant">variants</a> of a
|
||||
common base - e.g. <em>development</em>, <em>QA</em>, <em>staging</em> and
|
||||
<em>production</em> environment variants.</p>
|
||||
<p>These variants use the same overall resources, and vary
|
||||
in relatively simple ways, e.g. the number of replicas
|
||||
in a deployment, the CPU to a particular pod, the data
|
||||
source used in a ConfigMap, etc.</p>
|
||||
<p>One configures a cluster like this:</p>
|
||||
<blockquote>
|
||||
<pre><code> kustomize build someapp/overlays/staging |\
|
||||
kubectl apply -f -
|
||||
|
||||
kustomize build someapp/overlays/production |\
|
||||
kubectl apply -f -
|
||||
</code></pre></blockquote>
|
||||
<p>Usage of the base is implicit - the overlay’s
|
||||
kustomization points to the base.</p>
|
||||
<p>See also <a href="#kustomization-root">root</a>.</p>
|
||||
<h2 id="package">package</h2>
|
||||
<p>The word <em>package</em> has no meaning in kustomize, as
|
||||
kustomize is not to be confused with a package
|
||||
management tool in the tradition of, say, <a href="https://en.wikipedia.org/wiki/APT_(Debian)">apt</a> or
|
||||
<a href="https://en.wikipedia.org/wiki/Rpm_(software)">rpm</a>.</p>
|
||||
<h2 id="patch">patch</h2>
|
||||
<p>General instructions to modify a resource.</p>
|
||||
<p>There are two alternative techniques with similar
|
||||
power but different notation - the
|
||||
<a href="#patchstrategicmerge">strategic merge patch</a>
|
||||
and the <a href="#patchjson6902">JSON patch</a>.</p>
|
||||
<h2 id="patchstrategicmerge">patchStrategicMerge</h2>
|
||||
<p>A <em>patchStrategicMerge</em> is <a href="https://git.k8s.io/community/contributors/devel/sig-api-machinery/strategic-merge-patch.md">strategic-merge</a>-style patch (SMP).</p>
|
||||
<p>An SMP looks like an incomplete YAML specification of
|
||||
a k8s resource. The SMP includes <code>TypeMeta</code>
|
||||
fields to establish the group/version/kind/name of the
|
||||
<a href="#resource">resource</a> to patch, then just enough remaining fields
|
||||
to step into a nested structure to specify a new field
|
||||
value, e.g. an image tag.</p>
|
||||
<p>By default, an SMP <em>replaces</em> values. This is
|
||||
usually desired when the target value is a simple
|
||||
string, but may not be desired when the target
|
||||
value is a list.</p>
|
||||
<p>To change this
|
||||
default behavior, add a <em>directive</em>. Recognized
|
||||
directives in YAML patches are <em>replace</em> (the default)
|
||||
and <em>delete</em> (see <a href="https://git.k8s.io/community/contributors/devel/sig-api-machinery/strategic-merge-patch.md">these notes</a>).</p>
|
||||
<p>Note that for custom resources, SMPs are treated as
|
||||
<a href="https://tools.ietf.org/html/rfc7386">json merge patches</a>.</p>
|
||||
<p>Fun fact - any resource file can be used as
|
||||
an SMP, overwriting matching fields in another
|
||||
resource with the same group/version/kind/name,
|
||||
but leaving all other fields as they were.</p>
|
||||
<p>TODO(monopole): add ptr to example.</p>
|
||||
<h2 id="patchjson6902">patchJson6902</h2>
|
||||
<p>A <em>patchJson6902</em> refers to a kubernetes <a href="#resource">resource</a> and
|
||||
a <a href="https://tools.ietf.org/html/rfc6902">JSONPatch</a> specifying how to change the resource.</p>
|
||||
<p>A <em>patchJson6902</em> can do almost everything a
|
||||
<em>patchStrategicMerge</em> can do, but with a briefer
|
||||
syntax. See this <a href="https://github.com/kubernetes-sigs/kustomize/tree/master/examples/jsonpatch.md">example</a>.</p>
|
||||
<h2 id="plugin">plugin</h2>
|
||||
<p>A chunk of code used by kustomize, but not necessarily
|
||||
compiled into kustomize, to generate and/or transform a
|
||||
kubernetes resource as part of a kustomization.</p>
|
||||
<p>Details <a href="../../guides/plugins">here</a>.</p>
|
||||
<h2 id="resource">resource</h2>
|
||||
<p>A <em>resource</em> in the context of a REST-ful API is the
|
||||
target object of an HTTP operation like <em>GET</em>, <em>PUT</em> or
|
||||
<em>POST</em>. k8s offers a REST-ful API surface to interact
|
||||
with clients.</p>
|
||||
<p>A <em>resource</em>, in the context of a kustomization, is a
|
||||
<a href="#kustomization-root">root</a> relative path to a <a href="http://www.yaml.org/start.html">YAML</a> or <a href="https://www.json.org/">JSON</a> file
|
||||
describing a k8s API object, like a Deployment or a
|
||||
ConfigMap, or it’s a path to a kustomization, or a URL
|
||||
that resolves to a kustomization.</p>
|
||||
<p>More generally, a resource can be any correct YAML file
|
||||
that <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/#required-fields">defines an object</a>
|
||||
with a <em>kind</em> and a <em>metadata/name</em> field.</p>
|
||||
<h2 id="root">root</h2>
|
||||
<p>See <a href="#kustomization-root">kustomization root</a>.</p>
|
||||
<h2 id="sub-target--sub-application--sub-package">sub-target / sub-application / sub-package</h2>
|
||||
<p>A <em>sub-whatever</em> is not a thing. There are only
|
||||
<a href="#base">bases</a> and <a href="#overlay">overlays</a>.</p>
|
||||
<h2 id="target">target</h2>
|
||||
<p>The <em>target</em> is the argument to <code>kustomize build</code>, e.g.:</p>
|
||||
<blockquote>
|
||||
<pre><code> kustomize build $target
|
||||
</code></pre></blockquote>
|
||||
<p><code>$target</code> must be a path or a url to a <a href="#kustomization">kustomization</a>.</p>
|
||||
<p>The target contains, or refers to, all the information
|
||||
needed to create customized resources to send to the
|
||||
<a href="#apply">apply</a> operation.</p>
|
||||
<p>A target can be a <a href="#base">base</a> or an <a href="#overlay">overlay</a>.</p>
|
||||
<h2 id="transformer">transformer</h2>
|
||||
<p>A transformer can modify a resource, or merely
|
||||
visit it and collect information about it in the
|
||||
course of a <code>kustomize build</code>.</p>
|
||||
<h2 id="variant">variant</h2>
|
||||
<p>A <em>variant</em> is the outcome, in a cluster, of applying
|
||||
an <a href="#overlay">overlay</a> to a <a href="#base">base</a>.</p>
|
||||
<p>E.g., a <em>staging</em> and <em>production</em> overlay both modify
|
||||
some common base to create distinct variants.</p>
|
||||
<p>The <em>staging</em> variant is the set of resources exposed
|
||||
to quality assurance testing, or to some external users
|
||||
who’d like to see what the next version of production
|
||||
will look like.</p>
|
||||
<p>The <em>production</em> variant is the set of resources
|
||||
exposed to production traffic, and thus may employ
|
||||
deployments with a large number of replicas and higher
|
||||
cpu and memory requests.</p>
|
||||
|
||||
<div class="section-index">
|
||||
|
||||
@@ -1149,7 +793,7 @@ cpu and memory requests.</p>
|
||||
|
||||
|
||||
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 4, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/0834e152b203ffeccfbbf1ddd3c1f49debdac341">Redirect kustomize docs to the new unified site. (0834e152)</a>
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 11, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/71b763888cad614abb44b3086e291fe72d601080">Remove duplicate kustomize docs content (71b76388)</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -728,6 +728,8 @@
|
||||
<h1>API Reference</h1>
|
||||
<div class="lead">Reference for Kustomize client-side APIs</div>
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/references/kustomize/" />
|
||||
<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">
|
||||
|
||||
|
||||
@@ -796,7 +798,7 @@
|
||||
|
||||
|
||||
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 4, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/0834e152b203ffeccfbbf1ddd3c1f49debdac341">Redirect kustomize docs to the new unified site. (0834e152)</a>
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 11, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/71b763888cad614abb44b3086e291fe72d601080">Remove duplicate kustomize docs content (71b76388)</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -748,17 +748,7 @@
|
||||
<h1>bases</h1>
|
||||
<div class="lead">Add resources from a kustomization dir.</div>
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/references/kustomize/bases/" />
|
||||
|
||||
|
||||
<div class="pageinfo pageinfo-warning">
|
||||
<p>The <code>bases</code> field was deprecated in v2.1.0</p>
|
||||
|
||||
</div>
|
||||
|
||||
<p>Move entries into the <a href="/kustomize/api-reference/kustomization/resources">resources</a>
|
||||
field. This allows bases - which are still a
|
||||
<a href="/kustomize/api-reference/glossary#base">central concept</a> - to be
|
||||
ordered relative to other input resources.</p>
|
||||
<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">
|
||||
|
||||
@@ -814,7 +804,7 @@ ordered relative to other input resources.</p>
|
||||
|
||||
|
||||
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 4, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/0834e152b203ffeccfbbf1ddd3c1f49debdac341">Redirect kustomize docs to the new unified site. (0834e152)</a>
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 11, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/71b763888cad614abb44b3086e291fe72d601080">Remove duplicate kustomize docs content (71b76388)</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -702,17 +702,6 @@
|
||||
|
||||
|
||||
|
||||
<nav id="TableOfContents">
|
||||
<ul>
|
||||
<li><a href="#example">Example</a>
|
||||
<ul>
|
||||
<li><a href="#file-input">File Input</a></li>
|
||||
<li><a href="#build-output">Build Output</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
@@ -759,41 +748,8 @@
|
||||
<h1>commonAnnotations</h1>
|
||||
<div class="lead">Add annotations to all resources.</div>
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/references/kustomize/commonannotations/" />
|
||||
<p>Add annotations to all resources. If the annotation key is already present on the resource,
|
||||
the value will be overridden.</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kustomize.config.k8s.io/v1beta1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Kustomization</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">commonAnnotations</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">oncallPager</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#0000cf;font-weight:bold">800-555-1212</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><h2 id="example">Example</h2>
|
||||
<h3 id="file-input">File Input</h3>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#8f5902;font-style:italic"># kustomization.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kustomize.config.k8s.io/v1beta1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Kustomization</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">commonAnnotations</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">oncallPager</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#0000cf;font-weight:bold">800-555-1212</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">resources</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#000">deploy.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#8f5902;font-style:italic"># deploy.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">apps/v1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Deployment</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">example</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">...</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><h3 id="build-output">Build Output</h3>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">apps/v1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Deployment</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">example</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">annotations</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">oncallPager</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#0000cf;font-weight:bold">800-555-1212</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">...</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div>
|
||||
<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">
|
||||
|
||||
|
||||
@@ -848,7 +804,7 @@ the value will be overridden.</p>
|
||||
|
||||
|
||||
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 4, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/0834e152b203ffeccfbbf1ddd3c1f49debdac341">Redirect kustomize docs to the new unified site. (0834e152)</a>
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 11, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/71b763888cad614abb44b3086e291fe72d601080">Remove duplicate kustomize docs content (71b76388)</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -702,17 +702,6 @@
|
||||
|
||||
|
||||
|
||||
<nav id="TableOfContents">
|
||||
<ul>
|
||||
<li><a href="#example">Example</a>
|
||||
<ul>
|
||||
<li><a href="#file-input">File Input</a></li>
|
||||
<li><a href="#build-output">Build Output</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
@@ -759,84 +748,8 @@
|
||||
<h1>commonLabels</h1>
|
||||
<div class="lead">Add labels and selectors to add all resources.</div>
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/references/kustomize/commonlabels/" />
|
||||
<p>Add labels and selectors to all resources. If the label key already is present on the resource,
|
||||
the value will be overridden.</p>
|
||||
<p>Moved to <a href="https://github.com/kubernetes-sigs/cli-experimental">https://github.com/kubernetes-sigs/cli-experimental</a></p>
|
||||
|
||||
|
||||
<div class="pageinfo pageinfo-warning">
|
||||
<p>Selectors for resources such as Deployments and Services shouldn’t be changed once the
|
||||
resource has been applied to a cluster.</p>
|
||||
<p>Changing commonLabels to live resources could result in failures.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kustomize.config.k8s.io/v1beta1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Kustomization</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">commonLabels</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">someName</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">someValue</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">owner</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">alice</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">app</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">bingo</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><h2 id="example">Example</h2>
|
||||
<h3 id="file-input">File Input</h3>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#8f5902;font-style:italic"># kustomization.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kustomize.config.k8s.io/v1beta1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Kustomization</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">commonLabels</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">someName</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">someValue</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">owner</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">alice</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">app</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">bingo</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">resources</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#000">deploy.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#000">service.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#8f5902;font-style:italic"># deploy.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">apps/v1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Deployment</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">example</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#8f5902;font-style:italic"># service.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">example</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><h3 id="build-output">Build Output</h3>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">labels</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">app</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">bingo</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">owner</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">alice</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">someName</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">someValue</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">example</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">selector</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">app</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">bingo</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">owner</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">alice</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">someName</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">someValue</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#000">---</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">apps/v1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Deployment</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">labels</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">app</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">bingo</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">owner</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">alice</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">someName</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">someValue</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">example</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">selector</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">matchLabels</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">app</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">bingo</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">owner</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">alice</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">someName</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">someValue</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">template</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">labels</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">app</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">bingo</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">owner</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">alice</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">someName</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">someValue</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div>
|
||||
<div class="section-index">
|
||||
|
||||
|
||||
@@ -891,7 +804,7 @@ resource has been applied to a cluster.</p>
|
||||
|
||||
|
||||
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 4, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/0834e152b203ffeccfbbf1ddd3c1f49debdac341">Redirect kustomize docs to the new unified site. (0834e152)</a>
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 11, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/71b763888cad614abb44b3086e291fe72d601080">Remove duplicate kustomize docs content (71b76388)</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -748,7 +748,7 @@
|
||||
<h1>components</h1>
|
||||
<div class="lead">Compose kustomizations.</div>
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/references/kustomize/components/" />
|
||||
<p><em>Coming soon</em></p>
|
||||
<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">
|
||||
|
||||
@@ -804,7 +804,7 @@
|
||||
|
||||
|
||||
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 4, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/0834e152b203ffeccfbbf1ddd3c1f49debdac341">Redirect kustomize docs to the new unified site. (0834e152)</a>
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 11, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/71b763888cad614abb44b3086e291fe72d601080">Remove duplicate kustomize docs content (71b76388)</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -748,79 +748,8 @@
|
||||
<h1>configMapGenerator</h1>
|
||||
<div class="lead">Generate ConfigMap resources.</div>
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/references/kustomize/configmapgenerator/" />
|
||||
<p>Each entry in this list results in the creation of
|
||||
one ConfigMap resource (it’s a generator of n maps).</p>
|
||||
<p>The example below creates four ConfigMaps:</p>
|
||||
<ul>
|
||||
<li>first, with the names and contents of the given files</li>
|
||||
<li>second, with key/value as data using key/value pairs from files</li>
|
||||
<li>third, also with key/value as data, directly specified using <code>literals</code></li>
|
||||
<li>and a fourth, which sets an annotation and label via <code>options</code> for that single ConfigMap</li>
|
||||
</ul>
|
||||
<p>Each configMapGenerator item accepts a parameter of
|
||||
<code>behavior: [create|replace|merge]</code>.
|
||||
This allows an overlay to modify or
|
||||
replace an existing configMap from the parent.</p>
|
||||
<p>Also, each entry has an <code>options</code> field, that has the
|
||||
same subfields as the kustomization file’s <code>generatorOptions</code> field.</p>
|
||||
<p>This <code>options</code> field allows one to add labels and/or
|
||||
annotations to the generated instance, or to individually
|
||||
disable the name suffix hash for that instance.
|
||||
Labels and annotations added here will not be overwritten
|
||||
by the global options associated with the kustomization
|
||||
file <code>generatorOptions</code> field. However, due to how
|
||||
booleans behave, if the global <code>generatorOptions</code> field
|
||||
specifies <code>disableNameSuffixHash: true</code>, this will
|
||||
trump any attempt to locally override it.</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kustomize.config.k8s.io/v1beta1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Kustomization</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#8f5902;font-style:italic"># These labels are added to all configmaps and secrets.</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">generatorOptions</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">labels</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">fruit</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">apple</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">configMapGenerator</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">my-java-server-props</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">behavior</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">merge</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">files</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#000">application.properties</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#000">more.properties</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">my-java-server-env-file-vars</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">envs</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#000">my-server-env.properties</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#000">more-server-props.env</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">my-java-server-env-vars</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">literals</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#000">JAVA_HOME=/opt/java/jdk</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#000">JAVA_TOOL_OPTIONS=-agentlib:hprof</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">options</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">disableNameSuffixHash</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">true</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">labels</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">pet</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">dog</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">dashboards</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">files</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#000">mydashboard.json</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">options</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">annotations</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">dashboard</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">"1"</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">labels</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">app.kubernetes.io/name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">"app1"</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><p>It is also possible to
|
||||
<a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/#define-the-key-to-use-when-creating-a-configmap-from-a-file">define a key</a>
|
||||
to set a name different than the filename.</p>
|
||||
<p>The example below creates a ConfigMap
|
||||
with the name of file as <code>myFileName.ini</code>
|
||||
while the <em>actual</em> filename from which the
|
||||
configmap is created is <code>whatever.ini</code>.</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kustomize.config.k8s.io/v1beta1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Kustomization</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">configMapGenerator</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">app-whatever</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">files</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#000">myFileName.ini=whatever.ini</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div>
|
||||
<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">
|
||||
|
||||
|
||||
@@ -875,7 +804,7 @@ configmap is created is <code>whatever.ini</code>.</p>
|
||||
|
||||
|
||||
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 4, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/0834e152b203ffeccfbbf1ddd3c1f49debdac341">Redirect kustomize docs to the new unified site. (0834e152)</a>
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 11, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/71b763888cad614abb44b3086e291fe72d601080">Remove duplicate kustomize docs content (71b76388)</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -748,34 +748,8 @@
|
||||
<h1>crds</h1>
|
||||
<div class="lead">Adding CRD support</div>
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/references/kustomize/crds/" />
|
||||
<p>Each entry in this list should be a relative path to
|
||||
a file for custom resource definition (CRD).</p>
|
||||
<p>The presence of this field is to allow kustomize be
|
||||
aware of CRDs and apply proper
|
||||
transformation for any objects in those types.</p>
|
||||
<p>Typical use case: A CRD object refers to a
|
||||
ConfigMap object. In a kustomization, the ConfigMap
|
||||
object name may change by adding namePrefix,
|
||||
nameSuffix, or hashing. The name reference for this
|
||||
ConfigMap object in CRD object need to be updated
|
||||
with namePrefix, nameSuffix, or hashing in the
|
||||
same way.</p>
|
||||
<p>The annotations can be put into openAPI definitions are:</p>
|
||||
<ul>
|
||||
<li>“x-kubernetes-annotation”: ""</li>
|
||||
<li>“x-kubernetes-label-selector”: ""</li>
|
||||
<li>“x-kubernetes-identity”: ""</li>
|
||||
<li>“x-kubernetes-object-ref-api-version”: “v1”,</li>
|
||||
<li>“x-kubernetes-object-ref-kind”: “Secret”,</li>
|
||||
<li>“x-kubernetes-object-ref-name-key”: “name”,</li>
|
||||
</ul>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kustomize.config.k8s.io/v1beta1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Kustomization</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">crds</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#000">crds/typeA.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#000">crds/typeB.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div>
|
||||
<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">
|
||||
|
||||
|
||||
@@ -830,7 +804,7 @@ same way.</p>
|
||||
|
||||
|
||||
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 4, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/0834e152b203ffeccfbbf1ddd3c1f49debdac341">Redirect kustomize docs to the new unified site. (0834e152)</a>
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 11, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/71b763888cad614abb44b3086e291fe72d601080">Remove duplicate kustomize docs content (71b76388)</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -748,24 +748,8 @@
|
||||
<h1>generatorOptions</h1>
|
||||
<div class="lead">Control behavior of <a href="/kustomize/api-reference/kustomization/configmapgenerator">ConfigMap</a> and <a href="/kustomize/api-reference/kustomization/secretgenerator">Secret</a> generators.</div>
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/references/kustomize/generatoroptions/" />
|
||||
<p>Additionally, generatorOptions can be set on a per resource level within each
|
||||
generator. For details on per-resource generatorOptions usage see
|
||||
<a href="/kustomize/api-reference/kustomization/configmapgenerator">field-name-configMapGenerator</a> and See <a href="/kustomize/api-reference/kustomization/secretgenerator">field-name-secretGenerator</a>.</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kustomize.config.k8s.io/v1beta1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Kustomization</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">generatorOptions</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic"># labels to add to all generated resources</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">labels</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kustomize.generated.resources</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">somevalue</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic"># annotations to add to all generated resources</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">annotations</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kustomize.generated.resource</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">somevalue</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic"># disableNameSuffixHash is true disables the default behavior of adding a</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic"># suffix to the names of generated resources that is a hash of</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic"># the resource contents.</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">disableNameSuffixHash</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">true</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div>
|
||||
<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">
|
||||
|
||||
|
||||
@@ -820,7 +804,7 @@ generator. For details on per-resource generatorOptions usage see
|
||||
|
||||
|
||||
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 4, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/0834e152b203ffeccfbbf1ddd3c1f49debdac341">Redirect kustomize docs to the new unified site. (0834e152)</a>
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 11, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/71b763888cad614abb44b3086e291fe72d601080">Remove duplicate kustomize docs content (71b76388)</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -748,44 +748,8 @@
|
||||
<h1>images</h1>
|
||||
<div class="lead">Modify the name, tags and/or digest for images.</div>
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/references/kustomize/images/" />
|
||||
<p>Images modify the name, tags and/or digest for images without creating patches. E.g. Given this
|
||||
kubernetes Deployment fragment:</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Deployment</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#000">...</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">template</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">containers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">mypostgresdb</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">postgres:8</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">nginxapp</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">nginx:1.7.9</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">myapp</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">my-demo-app:latest</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">alpine-app</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">alpine:3.7</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><p>one can change the <code>image</code> in the following ways:</p>
|
||||
<ul>
|
||||
<li><code>postgres:8</code> to <code>my-registry/my-postgres:v1</code>,</li>
|
||||
<li>nginx tag <code>1.7.9</code> to <code>1.8.0</code>,</li>
|
||||
<li>image name <code>my-demo-app</code> to <code>my-app</code>,</li>
|
||||
<li>alpine’s tag <code>3.7</code> to a digest value</li>
|
||||
</ul>
|
||||
<p>all with the following <em>kustomization</em>:</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kustomize.config.k8s.io/v1beta1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Kustomization</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">images</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">postgres</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">newName</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">my-registry/my-postgres</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">newTag</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">nginx</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">newTag</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#0000cf;font-weight:bold">1.8.0</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">my-demo-app</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">newName</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">my-app</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">alpine</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">digest</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">sha256:24a0c4b4a4c0eb97a1aabb8e29f18e917d05abfe1b7a7c07857230879ce7d3d3</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div>
|
||||
<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">
|
||||
|
||||
|
||||
@@ -840,7 +804,7 @@ kubernetes Deployment fragment:</p>
|
||||
|
||||
|
||||
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 4, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/0834e152b203ffeccfbbf1ddd3c1f49debdac341">Redirect kustomize docs to the new unified site. (0834e152)</a>
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 11, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/71b763888cad614abb44b3086e291fe72d601080">Remove duplicate kustomize docs content (71b76388)</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -738,6 +738,7 @@
|
||||
<h1>kustomization.yaml</h1>
|
||||
<div class="lead">kustomization.yaml fields and API</div>
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/references/kustomize/" />
|
||||
<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">
|
||||
|
||||
@@ -919,7 +920,7 @@
|
||||
|
||||
|
||||
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 4, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/0834e152b203ffeccfbbf1ddd3c1f49debdac341">Redirect kustomize docs to the new unified site. (0834e152)</a>
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 11, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/71b763888cad614abb44b3086e291fe72d601080">Remove duplicate kustomize docs content (71b76388)</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -23,17 +23,7 @@
|
||||
|
||||
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/references/kustomize/bases/" />
|
||||
|
||||
|
||||
<div class="pageinfo pageinfo-warning">
|
||||
<p>The <code>bases</code> field was deprecated in v2.1.0</p>
|
||||
|
||||
</div>
|
||||
|
||||
<p>Move entries into the <a href="https://kubernetes-sigs.github.io/kustomize/kustomize/api-reference/kustomization/resources">resources</a>
|
||||
field. This allows bases - which are still a
|
||||
<a href="https://kubernetes-sigs.github.io/kustomize/kustomize/api-reference/glossary#base">central concept</a> - to be
|
||||
ordered relative to other input resources.</p>
|
||||
<p>Moved to <a href="https://github.com/kubernetes-sigs/cli-experimental">https://github.com/kubernetes-sigs/cli-experimental</a></p>
|
||||
|
||||
</description>
|
||||
</item>
|
||||
@@ -48,41 +38,8 @@ ordered relative to other input resources.</p>
|
||||
|
||||
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/references/kustomize/commonannotations/" />
|
||||
<p>Add annotations to all resources. If the annotation key is already present on the resource,
|
||||
the value will be overridden.</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kustomize.config.k8s.io/v1beta1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Kustomization</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">commonAnnotations</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">oncallPager</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#0000cf;font-weight:bold">800-555-1212</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><h2 id="example">Example</h2>
|
||||
<h3 id="file-input">File Input</h3>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#8f5902;font-style:italic"># kustomization.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kustomize.config.k8s.io/v1beta1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Kustomization</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">commonAnnotations</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">oncallPager</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#0000cf;font-weight:bold">800-555-1212</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">resources</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#000">deploy.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#8f5902;font-style:italic"># deploy.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">apps/v1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Deployment</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">example</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">...</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><h3 id="build-output">Build Output</h3>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">apps/v1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Deployment</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">example</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">annotations</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">oncallPager</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#0000cf;font-weight:bold">800-555-1212</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">...</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div>
|
||||
<p>Moved to <a href="https://github.com/kubernetes-sigs/cli-experimental">https://github.com/kubernetes-sigs/cli-experimental</a></p>
|
||||
|
||||
</description>
|
||||
</item>
|
||||
|
||||
@@ -96,84 +53,8 @@ the value will be overridden.</p>
|
||||
|
||||
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/references/kustomize/commonlabels/" />
|
||||
<p>Add labels and selectors to all resources. If the label key already is present on the resource,
|
||||
the value will be overridden.</p>
|
||||
<p>Moved to <a href="https://github.com/kubernetes-sigs/cli-experimental">https://github.com/kubernetes-sigs/cli-experimental</a></p>
|
||||
|
||||
|
||||
<div class="pageinfo pageinfo-warning">
|
||||
<p>Selectors for resources such as Deployments and Services shouldn&rsquo;t be changed once the
|
||||
resource has been applied to a cluster.</p>
|
||||
<p>Changing commonLabels to live resources could result in failures.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kustomize.config.k8s.io/v1beta1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Kustomization</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">commonLabels</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">someName</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">someValue</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">owner</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">alice</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">app</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">bingo</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><h2 id="example">Example</h2>
|
||||
<h3 id="file-input">File Input</h3>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#8f5902;font-style:italic"># kustomization.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kustomize.config.k8s.io/v1beta1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Kustomization</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">commonLabels</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">someName</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">someValue</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">owner</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">alice</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">app</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">bingo</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">resources</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#000">deploy.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#000">service.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#8f5902;font-style:italic"># deploy.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">apps/v1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Deployment</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">example</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#8f5902;font-style:italic"># service.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">example</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><h3 id="build-output">Build Output</h3>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">labels</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">app</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">bingo</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">owner</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">alice</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">someName</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">someValue</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">example</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">selector</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">app</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">bingo</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">owner</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">alice</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">someName</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">someValue</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#000">---</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">apps/v1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Deployment</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">labels</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">app</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">bingo</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">owner</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">alice</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">someName</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">someValue</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">example</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">selector</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">matchLabels</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">app</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">bingo</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">owner</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">alice</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">someName</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">someValue</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">template</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">labels</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">app</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">bingo</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">owner</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">alice</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">someName</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">someValue</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div>
|
||||
</description>
|
||||
</item>
|
||||
|
||||
@@ -187,7 +68,7 @@ resource has been applied to a cluster.</p>
|
||||
|
||||
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/references/kustomize/components/" />
|
||||
<p><em>Coming soon</em></p>
|
||||
<p>Moved to <a href="https://github.com/kubernetes-sigs/cli-experimental">https://github.com/kubernetes-sigs/cli-experimental</a></p>
|
||||
|
||||
</description>
|
||||
</item>
|
||||
@@ -202,79 +83,8 @@ resource has been applied to a cluster.</p>
|
||||
|
||||
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/references/kustomize/configmapgenerator/" />
|
||||
<p>Each entry in this list results in the creation of
|
||||
one ConfigMap resource (it&rsquo;s a generator of n maps).</p>
|
||||
<p>The example below creates four ConfigMaps:</p>
|
||||
<ul>
|
||||
<li>first, with the names and contents of the given files</li>
|
||||
<li>second, with key/value as data using key/value pairs from files</li>
|
||||
<li>third, also with key/value as data, directly specified using <code>literals</code></li>
|
||||
<li>and a fourth, which sets an annotation and label via <code>options</code> for that single ConfigMap</li>
|
||||
</ul>
|
||||
<p>Each configMapGenerator item accepts a parameter of
|
||||
<code>behavior: [create|replace|merge]</code>.
|
||||
This allows an overlay to modify or
|
||||
replace an existing configMap from the parent.</p>
|
||||
<p>Also, each entry has an <code>options</code> field, that has the
|
||||
same subfields as the kustomization file&rsquo;s <code>generatorOptions</code> field.</p>
|
||||
<p>This <code>options</code> field allows one to add labels and/or
|
||||
annotations to the generated instance, or to individually
|
||||
disable the name suffix hash for that instance.
|
||||
Labels and annotations added here will not be overwritten
|
||||
by the global options associated with the kustomization
|
||||
file <code>generatorOptions</code> field. However, due to how
|
||||
booleans behave, if the global <code>generatorOptions</code> field
|
||||
specifies <code>disableNameSuffixHash: true</code>, this will
|
||||
trump any attempt to locally override it.</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kustomize.config.k8s.io/v1beta1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Kustomization</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#8f5902;font-style:italic"># These labels are added to all configmaps and secrets.</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">generatorOptions</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">labels</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">fruit</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">apple</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">configMapGenerator</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">my-java-server-props</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">behavior</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">merge</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">files</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#000">application.properties</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#000">more.properties</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">my-java-server-env-file-vars</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">envs</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#000">my-server-env.properties</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#000">more-server-props.env</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">my-java-server-env-vars</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">literals</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#000">JAVA_HOME=/opt/java/jdk</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#000">JAVA_TOOL_OPTIONS=-agentlib:hprof</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">options</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">disableNameSuffixHash</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">true</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">labels</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">pet</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">dog</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">dashboards</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">files</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#000">mydashboard.json</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">options</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">annotations</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">dashboard</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">&#34;1&#34;</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">labels</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">app.kubernetes.io/name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">&#34;app1&#34;</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><p>It is also possible to
|
||||
<a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/#define-the-key-to-use-when-creating-a-configmap-from-a-file">define a key</a>
|
||||
to set a name different than the filename.</p>
|
||||
<p>The example below creates a ConfigMap
|
||||
with the name of file as <code>myFileName.ini</code>
|
||||
while the <em>actual</em> filename from which the
|
||||
configmap is created is <code>whatever.ini</code>.</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kustomize.config.k8s.io/v1beta1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Kustomization</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">configMapGenerator</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">app-whatever</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">files</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#000">myFileName.ini=whatever.ini</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div>
|
||||
<p>Moved to <a href="https://github.com/kubernetes-sigs/cli-experimental">https://github.com/kubernetes-sigs/cli-experimental</a></p>
|
||||
|
||||
</description>
|
||||
</item>
|
||||
|
||||
@@ -288,34 +98,8 @@ configmap is created is <code>whatever.ini</code>.</p>
|
||||
|
||||
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/references/kustomize/crds/" />
|
||||
<p>Each entry in this list should be a relative path to
|
||||
a file for custom resource definition (CRD).</p>
|
||||
<p>The presence of this field is to allow kustomize be
|
||||
aware of CRDs and apply proper
|
||||
transformation for any objects in those types.</p>
|
||||
<p>Typical use case: A CRD object refers to a
|
||||
ConfigMap object. In a kustomization, the ConfigMap
|
||||
object name may change by adding namePrefix,
|
||||
nameSuffix, or hashing. The name reference for this
|
||||
ConfigMap object in CRD object need to be updated
|
||||
with namePrefix, nameSuffix, or hashing in the
|
||||
same way.</p>
|
||||
<p>The annotations can be put into openAPI definitions are:</p>
|
||||
<ul>
|
||||
<li>&ldquo;x-kubernetes-annotation&rdquo;: &quot;&quot;</li>
|
||||
<li>&ldquo;x-kubernetes-label-selector&rdquo;: &quot;&quot;</li>
|
||||
<li>&ldquo;x-kubernetes-identity&rdquo;: &quot;&quot;</li>
|
||||
<li>&ldquo;x-kubernetes-object-ref-api-version&rdquo;: &ldquo;v1&rdquo;,</li>
|
||||
<li>&ldquo;x-kubernetes-object-ref-kind&rdquo;: &ldquo;Secret&rdquo;,</li>
|
||||
<li>&ldquo;x-kubernetes-object-ref-name-key&rdquo;: &ldquo;name&rdquo;,</li>
|
||||
</ul>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kustomize.config.k8s.io/v1beta1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Kustomization</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">crds</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#000">crds/typeA.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#000">crds/typeB.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div>
|
||||
<p>Moved to <a href="https://github.com/kubernetes-sigs/cli-experimental">https://github.com/kubernetes-sigs/cli-experimental</a></p>
|
||||
|
||||
</description>
|
||||
</item>
|
||||
|
||||
@@ -329,24 +113,8 @@ same way.</p>
|
||||
|
||||
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/references/kustomize/generatoroptions/" />
|
||||
<p>Additionally, generatorOptions can be set on a per resource level within each
|
||||
generator. For details on per-resource generatorOptions usage see
|
||||
<a href="https://kubernetes-sigs.github.io/kustomize/kustomize/api-reference/kustomization/configmapgenerator">field-name-configMapGenerator</a> and See <a href="https://kubernetes-sigs.github.io/kustomize/kustomize/api-reference/kustomization/secretgenerator">field-name-secretGenerator</a>.</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kustomize.config.k8s.io/v1beta1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Kustomization</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">generatorOptions</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic"># labels to add to all generated resources</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">labels</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kustomize.generated.resources</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">somevalue</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic"># annotations to add to all generated resources</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">annotations</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kustomize.generated.resource</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">somevalue</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic"># disableNameSuffixHash is true disables the default behavior of adding a</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic"># suffix to the names of generated resources that is a hash of</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic"># the resource contents.</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">disableNameSuffixHash</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">true</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div>
|
||||
<p>Moved to <a href="https://github.com/kubernetes-sigs/cli-experimental">https://github.com/kubernetes-sigs/cli-experimental</a></p>
|
||||
|
||||
</description>
|
||||
</item>
|
||||
|
||||
@@ -360,44 +128,8 @@ generator. For details on per-resource generatorOptions usage see
|
||||
|
||||
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/references/kustomize/images/" />
|
||||
<p>Images modify the name, tags and/or digest for images without creating patches. E.g. Given this
|
||||
kubernetes Deployment fragment:</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Deployment</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#000">...</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">template</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">containers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">mypostgresdb</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">postgres:8</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">nginxapp</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">nginx:1.7.9</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">myapp</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">my-demo-app:latest</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">alpine-app</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">alpine:3.7</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><p>one can change the <code>image</code> in the following ways:</p>
|
||||
<ul>
|
||||
<li><code>postgres:8</code> to <code>my-registry/my-postgres:v1</code>,</li>
|
||||
<li>nginx tag <code>1.7.9</code> to <code>1.8.0</code>,</li>
|
||||
<li>image name <code>my-demo-app</code> to <code>my-app</code>,</li>
|
||||
<li>alpine&rsquo;s tag <code>3.7</code> to a digest value</li>
|
||||
</ul>
|
||||
<p>all with the following <em>kustomization</em>:</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kustomize.config.k8s.io/v1beta1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Kustomization</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">images</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">postgres</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">newName</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">my-registry/my-postgres</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">newTag</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">nginx</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">newTag</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#0000cf;font-weight:bold">1.8.0</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">my-demo-app</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">newName</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">my-app</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">alpine</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">digest</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">sha256:24a0c4b4a4c0eb97a1aabb8e29f18e917d05abfe1b7a7c07857230879ce7d3d3</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div>
|
||||
<p>Moved to <a href="https://github.com/kubernetes-sigs/cli-experimental">https://github.com/kubernetes-sigs/cli-experimental</a></p>
|
||||
|
||||
</description>
|
||||
</item>
|
||||
|
||||
@@ -411,11 +143,7 @@ kubernetes Deployment fragment:</p>
|
||||
|
||||
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/references/kustomize/nameprefix/" />
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kustomize.config.k8s.io/v1beta1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Kustomization</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">namePrefix</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">alices-</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><p>A deployment named <code>wordpress</code> would become <code>alices-wordpress</code>.</p>
|
||||
<p>Moved to <a href="https://github.com/kubernetes-sigs/cli-experimental">https://github.com/kubernetes-sigs/cli-experimental</a></p>
|
||||
|
||||
</description>
|
||||
</item>
|
||||
@@ -430,12 +158,7 @@ kubernetes Deployment fragment:</p>
|
||||
|
||||
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/references/kustomize/namespace/" />
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kustomize.config.k8s.io/v1beta1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Kustomization</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">my-namespace</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><p>Will override the existing namespace if it is set on a resource, or add it
|
||||
if it is not set on a resource.</p>
|
||||
<p>Moved to <a href="https://github.com/kubernetes-sigs/cli-experimental">https://github.com/kubernetes-sigs/cli-experimental</a></p>
|
||||
|
||||
</description>
|
||||
</item>
|
||||
@@ -450,12 +173,7 @@ if it is not set on a resource.</p>
|
||||
|
||||
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/references/kustomize/namesuffix/" />
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kustomize.config.k8s.io/v1beta1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Kustomization</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">nameSuffix</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span>-<span style="color:#000">v2</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><p>A deployment named <code>wordpress</code> would become <code>wordpress-v2</code>.</p>
|
||||
<p><strong>Note:</strong> The suffix is appended before the content hash if the resource type is ConfigMap or Secret.</p>
|
||||
<p>Moved to <a href="https://github.com/kubernetes-sigs/cli-experimental">https://github.com/kubernetes-sigs/cli-experimental</a></p>
|
||||
|
||||
</description>
|
||||
</item>
|
||||
@@ -470,114 +188,8 @@ if it is not set on a resource.</p>
|
||||
|
||||
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/references/kustomize/patches/" />
|
||||
<p>Patches (also call overlays) add or override fields on resources. They are provided using the
|
||||
<code>patches</code> Kustomization field.</p>
|
||||
<p>The <code>patches</code> field contains a list of patches to be applied in the order they are specified.</p>
|
||||
<p>Each patch may:</p>
|
||||
<ul>
|
||||
<li>be either a <a href="https://kubernetes-sigs.github.io/kustomize/kustomize/api-reference/glossary#patchstrategicmerge">strategic merge</a> patch, or a <a href="https://kubernetes-sigs.github.io/kustomize/kustomize/api-reference/glossary#patchjson6902">JSON</a> patch</li>
|
||||
<li>be either a file, or an inline string</li>
|
||||
<li>target a single resource or multiple resources</li>
|
||||
</ul>
|
||||
<p>The patch target selects resources by group, version, kind, name, namespace, labelSelector and
|
||||
annotationSelector. Any resource which matches all the <strong>specified</strong> fields has the patch applied
|
||||
to it (regular expressions).</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kustomize.config.k8s.io/v1beta1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Kustomization</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">patches</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">path</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">patch.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">target</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">group</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">apps</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">version</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Deployment</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">deploy.*</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">labelSelector</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">&#34;env=dev&#34;</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">annotationSelector</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">&#34;zone=west&#34;</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">patch</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000;font-weight:bold">|-</span><span style="color:#8f5902;font-style:italic">
|
||||
</span><span style="color:#8f5902;font-style:italic"> - op: replace
|
||||
</span><span style="color:#8f5902;font-style:italic"> path: /some/existing/path
|
||||
</span><span style="color:#8f5902;font-style:italic"> value: new value</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">target</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">MyKind</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">labelSelector</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">&#34;env=dev&#34;</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><p>The <code>name</code> and <code>namespace</code> fields of the patch target selector are
|
||||
automatically anchored regular expressions. This means that the value <code>myapp</code>
|
||||
is equivalent to <code>^myapp$</code>.</p>
|
||||
<p>Consider the following <code>deployment.yaml</code> common for both the examples:</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">apps/v1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Deployment</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">the-deployment</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">replicas</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#0000cf;font-weight:bold">5</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">template</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">containers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">the-container</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">registry/conatiner:latest</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><h2 id="example-i">Example I</h2>
|
||||
<h3 id="intent">Intent</h3>
|
||||
<p>To Make the container image point to a specific version and not to the latest container in the
|
||||
registry.</p>
|
||||
<h3 id="file-input">File Input</h3>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#8f5902;font-style:italic"># kustomization.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">resources</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#000">deployment.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">patches</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">path</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">patch.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#8f5902;font-style:italic"># patch.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">apps/v1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Deployment</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">the-deployment</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">template</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">containers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">the-container</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">registry/conatiner:1.0.0</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><h3 id="build-output">Build Output</h3>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">apps/v1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Deployment</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">the-deployment</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">replicas</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#0000cf;font-weight:bold">5</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">template</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">containers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">registry/conatiner:1.0.0</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">the-container</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><h2 id="example-ii">Example II</h2>
|
||||
<h3 id="intent-1">Intent</h3>
|
||||
<p>To Make the container image point to a specific version and not to the latest container in the
|
||||
registry.</p>
|
||||
<h3 id="file-input-1">File Input</h3>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#8f5902;font-style:italic"># kustomization.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">resources</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#000">deployment.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">patches</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">target</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Deployment</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">the-deployment</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">path</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">patch.json</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#8f5902;font-style:italic"># patch.json</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#000;font-weight:bold">[</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>{<span style="color:#204a87;font-weight:bold">&#34;op&#34;: &#34;replace&#34;, &#34;path&#34;: &#34;/spec/template/containers/0/image&#34;, &#34;value&#34;: </span><span style="color:#4e9a06">&#34;registry/conatiner:1.0.0&#34;</span>}<span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#000;font-weight:bold">]</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><h3 id="build-output-1">Build Output</h3>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">apps/v1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Deployment</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">the-deployment</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">replicas</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#0000cf;font-weight:bold">5</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">template</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">containers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">registry/container:1.0.0</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">the-container</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div>
|
||||
<p>Moved to <a href="https://github.com/kubernetes-sigs/cli-experimental">https://github.com/kubernetes-sigs/cli-experimental</a></p>
|
||||
|
||||
</description>
|
||||
</item>
|
||||
|
||||
@@ -591,55 +203,8 @@ registry.</p>
|
||||
|
||||
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/references/kustomize/patchesjson6902/" />
|
||||
<p>Each entry in this list should resolve to a kubernetes object and a JSON patch that will be applied
|
||||
to the object.
|
||||
The JSON patch is documented at <a href="https://tools.ietf.org/html/rfc6902">https://tools.ietf.org/html/rfc6902</a></p>
|
||||
<p>target field points to a kubernetes object within the same kustomization
|
||||
by the object&rsquo;s group, version, kind, name and namespace.
|
||||
path field is a relative file path of a JSON patch file.
|
||||
The content in this patch file can be either in JSON format as</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-json" data-lang="json"> <span style="color:#000;font-weight:bold">[</span>
|
||||
<span style="color:#000;font-weight:bold">{</span><span style="color:#204a87;font-weight:bold">&#34;op&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;add&#34;</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#204a87;font-weight:bold">&#34;path&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;/some/new/path&#34;</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#204a87;font-weight:bold">&#34;value&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;value&#34;</span><span style="color:#000;font-weight:bold">},</span>
|
||||
<span style="color:#000;font-weight:bold">{</span><span style="color:#204a87;font-weight:bold">&#34;op&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;replace&#34;</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#204a87;font-weight:bold">&#34;path&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;/some/existing/path&#34;</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#204a87;font-weight:bold">&#34;value&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;new value&#34;</span><span style="color:#000;font-weight:bold">}</span>
|
||||
<span style="color:#000;font-weight:bold">]</span>
|
||||
</code></pre></div><p>or in YAML format as</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml">- <span style="color:#204a87;font-weight:bold">op</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">add</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">path</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">/some/new/path</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">value</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">value</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">op</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">replace</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">path</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">/some/existing/path</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">value</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">new value</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kustomize.config.k8s.io/v1beta1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Kustomization</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">patchesJson6902</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">target</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">version</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Deployment</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">my-deployment</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">path</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">add_init_container.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">target</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">version</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">my-service</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">path</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">add_service_annotation.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><p>The patch content can be an inline string as well:</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kustomize.config.k8s.io/v1beta1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Kustomization</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">patchesJson6902</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">target</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">version</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Deployment</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">my-deployment</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">patch</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000;font-weight:bold">|-</span><span style="color:#8f5902;font-style:italic">
|
||||
</span><span style="color:#8f5902;font-style:italic"> - op: add
|
||||
</span><span style="color:#8f5902;font-style:italic"> path: /some/new/path
|
||||
</span><span style="color:#8f5902;font-style:italic"> value: value
|
||||
</span><span style="color:#8f5902;font-style:italic"> - op: replace
|
||||
</span><span style="color:#8f5902;font-style:italic"> path: /some/existing/path
|
||||
</span><span style="color:#8f5902;font-style:italic"> value: &#34;new value&#34;</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div>
|
||||
<p>Moved to <a href="https://github.com/kubernetes-sigs/cli-experimental">https://github.com/kubernetes-sigs/cli-experimental</a></p>
|
||||
|
||||
</description>
|
||||
</item>
|
||||
|
||||
@@ -653,45 +218,7 @@ The content in this patch file can be either in JSON format as</p>
|
||||
|
||||
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/references/kustomize/patchesstrategicmerge/" />
|
||||
<p>Each entry in this list should be either a relative
|
||||
file path or an inline content
|
||||
resolving to a partial or complete resource
|
||||
definition.</p>
|
||||
<p>The names in these (possibly partial) resource
|
||||
files must match names already loaded via the
|
||||
<code>resources</code> field. These entries are used to
|
||||
<em>patch</em> (modify) the known resources.</p>
|
||||
<p>Small patches that do one thing are best, e.g. modify
|
||||
a memory request/limit, change an env var in a
|
||||
ConfigMap, etc. Small patches are easy to review and
|
||||
easy to mix together in overlays.</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kustomize.config.k8s.io/v1beta1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Kustomization</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">patchesStrategicMerge</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#000">service_port_8888.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#000">deployment_increase_replicas.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#000">deployment_increase_memory.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><p>The patch content can be a inline string as well.</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kustomize.config.k8s.io/v1beta1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Kustomization</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">patchesStrategicMerge</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#000;font-weight:bold">|-</span><span style="color:#8f5902;font-style:italic">
|
||||
</span><span style="color:#8f5902;font-style:italic"> apiVersion: apps/v1
|
||||
</span><span style="color:#8f5902;font-style:italic"> kind: Deployment
|
||||
</span><span style="color:#8f5902;font-style:italic"> metadata:
|
||||
</span><span style="color:#8f5902;font-style:italic"> name: nginx
|
||||
</span><span style="color:#8f5902;font-style:italic"> spec:
|
||||
</span><span style="color:#8f5902;font-style:italic"> template:
|
||||
</span><span style="color:#8f5902;font-style:italic"> spec:
|
||||
</span><span style="color:#8f5902;font-style:italic"> containers:
|
||||
</span><span style="color:#8f5902;font-style:italic"> - name: nginx
|
||||
</span><span style="color:#8f5902;font-style:italic"> image: nignx:latest</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><p>Note that kustomize does not support more than one patch
|
||||
for the same object that contain a <em>delete</em> directive. To remove
|
||||
several fields / slice elements from an object create a single
|
||||
patch that performs all the needed deletions.</p>
|
||||
<p>Moved to <a href="https://github.com/kubernetes-sigs/cli-experimental">https://github.com/kubernetes-sigs/cli-experimental</a></p>
|
||||
|
||||
</description>
|
||||
</item>
|
||||
@@ -706,33 +233,7 @@ patch that performs all the needed deletions.</p>
|
||||
|
||||
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/references/kustomize/replicas/" />
|
||||
<p>Given this kubernetes Deployment fragment:</p>
|
||||
<pre><code># deployment.yaml
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: deployment-name
|
||||
spec:
|
||||
replicas: 3
|
||||
</code></pre><p>one can change the number of replicas to 5
|
||||
by adding the following to your kustomization:</p>
|
||||
<pre><code>apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
|
||||
replicas:
|
||||
- name: deployment-name
|
||||
count: 5
|
||||
</code></pre><p>This field accepts a list, so many resources can
|
||||
be modified at the same time.</p>
|
||||
<p>As this declaration does not take in a <code>kind:</code> nor a <code>group:</code>
|
||||
it will match any <code>group</code> and <code>kind</code> that has a matching name and
|
||||
that is one of:</p>
|
||||
<ul>
|
||||
<li><code>Deployment</code></li>
|
||||
<li><code>ReplicationController</code></li>
|
||||
<li><code>ReplicaSet</code></li>
|
||||
<li><code>StatefulSet</code></li>
|
||||
</ul>
|
||||
<p>For more complex use cases, revert to using a patch.</p>
|
||||
<p>Moved to <a href="https://github.com/kubernetes-sigs/cli-experimental">https://github.com/kubernetes-sigs/cli-experimental</a></p>
|
||||
|
||||
</description>
|
||||
</item>
|
||||
@@ -747,24 +248,7 @@ that is one of:</p>
|
||||
|
||||
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/references/kustomize/resources/" />
|
||||
<p>Each entry in this list must be a path to a <em>file</em>, or a path (or URL) referring to another
|
||||
kustomization <em>directory</em>, e.g.</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kustomize.config.k8s.io/v1beta1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Kustomization</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">resources</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#000">myNamespace.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#000">sub-dir/some-deployment.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#000">../../commonbase</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#000">github.com/kubernetes-sigs/kustomize/examples/multibases?ref=v1.0.6</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#000">deployment.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#000">github.com/kubernets-sigs/kustomize/examples/helloWorld?ref=test-branch</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><p>Resources will be read and processed in depth-first order.</p>
|
||||
<p>Files should contain k8s resources in YAML form. A file may contain multiple resources separated by
|
||||
the document marker <code>---</code>. File paths should be specified <em>relative</em> to the directory holding the
|
||||
kustomization file containing the <code>resources</code> field.</p>
|
||||
<p>Directory specification can be relative, absolute, or part of a URL. URL specifications should
|
||||
follow the <a href="https://github.com/hashicorp/go-getter#url-format">hashicorp URL</a> format. The directory must contain a <code>kustomization.yaml</code> file.</p>
|
||||
<p>Moved to <a href="https://github.com/kubernetes-sigs/cli-experimental">https://github.com/kubernetes-sigs/cli-experimental</a></p>
|
||||
|
||||
</description>
|
||||
</item>
|
||||
@@ -779,39 +263,8 @@ follow the <a href="https://github.com/hashicorp/go-getter#url-format"
|
||||
|
||||
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/references/kustomize/secretegenerator/" />
|
||||
<p>Each entry in the argument list results in the creation of one Secret resource (it&rsquo;s a generator of N secrets).</p>
|
||||
<p>This works like the <a href="https://kubernetes-sigs.github.io/kustomize/kustomize/api-reference/kustomization/configmapgenerator">configMapGenerator</a>.</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kustomize.config.k8s.io/v1beta1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Kustomization</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">secretGenerator</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">app-tls</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">files</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#000">secret/tls.cert</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#000">secret/tls.key</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">type</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">&#34;kubernetes.io/tls&#34;</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">app-tls-namespaced</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic"># you can define a namespace to generate</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic"># a secret in, defaults to: &#34;default&#34;</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">apps</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">files</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#000">tls.crt=catsecret/tls.cert</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#000">tls.key=secret/tls.key</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">type</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">&#34;kubernetes.io/tls&#34;</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">env_file_secret</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">envs</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#000">env.txt</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">type</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Opaque</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">secret-with-annotation</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">files</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#000">app-config.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">type</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Opaque</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">options</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">annotations</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">app_config</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">&#34;true&#34;</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">labels</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">app.kubernetes.io/name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">&#34;app2&#34;</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div>
|
||||
<p>Moved to <a href="https://github.com/kubernetes-sigs/cli-experimental">https://github.com/kubernetes-sigs/cli-experimental</a></p>
|
||||
|
||||
</description>
|
||||
</item>
|
||||
|
||||
@@ -825,96 +278,7 @@ follow the <a href="https://github.com/hashicorp/go-getter#url-format"
|
||||
|
||||
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/references/kustomize/vars/" />
|
||||
<p>Vars are used to capture text from one resource&rsquo;s field
|
||||
and insert that text elsewhere - a reflection feature.</p>
|
||||
<p>For example, suppose one specifies the name of a k8s Service
|
||||
object in a container&rsquo;s command line, and the name of a
|
||||
k8s Secret object in a container&rsquo;s environment variable,
|
||||
so that the following would work:</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#8f5902;font-style:italic"># consider it is a deployment</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">containers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">myimage</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">command</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000;font-weight:bold">[</span><span style="color:#4e9a06">&#34;start&#34;</span><span style="color:#000;font-weight:bold">,</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">&#34;--host&#34;</span><span style="color:#000;font-weight:bold">,</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">&#34;$(MY_SERVICE_NAME)&#34;</span><span style="color:#000;font-weight:bold">]</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">env</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">SECRET_TOKEN</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">value</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">$(SOME_SECRET_NAME)</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">livenessProbe</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">httpGet</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">path</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">/healthz</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic"># it enables the parser to lookup this field</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">port</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">$(APP_PORT)</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><p>To do so, add an entry to <code>vars:</code> as follows:</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kustomize.config.k8s.io/v1beta1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Kustomization</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">configMapGenerator</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">my-config</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">literals</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#000">MY_PORT=8080</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">vars</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">SOME_SECRET_NAME</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">objref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Secret</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">my-secret</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">MY_SERVICE_NAME</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">objref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">my-service</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">fieldref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">fieldpath</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">metadata.name</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">ANOTHER_DEPLOYMENTS_POD_RESTART_POLICY</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">objref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Deployment</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">my-deployment</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">apps/v1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">fieldref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">fieldpath</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">spec.template.spec.restartPolicy</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#8f5902;font-style:italic"># it exports a value as `APP_PORT` </span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#8f5902;font-style:italic"># from `ConfigMap` named `my-config`</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#8f5902;font-style:italic"># in `data.MY_PORT`</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">APP_PORT</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">objref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">ConfigMap</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">my-config</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">fieldref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">fieldpath</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">data.MY_PORT</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">configurations</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#000">lookup.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><p>Define the consuming resource(s) and the field(s) inside need to lookup.</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#8f5902;font-style:italic"># lookup.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">varReference</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic"># the path of field that you want the parser to lookups and replace.</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">path</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">spec/template/spec/containers/livenessProbe/httpGet/port</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Deployment</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><p>A var is a tuple of variable name, object
|
||||
reference and field reference within that object.
|
||||
That&rsquo;s where the text is found.</p>
|
||||
<p>The field reference is optional; it defaults to
|
||||
<code>metadata.name</code>, a normal default, since kustomize
|
||||
is used to generate or modify the names of
|
||||
resources.</p>
|
||||
<p>At time of writing, only string type fields are
|
||||
supported. No ints, bools, arrays etc. It&rsquo;s not
|
||||
possible to, say, extract the name of the image in
|
||||
container number 2 of some pod template.</p>
|
||||
<p>A variable reference, i.e. the string &lsquo;$(FOO)&rsquo;,
|
||||
can only be placed in particular fields of
|
||||
particular objects as specified by kustomize&rsquo;s
|
||||
configuration data.</p>
|
||||
<p>The default config data for vars is at <a href="https://github.com/kubernetes-sigs/kustomize/blob/master/api/konfig/builtinpluginconsts/varreference.go">/api/konfig/builtinpluginconsts/varreference.go</a>
|
||||
Long story short, the default targets are all
|
||||
container command args and env value fields.</p>
|
||||
<p>Vars should <em>not</em> be used for inserting names in
|
||||
places where kustomize is already handling that
|
||||
job. E.g., a Deployment may reference a ConfigMap
|
||||
by name, and if kustomize changes the name of a
|
||||
ConfigMap, it knows to change the name reference
|
||||
in the Deployment.</p>
|
||||
<p>Moved to <a href="https://github.com/kubernetes-sigs/cli-experimental">https://github.com/kubernetes-sigs/cli-experimental</a></p>
|
||||
|
||||
</description>
|
||||
</item>
|
||||
|
||||
@@ -748,11 +748,7 @@
|
||||
<h1>namePrefix</h1>
|
||||
<div class="lead">Prepends the value to the names of all resources and references.</div>
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/references/kustomize/nameprefix/" />
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kustomize.config.k8s.io/v1beta1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Kustomization</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">namePrefix</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">alices-</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><p>A deployment named <code>wordpress</code> would become <code>alices-wordpress</code>.</p>
|
||||
<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">
|
||||
|
||||
@@ -808,7 +804,7 @@
|
||||
|
||||
|
||||
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 4, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/0834e152b203ffeccfbbf1ddd3c1f49debdac341">Redirect kustomize docs to the new unified site. (0834e152)</a>
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 11, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/71b763888cad614abb44b3086e291fe72d601080">Remove duplicate kustomize docs content (71b76388)</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -748,12 +748,7 @@
|
||||
<h1>namespace</h1>
|
||||
<div class="lead">Adds namespace to all resources.</div>
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/references/kustomize/namespace/" />
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kustomize.config.k8s.io/v1beta1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Kustomization</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">my-namespace</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><p>Will override the existing namespace if it is set on a resource, or add it
|
||||
if it is not set on a resource.</p>
|
||||
<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">
|
||||
|
||||
@@ -809,7 +804,7 @@ if it is not set on a resource.</p>
|
||||
|
||||
|
||||
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 4, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/0834e152b203ffeccfbbf1ddd3c1f49debdac341">Redirect kustomize docs to the new unified site. (0834e152)</a>
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 11, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/71b763888cad614abb44b3086e291fe72d601080">Remove duplicate kustomize docs content (71b76388)</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -748,12 +748,7 @@
|
||||
<h1>nameSuffix</h1>
|
||||
<div class="lead">Appends the value to the names of all resources and references.</div>
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/references/kustomize/namesuffix/" />
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kustomize.config.k8s.io/v1beta1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Kustomization</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">nameSuffix</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span>-<span style="color:#000">v2</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><p>A deployment named <code>wordpress</code> would become <code>wordpress-v2</code>.</p>
|
||||
<p><strong>Note:</strong> The suffix is appended before the content hash if the resource type is ConfigMap or Secret.</p>
|
||||
<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">
|
||||
|
||||
@@ -809,7 +804,7 @@
|
||||
|
||||
|
||||
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 4, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/0834e152b203ffeccfbbf1ddd3c1f49debdac341">Redirect kustomize docs to the new unified site. (0834e152)</a>
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 11, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/71b763888cad614abb44b3086e291fe72d601080">Remove duplicate kustomize docs content (71b76388)</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -702,25 +702,6 @@
|
||||
|
||||
|
||||
|
||||
<nav id="TableOfContents">
|
||||
<ul>
|
||||
<li><a href="#example-i">Example I</a>
|
||||
<ul>
|
||||
<li><a href="#intent">Intent</a></li>
|
||||
<li><a href="#file-input">File Input</a></li>
|
||||
<li><a href="#build-output">Build Output</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#example-ii">Example II</a>
|
||||
<ul>
|
||||
<li><a href="#intent-1">Intent</a></li>
|
||||
<li><a href="#file-input-1">File Input</a></li>
|
||||
<li><a href="#build-output-1">Build Output</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
@@ -767,114 +748,8 @@
|
||||
<h1>patches</h1>
|
||||
<div class="lead">Patch resources</div>
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/references/kustomize/patches/" />
|
||||
<p>Patches (also call overlays) add or override fields on resources. They are provided using the
|
||||
<code>patches</code> Kustomization field.</p>
|
||||
<p>The <code>patches</code> field contains a list of patches to be applied in the order they are specified.</p>
|
||||
<p>Each patch may:</p>
|
||||
<ul>
|
||||
<li>be either a <a href="/kustomize/api-reference/glossary#patchstrategicmerge">strategic merge</a> patch, or a <a href="/kustomize/api-reference/glossary#patchjson6902">JSON</a> patch</li>
|
||||
<li>be either a file, or an inline string</li>
|
||||
<li>target a single resource or multiple resources</li>
|
||||
</ul>
|
||||
<p>The patch target selects resources by group, version, kind, name, namespace, labelSelector and
|
||||
annotationSelector. Any resource which matches all the <strong>specified</strong> fields has the patch applied
|
||||
to it (regular expressions).</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kustomize.config.k8s.io/v1beta1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Kustomization</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">patches</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">path</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">patch.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">target</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">group</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">apps</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">version</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Deployment</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">deploy.*</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">labelSelector</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">"env=dev"</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">annotationSelector</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">"zone=west"</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">patch</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000;font-weight:bold">|-</span><span style="color:#8f5902;font-style:italic">
|
||||
</span><span style="color:#8f5902;font-style:italic"> - op: replace
|
||||
</span><span style="color:#8f5902;font-style:italic"> path: /some/existing/path
|
||||
</span><span style="color:#8f5902;font-style:italic"> value: new value</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">target</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">MyKind</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">labelSelector</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">"env=dev"</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><p>The <code>name</code> and <code>namespace</code> fields of the patch target selector are
|
||||
automatically anchored regular expressions. This means that the value <code>myapp</code>
|
||||
is equivalent to <code>^myapp$</code>.</p>
|
||||
<p>Consider the following <code>deployment.yaml</code> common for both the examples:</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">apps/v1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Deployment</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">the-deployment</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">replicas</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#0000cf;font-weight:bold">5</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">template</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">containers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">the-container</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">registry/conatiner:latest</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><h2 id="example-i">Example I</h2>
|
||||
<h3 id="intent">Intent</h3>
|
||||
<p>To Make the container image point to a specific version and not to the latest container in the
|
||||
registry.</p>
|
||||
<h3 id="file-input">File Input</h3>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#8f5902;font-style:italic"># kustomization.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">resources</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#000">deployment.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">patches</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">path</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">patch.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#8f5902;font-style:italic"># patch.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">apps/v1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Deployment</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">the-deployment</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">template</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">containers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">the-container</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">registry/conatiner:1.0.0</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><h3 id="build-output">Build Output</h3>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">apps/v1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Deployment</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">the-deployment</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">replicas</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#0000cf;font-weight:bold">5</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">template</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">containers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">registry/conatiner:1.0.0</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">the-container</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><h2 id="example-ii">Example II</h2>
|
||||
<h3 id="intent-1">Intent</h3>
|
||||
<p>To Make the container image point to a specific version and not to the latest container in the
|
||||
registry.</p>
|
||||
<h3 id="file-input-1">File Input</h3>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#8f5902;font-style:italic"># kustomization.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">resources</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#000">deployment.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">patches</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">target</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Deployment</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">the-deployment</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">path</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">patch.json</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#8f5902;font-style:italic"># patch.json</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#000;font-weight:bold">[</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>{<span style="color:#204a87;font-weight:bold">"op": "replace", "path": "/spec/template/containers/0/image", "value": </span><span style="color:#4e9a06">"registry/conatiner:1.0.0"</span>}<span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#000;font-weight:bold">]</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><h3 id="build-output-1">Build Output</h3>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">apps/v1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Deployment</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">the-deployment</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">replicas</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#0000cf;font-weight:bold">5</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">template</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">containers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">registry/container:1.0.0</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">the-container</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div>
|
||||
<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">
|
||||
|
||||
|
||||
@@ -929,7 +804,7 @@ registry.</p>
|
||||
|
||||
|
||||
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 4, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/0834e152b203ffeccfbbf1ddd3c1f49debdac341">Redirect kustomize docs to the new unified site. (0834e152)</a>
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 11, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/71b763888cad614abb44b3086e291fe72d601080">Remove duplicate kustomize docs content (71b76388)</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -748,55 +748,8 @@
|
||||
<h1>patchesJson6902</h1>
|
||||
<div class="lead">Patch resources using the <a href="https://tools.ietf.org/html/rfc6902">json 6902 standard</a></div>
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/references/kustomize/patchesjson6902/" />
|
||||
<p>Each entry in this list should resolve to a kubernetes object and a JSON patch that will be applied
|
||||
to the object.
|
||||
The JSON patch is documented at <a href="https://tools.ietf.org/html/rfc6902">https://tools.ietf.org/html/rfc6902</a></p>
|
||||
<p>target field points to a kubernetes object within the same kustomization
|
||||
by the object’s group, version, kind, name and namespace.
|
||||
path field is a relative file path of a JSON patch file.
|
||||
The content in this patch file can be either in JSON format as</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-json" data-lang="json"> <span style="color:#000;font-weight:bold">[</span>
|
||||
<span style="color:#000;font-weight:bold">{</span><span style="color:#204a87;font-weight:bold">"op"</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">"add"</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#204a87;font-weight:bold">"path"</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">"/some/new/path"</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#204a87;font-weight:bold">"value"</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">"value"</span><span style="color:#000;font-weight:bold">},</span>
|
||||
<span style="color:#000;font-weight:bold">{</span><span style="color:#204a87;font-weight:bold">"op"</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">"replace"</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#204a87;font-weight:bold">"path"</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">"/some/existing/path"</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#204a87;font-weight:bold">"value"</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">"new value"</span><span style="color:#000;font-weight:bold">}</span>
|
||||
<span style="color:#000;font-weight:bold">]</span>
|
||||
</code></pre></div><p>or in YAML format as</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml">- <span style="color:#204a87;font-weight:bold">op</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">add</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">path</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">/some/new/path</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">value</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">value</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">op</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">replace</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">path</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">/some/existing/path</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">value</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">new value</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kustomize.config.k8s.io/v1beta1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Kustomization</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">patchesJson6902</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">target</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">version</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Deployment</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">my-deployment</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">path</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">add_init_container.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">target</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">version</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">my-service</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">path</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">add_service_annotation.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><p>The patch content can be an inline string as well:</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kustomize.config.k8s.io/v1beta1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Kustomization</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">patchesJson6902</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">target</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">version</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Deployment</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">my-deployment</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">patch</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000;font-weight:bold">|-</span><span style="color:#8f5902;font-style:italic">
|
||||
</span><span style="color:#8f5902;font-style:italic"> - op: add
|
||||
</span><span style="color:#8f5902;font-style:italic"> path: /some/new/path
|
||||
</span><span style="color:#8f5902;font-style:italic"> value: value
|
||||
</span><span style="color:#8f5902;font-style:italic"> - op: replace
|
||||
</span><span style="color:#8f5902;font-style:italic"> path: /some/existing/path
|
||||
</span><span style="color:#8f5902;font-style:italic"> value: "new value"</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div>
|
||||
<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">
|
||||
|
||||
|
||||
@@ -851,7 +804,7 @@ The content in this patch file can be either in JSON format as</p>
|
||||
|
||||
|
||||
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 4, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/0834e152b203ffeccfbbf1ddd3c1f49debdac341">Redirect kustomize docs to the new unified site. (0834e152)</a>
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 11, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/71b763888cad614abb44b3086e291fe72d601080">Remove duplicate kustomize docs content (71b76388)</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -748,45 +748,7 @@
|
||||
<h1>patchesStrategicMerge</h1>
|
||||
<div class="lead">Patch resources using the strategic merge patch standard.</div>
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/references/kustomize/patchesstrategicmerge/" />
|
||||
<p>Each entry in this list should be either a relative
|
||||
file path or an inline content
|
||||
resolving to a partial or complete resource
|
||||
definition.</p>
|
||||
<p>The names in these (possibly partial) resource
|
||||
files must match names already loaded via the
|
||||
<code>resources</code> field. These entries are used to
|
||||
<em>patch</em> (modify) the known resources.</p>
|
||||
<p>Small patches that do one thing are best, e.g. modify
|
||||
a memory request/limit, change an env var in a
|
||||
ConfigMap, etc. Small patches are easy to review and
|
||||
easy to mix together in overlays.</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kustomize.config.k8s.io/v1beta1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Kustomization</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">patchesStrategicMerge</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#000">service_port_8888.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#000">deployment_increase_replicas.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#000">deployment_increase_memory.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><p>The patch content can be a inline string as well.</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kustomize.config.k8s.io/v1beta1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Kustomization</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">patchesStrategicMerge</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#000;font-weight:bold">|-</span><span style="color:#8f5902;font-style:italic">
|
||||
</span><span style="color:#8f5902;font-style:italic"> apiVersion: apps/v1
|
||||
</span><span style="color:#8f5902;font-style:italic"> kind: Deployment
|
||||
</span><span style="color:#8f5902;font-style:italic"> metadata:
|
||||
</span><span style="color:#8f5902;font-style:italic"> name: nginx
|
||||
</span><span style="color:#8f5902;font-style:italic"> spec:
|
||||
</span><span style="color:#8f5902;font-style:italic"> template:
|
||||
</span><span style="color:#8f5902;font-style:italic"> spec:
|
||||
</span><span style="color:#8f5902;font-style:italic"> containers:
|
||||
</span><span style="color:#8f5902;font-style:italic"> - name: nginx
|
||||
</span><span style="color:#8f5902;font-style:italic"> image: nignx:latest</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><p>Note that kustomize does not support more than one patch
|
||||
for the same object that contain a <em>delete</em> directive. To remove
|
||||
several fields / slice elements from an object create a single
|
||||
patch that performs all the needed deletions.</p>
|
||||
<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">
|
||||
|
||||
@@ -842,7 +804,7 @@ patch that performs all the needed deletions.</p>
|
||||
|
||||
|
||||
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 4, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/0834e152b203ffeccfbbf1ddd3c1f49debdac341">Redirect kustomize docs to the new unified site. (0834e152)</a>
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 11, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/71b763888cad614abb44b3086e291fe72d601080">Remove duplicate kustomize docs content (71b76388)</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -748,33 +748,7 @@
|
||||
<h1>replicas</h1>
|
||||
<div class="lead">Change the number of replicas for a resource.</div>
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/references/kustomize/replicas/" />
|
||||
<p>Given this kubernetes Deployment fragment:</p>
|
||||
<pre><code># deployment.yaml
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: deployment-name
|
||||
spec:
|
||||
replicas: 3
|
||||
</code></pre><p>one can change the number of replicas to 5
|
||||
by adding the following to your kustomization:</p>
|
||||
<pre><code>apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
|
||||
replicas:
|
||||
- name: deployment-name
|
||||
count: 5
|
||||
</code></pre><p>This field accepts a list, so many resources can
|
||||
be modified at the same time.</p>
|
||||
<p>As this declaration does not take in a <code>kind:</code> nor a <code>group:</code>
|
||||
it will match any <code>group</code> and <code>kind</code> that has a matching name and
|
||||
that is one of:</p>
|
||||
<ul>
|
||||
<li><code>Deployment</code></li>
|
||||
<li><code>ReplicationController</code></li>
|
||||
<li><code>ReplicaSet</code></li>
|
||||
<li><code>StatefulSet</code></li>
|
||||
</ul>
|
||||
<p>For more complex use cases, revert to using a patch.</p>
|
||||
<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">
|
||||
|
||||
@@ -830,7 +804,7 @@ that is one of:</p>
|
||||
|
||||
|
||||
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 4, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/0834e152b203ffeccfbbf1ddd3c1f49debdac341">Redirect kustomize docs to the new unified site. (0834e152)</a>
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 11, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/71b763888cad614abb44b3086e291fe72d601080">Remove duplicate kustomize docs content (71b76388)</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -748,24 +748,7 @@
|
||||
<h1>resources</h1>
|
||||
<div class="lead">Resources to include.</div>
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/references/kustomize/resources/" />
|
||||
<p>Each entry in this list must be a path to a <em>file</em>, or a path (or URL) referring to another
|
||||
kustomization <em>directory</em>, e.g.</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kustomize.config.k8s.io/v1beta1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Kustomization</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">resources</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#000">myNamespace.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#000">sub-dir/some-deployment.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#000">../../commonbase</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#000">github.com/kubernetes-sigs/kustomize/examples/multibases?ref=v1.0.6</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#000">deployment.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#000">github.com/kubernets-sigs/kustomize/examples/helloWorld?ref=test-branch</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><p>Resources will be read and processed in depth-first order.</p>
|
||||
<p>Files should contain k8s resources in YAML form. A file may contain multiple resources separated by
|
||||
the document marker <code>---</code>. File paths should be specified <em>relative</em> to the directory holding the
|
||||
kustomization file containing the <code>resources</code> field.</p>
|
||||
<p>Directory specification can be relative, absolute, or part of a URL. URL specifications should
|
||||
follow the <a href="https://github.com/hashicorp/go-getter#url-format">hashicorp URL</a> format. The directory must contain a <code>kustomization.yaml</code> file.</p>
|
||||
<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">
|
||||
|
||||
@@ -821,7 +804,7 @@ follow the <a href="https://github.com/hashicorp/go-getter#url-format">hashicorp
|
||||
|
||||
|
||||
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 4, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/0834e152b203ffeccfbbf1ddd3c1f49debdac341">Redirect kustomize docs to the new unified site. (0834e152)</a>
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 11, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/71b763888cad614abb44b3086e291fe72d601080">Remove duplicate kustomize docs content (71b76388)</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -748,39 +748,8 @@
|
||||
<h1>secretGenerator</h1>
|
||||
<div class="lead">Generate Secret resources.</div>
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/references/kustomize/secretegenerator/" />
|
||||
<p>Each entry in the argument list results in the creation of one Secret resource (it’s a generator of N secrets).</p>
|
||||
<p>This works like the <a href="/kustomize/api-reference/kustomization/configmapgenerator">configMapGenerator</a>.</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kustomize.config.k8s.io/v1beta1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Kustomization</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">secretGenerator</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">app-tls</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">files</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#000">secret/tls.cert</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#000">secret/tls.key</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">type</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">"kubernetes.io/tls"</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">app-tls-namespaced</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic"># you can define a namespace to generate</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic"># a secret in, defaults to: "default"</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">apps</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">files</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#000">tls.crt=catsecret/tls.cert</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#000">tls.key=secret/tls.key</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">type</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">"kubernetes.io/tls"</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">env_file_secret</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">envs</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#000">env.txt</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">type</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Opaque</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">secret-with-annotation</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">files</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#000">app-config.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">type</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Opaque</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">options</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">annotations</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">app_config</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">"true"</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">labels</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">app.kubernetes.io/name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">"app2"</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div>
|
||||
<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">
|
||||
|
||||
|
||||
@@ -835,7 +804,7 @@
|
||||
|
||||
|
||||
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 4, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/0834e152b203ffeccfbbf1ddd3c1f49debdac341">Redirect kustomize docs to the new unified site. (0834e152)</a>
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 11, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/71b763888cad614abb44b3086e291fe72d601080">Remove duplicate kustomize docs content (71b76388)</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -748,96 +748,7 @@
|
||||
<h1>vars</h1>
|
||||
<div class="lead">Substitute name references.</div>
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/references/kustomize/vars/" />
|
||||
<p>Vars are used to capture text from one resource’s field
|
||||
and insert that text elsewhere - a reflection feature.</p>
|
||||
<p>For example, suppose one specifies the name of a k8s Service
|
||||
object in a container’s command line, and the name of a
|
||||
k8s Secret object in a container’s environment variable,
|
||||
so that the following would work:</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#8f5902;font-style:italic"># consider it is a deployment</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">containers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">myimage</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">command</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000;font-weight:bold">[</span><span style="color:#4e9a06">"start"</span><span style="color:#000;font-weight:bold">,</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">"--host"</span><span style="color:#000;font-weight:bold">,</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">"$(MY_SERVICE_NAME)"</span><span style="color:#000;font-weight:bold">]</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">env</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">SECRET_TOKEN</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">value</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">$(SOME_SECRET_NAME)</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">livenessProbe</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">httpGet</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">path</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">/healthz</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic"># it enables the parser to lookup this field</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">port</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">$(APP_PORT)</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><p>To do so, add an entry to <code>vars:</code> as follows:</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kustomize.config.k8s.io/v1beta1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Kustomization</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">configMapGenerator</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">my-config</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">literals</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#000">MY_PORT=8080</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">vars</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">SOME_SECRET_NAME</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">objref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Secret</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">my-secret</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">MY_SERVICE_NAME</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">objref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">my-service</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">fieldref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">fieldpath</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">metadata.name</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">ANOTHER_DEPLOYMENTS_POD_RESTART_POLICY</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">objref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Deployment</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">my-deployment</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">apps/v1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">fieldref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">fieldpath</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">spec.template.spec.restartPolicy</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#8f5902;font-style:italic"># it exports a value as `APP_PORT` </span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#8f5902;font-style:italic"># from `ConfigMap` named `my-config`</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#8f5902;font-style:italic"># in `data.MY_PORT`</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">APP_PORT</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">objref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">ConfigMap</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">my-config</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">fieldref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">fieldpath</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">data.MY_PORT</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">configurations</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#000">lookup.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><p>Define the consuming resource(s) and the field(s) inside need to lookup.</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#8f5902;font-style:italic"># lookup.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">varReference</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic"># the path of field that you want the parser to lookups and replace.</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">path</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">spec/template/spec/containers/livenessProbe/httpGet/port</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Deployment</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><p>A var is a tuple of variable name, object
|
||||
reference and field reference within that object.
|
||||
That’s where the text is found.</p>
|
||||
<p>The field reference is optional; it defaults to
|
||||
<code>metadata.name</code>, a normal default, since kustomize
|
||||
is used to generate or modify the names of
|
||||
resources.</p>
|
||||
<p>At time of writing, only string type fields are
|
||||
supported. No ints, bools, arrays etc. It’s not
|
||||
possible to, say, extract the name of the image in
|
||||
container number 2 of some pod template.</p>
|
||||
<p>A variable reference, i.e. the string ‘$(FOO)’,
|
||||
can only be placed in particular fields of
|
||||
particular objects as specified by kustomize’s
|
||||
configuration data.</p>
|
||||
<p>The default config data for vars is at <a href="https://github.com/kubernetes-sigs/kustomize/blob/master/api/konfig/builtinpluginconsts/varreference.go">/api/konfig/builtinpluginconsts/varreference.go</a>
|
||||
Long story short, the default targets are all
|
||||
container command args and env value fields.</p>
|
||||
<p>Vars should <em>not</em> be used for inserting names in
|
||||
places where kustomize is already handling that
|
||||
job. E.g., a Deployment may reference a ConfigMap
|
||||
by name, and if kustomize changes the name of a
|
||||
ConfigMap, it knows to change the name reference
|
||||
in the Deployment.</p>
|
||||
<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">
|
||||
|
||||
@@ -893,7 +804,7 @@ in the Deployment.</p>
|
||||
|
||||
|
||||
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 4, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/0834e152b203ffeccfbbf1ddd3c1f49debdac341">Redirect kustomize docs to the new unified site. (0834e152)</a>
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 11, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/71b763888cad614abb44b3086e291fe72d601080">Remove duplicate kustomize docs content (71b76388)</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -439,39 +439,7 @@
|
||||
<h1>Filing Bugs</h1>
|
||||
<div class="lead">How to file bugs and fix Kustomize bugs</div>
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/contributing/kustomize/bugs" />
|
||||
<p>File issues as desired, but if you’ve found a problem
|
||||
with how <code>kustomize build</code> works, please report</p>
|
||||
<ul>
|
||||
<li>the output of <code>kustomize version</code>,</li>
|
||||
<li>the input (the content of <code>kustomization.yaml</code>
|
||||
and any files it refers to),</li>
|
||||
<li>the expected YAML output.</li>
|
||||
</ul>
|
||||
<h2 id="if-you-have-go-installed">If you have <code>go</code> installed</h2>
|
||||
<p>kustomize has a simple test harness in the <a href="https://github.com/kubernetes-sigs/kustomize/tree/master/api/krusty">krusty
|
||||
package</a> for specifying a kustomization’s input and the
|
||||
expected output.</p>
|
||||
<p>Copy one of those tests, e.g. this <a href="https://github.com/kubernetes-sigs/kustomize/tree/master/api/krusty/customconfigreusable_test.go">reusable custom
|
||||
transformer test</a>, to a new test file in the
|
||||
krusty package.</p>
|
||||
<p>Insert the inputs you want to use, and run it as
|
||||
you’d run the reusable custom transformer test:</p>
|
||||
<pre><code>(cd api; go test -run TestReusableCustomTransformers ./krusty)
|
||||
</code></pre><p>The output will demonstrate the bug or missing feature.</p>
|
||||
<p>Record this output in the test file in a call to
|
||||
<code>AssertActualEqualsExpected</code>, per all the other tests
|
||||
in the <a href="https://github.com/kubernetes-sigs/kustomize/tree/master/api/krusty">krusty package</a>. This makes the test pass,
|
||||
albeit with output demonstrating behavior you
|
||||
presumably want to change.</p>
|
||||
<p>Send the new test in a PR, along with commentary (in
|
||||
the test) on what you’d prefer to see.</p>
|
||||
<p>The person who fixes the bug then has a clear bug
|
||||
reproduction and a test to modify when the bug is
|
||||
fixed.</p>
|
||||
<p>Any bug fix first requires a test demonstrating the bug
|
||||
(so we have permanent regression coverage), so if the
|
||||
<em>bug reporter</em> does this, it saves time and avoids
|
||||
misunderstandings.</p>
|
||||
<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">
|
||||
|
||||
@@ -501,7 +469,7 @@ misunderstandings.</p>
|
||||
|
||||
|
||||
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 4, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/0834e152b203ffeccfbbf1ddd3c1f49debdac341">Redirect kustomize docs to the new unified site. (0834e152)</a>
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 11, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/71b763888cad614abb44b3086e291fe72d601080">Remove duplicate kustomize docs content (71b76388)</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -439,14 +439,7 @@
|
||||
<h1>Community Engagment</h1>
|
||||
<div class="lead">Joining SIG-CLI and the Kubernetes community</div>
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/contributing/kustomize/community" />
|
||||
<p>Kustomize is a sub project of the Kubernetes <a href="https://github.com/kubernetes/community/tree/master/sig-cli#cli-special-interest-group">CLI special interest group</a> and follows the Kubernetes
|
||||
project <a href="https://github.com/kubernetes/community/blob/master/community-membership.md#community-membership">contributor roles</a>.</p>
|
||||
<p>If you are interested in contributing towards Kustomize or getting more involved with the community:</p>
|
||||
<ul>
|
||||
<li>join the <a href="https://groups.google.com/forum/#!forum/kubernetes-sig-cli">mailing list</a> and reach out</li>
|
||||
<li>join the <a href="https://kubernetes.slack.com/messages/sig-cli">slack channel</a> and reach out</li>
|
||||
<li>attend one of the <a href="https://docs.google.com/document/d/1r0YElcXt6G5mOWxwZiXgGu_X6he3F--wKwg-9UBc29I/edit?usp=sharing">bi-weekly meetings</a> (alternating Wednesdays at 9:00am Pacific Time)</li>
|
||||
</ul>
|
||||
<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">
|
||||
|
||||
@@ -476,7 +469,7 @@ project <a href="https://github.com/kubernetes/community/blob/master/community-m
|
||||
|
||||
|
||||
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 4, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/0834e152b203ffeccfbbf1ddd3c1f49debdac341">Redirect kustomize docs to the new unified site. (0834e152)</a>
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 11, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/71b763888cad614abb44b3086e291fe72d601080">Remove duplicate kustomize docs content (71b76388)</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -403,20 +403,6 @@
|
||||
|
||||
|
||||
|
||||
<nav id="TableOfContents">
|
||||
<ul>
|
||||
<li><a href="#prerequisites">Prerequisites</a></li>
|
||||
<li><a href="#development">Development</a></li>
|
||||
<li><a href="#publishing">Publishing</a></li>
|
||||
<li><a href="#publishing-docs-to-your-kustomize-fork">Publishing docs to your kustomize fork</a>
|
||||
<ul>
|
||||
<li><a href="#setup-github-pages-for-the-fork">Setup GitHub Pages for the fork</a></li>
|
||||
<li><a href="#publish-to-the-forks-github-pages">Publish to the fork’s GitHub Pages</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
@@ -453,71 +439,7 @@
|
||||
<h1>Writing Docs</h1>
|
||||
<div class="lead">How to make Kustomize docs contributions</div>
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/contributing/kustomize/docs" />
|
||||
<p>Kustomize uses <a href="https://www.docsy.dev">Docsy</a> for the site, and was
|
||||
forked from the <a href="https://github.com/google/docsy-example">docsy-example</a></p>
|
||||
<h2 id="prerequisites">Prerequisites</h2>
|
||||
<ul>
|
||||
<li><a href="https://gohugo.io/getting-started/installing/#fetch-from-github">Install hugo</a></li>
|
||||
<li>Clone kustomize
|
||||
<ul>
|
||||
<li><code>git clone git@github.com:kubernetes-sigs/kustomize && cd kustomize/</code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<h2 id="development">Development</h2>
|
||||
<p>The doc input files are in the <code>site</code> directory. The site can be hosted locally using
|
||||
<code>hugo serve</code>.</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#204a87">cd</span> site/
|
||||
hugo serve
|
||||
</code></pre></div><div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">...
|
||||
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
|
||||
Web Server is available at http://localhost:1313/kustomize/ <span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#204a87">bind</span> address 127.0.0.1<span style="color:#ce5c00;font-weight:bold">)</span>
|
||||
</code></pre></div><h2 id="publishing">Publishing</h2>
|
||||
<p>Hugo compiles the files under <code>site</code> Hugo into html which it puts in the <code>docs</code> folder:</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#204a87">cd</span> site/
|
||||
hugo
|
||||
</code></pre></div><div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"> <span style="color:#000;font-weight:bold">|</span> EN
|
||||
-------------------+-----
|
||||
Pages <span style="color:#000;font-weight:bold">|</span> <span style="color:#0000cf;font-weight:bold">99</span>
|
||||
Paginator pages <span style="color:#000;font-weight:bold">|</span> <span style="color:#0000cf;font-weight:bold">0</span>
|
||||
Non-page files <span style="color:#000;font-weight:bold">|</span> <span style="color:#0000cf;font-weight:bold">0</span>
|
||||
Static files <span style="color:#000;font-weight:bold">|</span> <span style="color:#0000cf;font-weight:bold">47</span>
|
||||
Processed images <span style="color:#000;font-weight:bold">|</span> <span style="color:#0000cf;font-weight:bold">0</span>
|
||||
Aliases <span style="color:#000;font-weight:bold">|</span> <span style="color:#0000cf;font-weight:bold">2</span>
|
||||
Sitemaps <span style="color:#000;font-weight:bold">|</span> <span style="color:#0000cf;font-weight:bold">1</span>
|
||||
Cleaned <span style="color:#000;font-weight:bold">|</span> <span style="color:#0000cf;font-weight:bold">0</span>
|
||||
</code></pre></div><p>Add the <code>site/</code> and <code>docs/</code> folders to a commit, then create a PR.</p>
|
||||
<h2 id="publishing-docs-to-your-kustomize-fork">Publishing docs to your kustomize fork</h2>
|
||||
<p>It is possible to have the kustomize docs published to your forks github pages.</p>
|
||||
<h3 id="setup-github-pages-for-the-fork">Setup GitHub Pages for the fork</h3>
|
||||
<ol>
|
||||
<li>Go to the <em>forked repo’s</em> <strong>Settings</strong> tab
|
||||
<ul>
|
||||
<li>e.g. <a href="https://github.com/pwittrock/kustomize">https://github.com/pwittrock/kustomize</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Go to the <strong>GitHub Pages</strong> section</li>
|
||||
<li>Set the source to master branch <strong>/docs folder</strong></li>
|
||||
</ol>
|
||||
<h3 id="publish-to-the-forks-github-pages">Publish to the fork’s GitHub Pages</h3>
|
||||
|
||||
|
||||
<div class="pageinfo pageinfo-info">
|
||||
<p>Changes must be pushed to the fork’s <strong>master branch</strong> to be served as the fork’s GitHub Page.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<ol>
|
||||
<li>Make a change to a file under <code>site/content</code></li>
|
||||
<li>Run <code>hugo</code> from the <code>site/</code> directory</li>
|
||||
<li>Add the <code>site</code> and <code>docs</code> directories to the <strong>master branch</strong></li>
|
||||
<li>Commit and push the changes to the <em>remote fork’s</em> <strong>master branch</strong></li>
|
||||
<li>After a few minutes, the docs should be served from the fork’s GitHub Page
|
||||
<ul>
|
||||
<li>e.g. <a href="https://pwittrock.github.io/kustomize/">https://pwittrock.github.io/kustomize/</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ol>
|
||||
<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">
|
||||
|
||||
@@ -547,7 +469,7 @@ hugo
|
||||
|
||||
|
||||
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 4, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/0834e152b203ffeccfbbf1ddd3c1f49debdac341">Redirect kustomize docs to the new unified site. (0834e152)</a>
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 11, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/71b763888cad614abb44b3086e291fe72d601080">Remove duplicate kustomize docs content (71b76388)</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -439,39 +439,7 @@
|
||||
<h1>Contributing Features</h1>
|
||||
<div class="lead">How to contribute features</div>
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/contributing/kustomize/features" />
|
||||
<p>Following is the process for proposing a new Kustomize feature:</p>
|
||||
<ol>
|
||||
<li>Check the <a href="https://kubernetes-sigs.github.io/kustomize/faq/eschewedfeatures/">eschewed feature list</a> to see if the feature has already been proposed</li>
|
||||
<li>File an <a href="https://github.com/kubernetes-sigs/kustomize/issues">issue</a> describing the desired feature
|
||||
<ul>
|
||||
<li>label it <a href="https://github.com/kubernetes-sigs/kustomize/labels/kind%2Ffeature">kind/feature</a></li>
|
||||
<li>the motivation for the feature</li>
|
||||
<li>example of how you would accomplish the motivating task <em>without</em> the feature</li>
|
||||
<li>example of how you would accomplish the motivating task <em>with</em> the feature</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Email the <a href="/kustomize/contributing/community/">sig-cli</a> mailing list with the issue</li>
|
||||
<li>Present the issue at <a href="/kustomize/contributing/community/">sig-cli</a> bi-weekly meeting on Zoom
|
||||
<ul>
|
||||
<li>add it to the <a href="https://docs.google.com/document/d/1r0YElcXt6G5mOWxwZiXgGu_X6he3F--wKwg-9UBc29I/edit#heading=h.himo1st0tqyy">meeting agenda</a> doc</li>
|
||||
<li>be present to discuss the feature</li>
|
||||
<li>response may be – move forward with a PoC, not to move forward, defer and come back later,
|
||||
or more information is needed.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Address the feedback on the issue
|
||||
<ul>
|
||||
<li>Possibly write a KEP for tracking the feature</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Implement the feature and send a PR
|
||||
<ul>
|
||||
<li>Add <a href="https://github.com/kubernetes-sigs/kustomize/blob/a8b9741866cf8e0c43e643ab7a9f40a3bd7e2a4d/api/filters/imagetag/imagetag_test.go#L15">table-driven</a> tests</li>
|
||||
<li>Expect comments on the PR within 2 weeks</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Kustomize team will release the kustomize <code>api</code> and <code>kustomize</code> modules</li>
|
||||
</ol>
|
||||
<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">
|
||||
|
||||
@@ -501,7 +469,7 @@ or more information is needed.</li>
|
||||
|
||||
|
||||
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 4, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/0834e152b203ffeccfbbf1ddd3c1f49debdac341">Redirect kustomize docs to the new unified site. (0834e152)</a>
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 11, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/71b763888cad614abb44b3086e291fe72d601080">Remove duplicate kustomize docs content (71b76388)</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -439,100 +439,7 @@
|
||||
<h1>Writing Code</h1>
|
||||
<div class="lead">How to modify Kustomize</div>
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/contributing/kustomize/howitworks" />
|
||||
|
||||
|
||||
<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>
|
||||
<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">
|
||||
|
||||
@@ -562,7 +469,7 @@ the <code>kustomize/go.mod</code>.</p>
|
||||
|
||||
|
||||
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 4, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/0834e152b203ffeccfbbf1ddd3c1f49debdac341">Redirect kustomize docs to the new unified site. (0834e152)</a>
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 11, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/71b763888cad614abb44b3086e291fe72d601080">Remove duplicate kustomize docs content (71b76388)</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -403,19 +403,6 @@
|
||||
|
||||
|
||||
|
||||
<nav id="TableOfContents">
|
||||
<ul>
|
||||
<li>
|
||||
<ul>
|
||||
<li><a href="#install-go-113">Install go 1.13</a></li>
|
||||
<li><a href="#install-kubeval">Install kubeval</a></li>
|
||||
<li><a href="#install-gnu-tools">Install gnu tools</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#make-everything">Make everything</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
@@ -452,22 +439,7 @@
|
||||
<h1>MacOS Dev Guide</h1>
|
||||
<div class="lead">How to develop on MacOS</div>
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/contributing/kustomize/mac" />
|
||||
<p>First install the tools to build and run tests</p>
|
||||
<h3 id="install-go-113">Install go 1.13</h3>
|
||||
<p><a href="https://golang.org/doc/install">Instructions</a></p>
|
||||
<p>Add <code>go</code> to your PATH</p>
|
||||
<h3 id="install-kubeval">Install kubeval</h3>
|
||||
<p><a href="https://github.com/instrumenta/kubeval">Instructions</a></p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-sh" data-lang="sh">go get github.com/instrumenta/kubeval
|
||||
</code></pre></div><p>Add <code>kubeval</code> to your PATH</p>
|
||||
<h3 id="install-gnu-tools">Install gnu tools</h3>
|
||||
<p><a href="https://www.topbug.net/blog/2013/04/14/install-and-use-gnu-command-line-tools-in-mac-os-x/">Instructions</a></p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-sh" data-lang="sh">brew install coreutils wget gnu-sed tree
|
||||
</code></pre></div><p>Add the new tools to your PATH</p>
|
||||
<h2 id="make-everything">Make everything</h2>
|
||||
<p>Verify your install by running <code>make</code>:</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-sh" data-lang="sh">make
|
||||
</code></pre></div><p>Be default, this runs all tests needed to qualify a pull request.</p>
|
||||
<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">
|
||||
|
||||
@@ -497,7 +469,7 @@
|
||||
|
||||
|
||||
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 4, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/0834e152b203ffeccfbbf1ddd3c1f49debdac341">Redirect kustomize docs to the new unified site. (0834e152)</a>
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 11, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/71b763888cad614abb44b3086e291fe72d601080">Remove duplicate kustomize docs content (71b76388)</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -403,16 +403,6 @@
|
||||
|
||||
|
||||
|
||||
<nav id="TableOfContents">
|
||||
<ul>
|
||||
<li><a href="#pre-reqs">Pre-Reqs</a>
|
||||
<ul>
|
||||
<li><a href="#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</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
@@ -449,83 +439,7 @@
|
||||
<h1>Windows Dev Guide</h1>
|
||||
<div class="lead">How to develop on Windows</div>
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/contributing/kustomize/windows" />
|
||||
<p>This is the PowerShell script to run all go tests for Kustomize on a windows based platform which mimics /build/pre-commit.sh</p>
|
||||
<h2 id="pre-reqs">Pre-Reqs</h2>
|
||||
<ul>
|
||||
<li>PowerShell installed
|
||||
<ul>
|
||||
<li>PowerShell Core is supported</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>go installed</li>
|
||||
<li>golangci-lint installed</li>
|
||||
<li>mdrip installed</li>
|
||||
</ul>
|
||||
<p>This script should output to the current console and return an exit code if all tests are successful(0) or any failed(1).</p>
|
||||
<h3 id="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</h3>
|
||||
<p>Assume:</p>
|
||||
<ul>
|
||||
<li>Running a stock Windows 10 system</li>
|
||||
<li>Local Admin rights.</li>
|
||||
<li>You can open <a href="http://lmgtfy.com/?iie=1&q=How+to+open+powershell+as+administrator">PowerShell as administrator</a></li>
|
||||
<li>You should be knowledgeable enough to pull source for packages into your GO <code>src</code> directory
|
||||
<ul>
|
||||
<li>Yes, this means you also need to know a bit about <strong>git</strong> usually</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<h4 id="step-1---install-go">Step 1 - Install Go</h4>
|
||||
<ul>
|
||||
<li><a href="https://golang.org/dl/">Install Go</a> - please use the msi
|
||||
<ul>
|
||||
<li>If you use chocolatey - it’s using the zip not msi and assumptions on where go is located are made for you.</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<h4 id="step-2---install-go-packages">Step 2 - Install Go Packages</h4>
|
||||
<ul>
|
||||
<li>Open new PowerShell Administrative window
|
||||
<ul>
|
||||
<li>Install golangci-lint
|
||||
<ul>
|
||||
<li><code>go get -u github.com/golangci/golangci-lint/cmd/golangci-lint</code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Install mdrip
|
||||
<ul>
|
||||
<li><code>go get github.com/monopole/mdrip</code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<p>You should now be able to issue these commands and see comparable responses</p>
|
||||
<pre><code>C:\...> golangci-lint --help
|
||||
Smart, fast linters runner. Run it in cloud for every GitHub pull request on https://golangci.com
|
||||
...
|
||||
|
||||
C:\...> mdrip --help
|
||||
Usage: C:\_go\bin\mdrip.exe {fileName}...
|
||||
...
|
||||
</code></pre><h4 id="step-3---get-source-and-test">Step 3 - Get Source and Test</h4>
|
||||
<ul>
|
||||
<li>In your GoRoot src
|
||||
<ul>
|
||||
<li><code>Example: C:\_go\src</code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Navigate to the Kustomize <code>travis</code> directory
|
||||
<ul>
|
||||
<li><code>Example: C:\_go\src\sigs.k8s.io\kustomize\scripts</code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Now Execute:
|
||||
<ul>
|
||||
<li><code>.\Invoke-PreCommit.ps1</code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<p>This should run all pre-commit tests thus defined in the script.</p>
|
||||
<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">
|
||||
|
||||
@@ -555,7 +469,7 @@ Usage: C:\_go\bin\mdrip.exe {fileName}...
|
||||
|
||||
|
||||
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 4, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/0834e152b203ffeccfbbf1ddd3c1f49debdac341">Redirect kustomize docs to the new unified site. (0834e152)</a>
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 11, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/71b763888cad614abb44b3086e291fe72d601080">Remove duplicate kustomize docs content (71b76388)</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/guides/bespoke/</loc>
|
||||
<lastmod>2020-11-04T11:15:40-08:00</lastmod>
|
||||
<lastmod>2020-11-11T08:29:43-08:00</lastmod>
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="zh"
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/installation/source/</loc>
|
||||
<lastmod>2020-11-04T11:15:40-08:00</lastmod>
|
||||
<lastmod>2020-11-11T08:29:43-08:00</lastmod>
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="zh"
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/guides/</loc>
|
||||
<lastmod>2020-11-04T11:15:40-08:00</lastmod>
|
||||
<lastmod>2020-11-11T08:29:43-08:00</lastmod>
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="zh"
|
||||
@@ -49,7 +49,7 @@
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/guides/offtheshelf/</loc>
|
||||
<lastmod>2020-11-04T11:15:40-08:00</lastmod>
|
||||
<lastmod>2020-11-11T08:29:43-08:00</lastmod>
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="zh"
|
||||
@@ -64,7 +64,7 @@
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/installation/binaries/</loc>
|
||||
<lastmod>2020-11-04T11:15:40-08:00</lastmod>
|
||||
<lastmod>2020-11-11T08:29:43-08:00</lastmod>
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="zh"
|
||||
@@ -79,7 +79,7 @@
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/installation/homebrew/</loc>
|
||||
<lastmod>2020-11-04T11:15:40-08:00</lastmod>
|
||||
<lastmod>2020-11-11T08:29:43-08:00</lastmod>
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="zh"
|
||||
@@ -94,7 +94,7 @@
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/api-reference/</loc>
|
||||
<lastmod>2020-11-04T11:15:40-08:00</lastmod>
|
||||
<lastmod>2020-11-11T08:29:43-08:00</lastmod>
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="zh"
|
||||
@@ -109,7 +109,7 @@
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/installation/chocolatey/</loc>
|
||||
<lastmod>2020-11-04T11:15:40-08:00</lastmod>
|
||||
<lastmod>2020-11-11T08:29:43-08:00</lastmod>
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="zh"
|
||||
@@ -124,7 +124,7 @@
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/contributing/bugs/</loc>
|
||||
<lastmod>2020-11-04T11:15:40-08:00</lastmod>
|
||||
<lastmod>2020-11-11T08:29:43-08:00</lastmod>
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="zh"
|
||||
@@ -139,7 +139,7 @@
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/api-reference/kustomization/</loc>
|
||||
<lastmod>2020-11-04T11:15:40-08:00</lastmod>
|
||||
<lastmod>2020-11-11T08:29:43-08:00</lastmod>
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="zh"
|
||||
@@ -154,7 +154,7 @@
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/contributing/community/</loc>
|
||||
<lastmod>2020-11-04T11:15:40-08:00</lastmod>
|
||||
<lastmod>2020-11-11T08:29:43-08:00</lastmod>
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="zh"
|
||||
@@ -169,7 +169,7 @@
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/installation/</loc>
|
||||
<lastmod>2020-11-04T11:15:40-08:00</lastmod>
|
||||
<lastmod>2020-11-11T08:29:43-08:00</lastmod>
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="zh"
|
||||
@@ -184,7 +184,7 @@
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/blog/releases/</loc>
|
||||
<lastmod>2020-11-04T11:15:40-08:00</lastmod>
|
||||
<lastmod>2020-11-11T08:29:43-08:00</lastmod>
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="zh"
|
||||
@@ -199,7 +199,7 @@
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/contributing/features/</loc>
|
||||
<lastmod>2020-11-04T11:15:40-08:00</lastmod>
|
||||
<lastmod>2020-11-11T08:29:43-08:00</lastmod>
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="zh"
|
||||
@@ -214,7 +214,7 @@
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/contributing/docs/</loc>
|
||||
<lastmod>2020-11-04T11:15:40-08:00</lastmod>
|
||||
<lastmod>2020-11-11T08:29:43-08:00</lastmod>
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="zh"
|
||||
@@ -229,7 +229,7 @@
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/contributing/howitworks/</loc>
|
||||
<lastmod>2020-11-04T11:15:40-08:00</lastmod>
|
||||
<lastmod>2020-11-11T08:29:43-08:00</lastmod>
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="zh"
|
||||
@@ -244,7 +244,7 @@
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/contributing/mac/</loc>
|
||||
<lastmod>2020-11-04T11:15:40-08:00</lastmod>
|
||||
<lastmod>2020-11-11T08:29:43-08:00</lastmod>
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="zh"
|
||||
@@ -259,7 +259,7 @@
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/contributing/windows/</loc>
|
||||
<lastmod>2020-11-04T11:15:40-08:00</lastmod>
|
||||
<lastmod>2020-11-11T08:29:43-08:00</lastmod>
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="zh"
|
||||
@@ -274,7 +274,7 @@
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/guides/plugins/</loc>
|
||||
<lastmod>2020-11-04T11:15:40-08:00</lastmod>
|
||||
<lastmod>2020-11-11T08:29:43-08:00</lastmod>
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="zh"
|
||||
@@ -289,7 +289,7 @@
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/faq/eschewedfeatures/</loc>
|
||||
<lastmod>2020-11-04T11:15:40-08:00</lastmod>
|
||||
<lastmod>2020-11-11T08:29:43-08:00</lastmod>
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="zh"
|
||||
@@ -304,7 +304,7 @@
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/api-reference/glossary/</loc>
|
||||
<lastmod>2020-11-04T11:15:40-08:00</lastmod>
|
||||
<lastmod>2020-11-11T08:29:43-08:00</lastmod>
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="zh"
|
||||
@@ -319,7 +319,7 @@
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/faq/versioningpolicy/</loc>
|
||||
<lastmod>2020-11-04T11:15:40-08:00</lastmod>
|
||||
<lastmod>2020-11-11T08:29:43-08:00</lastmod>
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="zh"
|
||||
@@ -469,7 +469,7 @@
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/api-reference/kustomization/bases/</loc>
|
||||
<lastmod>2020-11-04T11:15:40-08:00</lastmod>
|
||||
<lastmod>2020-11-11T08:29:43-08:00</lastmod>
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="zh"
|
||||
@@ -484,7 +484,7 @@
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/blog/</loc>
|
||||
<lastmod>2020-11-04T11:15:40-08:00</lastmod>
|
||||
<lastmod>2020-11-11T08:29:43-08:00</lastmod>
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="zh"
|
||||
@@ -497,14 +497,9 @@
|
||||
/>
|
||||
</url>
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/guides/cmd/build/</loc>
|
||||
<lastmod>2020-09-05T11:36:49-04:00</lastmod>
|
||||
</url>
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/guides/plugins/builtins/</loc>
|
||||
<lastmod>2020-11-04T11:15:40-08:00</lastmod>
|
||||
<lastmod>2020-11-11T08:29:43-08:00</lastmod>
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="zh"
|
||||
@@ -517,19 +512,9 @@
|
||||
/>
|
||||
</url>
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/guides/cmd/cfg/</loc>
|
||||
<lastmod>2020-09-05T11:36:49-04:00</lastmod>
|
||||
</url>
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/guides/cmd/</loc>
|
||||
<lastmod>2020-09-05T11:36:49-04:00</lastmod>
|
||||
</url>
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/api-reference/kustomization/commonannotations/</loc>
|
||||
<lastmod>2020-11-04T11:15:40-08:00</lastmod>
|
||||
<lastmod>2020-11-11T08:29:43-08:00</lastmod>
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="zh"
|
||||
@@ -544,7 +529,7 @@
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/api-reference/kustomization/commonlabels/</loc>
|
||||
<lastmod>2020-11-04T11:15:40-08:00</lastmod>
|
||||
<lastmod>2020-11-11T08:29:43-08:00</lastmod>
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="zh"
|
||||
@@ -559,7 +544,7 @@
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/api-reference/kustomization/components/</loc>
|
||||
<lastmod>2020-11-04T11:15:40-08:00</lastmod>
|
||||
<lastmod>2020-11-11T08:29:43-08:00</lastmod>
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="zh"
|
||||
@@ -574,7 +559,7 @@
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/api-reference/kustomization/configmapgenerator/</loc>
|
||||
<lastmod>2020-11-04T11:15:40-08:00</lastmod>
|
||||
<lastmod>2020-11-11T08:29:43-08:00</lastmod>
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="zh"
|
||||
@@ -604,7 +589,7 @@
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/api-reference/kustomization/crds/</loc>
|
||||
<lastmod>2020-11-04T11:15:40-08:00</lastmod>
|
||||
<lastmod>2020-11-11T08:29:43-08:00</lastmod>
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="zh"
|
||||
@@ -617,19 +602,9 @@
|
||||
/>
|
||||
</url>
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/guides/cmd/create/</loc>
|
||||
<lastmod>2020-09-05T11:36:49-04:00</lastmod>
|
||||
</url>
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/guides/cmd/edit/</loc>
|
||||
<lastmod>2020-09-05T11:36:49-04:00</lastmod>
|
||||
</url>
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/guides/plugins/execpluginguidedexample/</loc>
|
||||
<lastmod>2020-11-04T11:15:40-08:00</lastmod>
|
||||
<lastmod>2020-11-11T08:29:43-08:00</lastmod>
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="zh"
|
||||
@@ -644,7 +619,7 @@
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/faq/</loc>
|
||||
<lastmod>2020-11-04T11:15:40-08:00</lastmod>
|
||||
<lastmod>2020-11-11T08:29:43-08:00</lastmod>
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="zh"
|
||||
@@ -657,14 +632,9 @@
|
||||
/>
|
||||
</url>
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/guides/cmd/fn/</loc>
|
||||
<lastmod>2020-09-05T11:36:49-04:00</lastmod>
|
||||
</url>
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/api-reference/kustomization/generatoroptions/</loc>
|
||||
<lastmod>2020-11-04T11:15:40-08:00</lastmod>
|
||||
<lastmod>2020-11-11T08:29:43-08:00</lastmod>
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="zh"
|
||||
@@ -679,7 +649,7 @@
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/guides/plugins/goplugincaveats/</loc>
|
||||
<lastmod>2020-11-04T11:15:40-08:00</lastmod>
|
||||
<lastmod>2020-11-11T08:29:43-08:00</lastmod>
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="zh"
|
||||
@@ -694,7 +664,7 @@
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/guides/plugins/gopluginguidedexample/</loc>
|
||||
<lastmod>2020-11-04T11:15:40-08:00</lastmod>
|
||||
<lastmod>2020-11-11T08:29:43-08:00</lastmod>
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="zh"
|
||||
@@ -707,14 +677,9 @@
|
||||
/>
|
||||
</url>
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/guides/cmd/help/</loc>
|
||||
<lastmod>2020-09-05T11:36:49-04:00</lastmod>
|
||||
</url>
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/api-reference/kustomization/images/</loc>
|
||||
<lastmod>2020-11-04T11:15:40-08:00</lastmod>
|
||||
<lastmod>2020-11-11T08:29:43-08:00</lastmod>
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="zh"
|
||||
@@ -727,11 +692,6 @@
|
||||
/>
|
||||
</url>
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/guides/cmd/install-completion/</loc>
|
||||
<lastmod>2020-09-05T11:36:49-04:00</lastmod>
|
||||
</url>
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/</loc>
|
||||
<lastmod>2020-07-16T12:57:18-07:00</lastmod>
|
||||
@@ -749,17 +709,12 @@
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/guides/components/</loc>
|
||||
<lastmod>2020-11-04T11:15:40-08:00</lastmod>
|
||||
</url>
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/guides/cmd/live/</loc>
|
||||
<lastmod>2020-09-05T11:36:49-04:00</lastmod>
|
||||
<lastmod>2020-11-11T08:29:43-08:00</lastmod>
|
||||
</url>
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/api-reference/kustomization/nameprefix/</loc>
|
||||
<lastmod>2020-11-04T11:15:40-08:00</lastmod>
|
||||
<lastmod>2020-11-11T08:29:43-08:00</lastmod>
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="zh"
|
||||
@@ -774,7 +729,7 @@
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/api-reference/kustomization/namespace/</loc>
|
||||
<lastmod>2020-11-04T11:15:40-08:00</lastmod>
|
||||
<lastmod>2020-11-11T08:29:43-08:00</lastmod>
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="zh"
|
||||
@@ -789,7 +744,7 @@
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/api-reference/kustomization/namesuffix/</loc>
|
||||
<lastmod>2020-11-04T11:15:40-08:00</lastmod>
|
||||
<lastmod>2020-11-11T08:29:43-08:00</lastmod>
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="zh"
|
||||
@@ -804,7 +759,7 @@
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/api-reference/kustomization/patches/</loc>
|
||||
<lastmod>2020-11-04T11:15:40-08:00</lastmod>
|
||||
<lastmod>2020-11-11T08:29:43-08:00</lastmod>
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="zh"
|
||||
@@ -819,7 +774,7 @@
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/api-reference/kustomization/patchesjson6902/</loc>
|
||||
<lastmod>2020-11-04T11:15:40-08:00</lastmod>
|
||||
<lastmod>2020-11-11T08:29:43-08:00</lastmod>
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="zh"
|
||||
@@ -834,7 +789,7 @@
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/api-reference/kustomization/patchesstrategicmerge/</loc>
|
||||
<lastmod>2020-11-04T11:15:40-08:00</lastmod>
|
||||
<lastmod>2020-11-11T08:29:43-08:00</lastmod>
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="zh"
|
||||
@@ -849,7 +804,7 @@
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/api-reference/kustomization/replicas/</loc>
|
||||
<lastmod>2020-11-04T11:15:40-08:00</lastmod>
|
||||
<lastmod>2020-11-11T08:29:43-08:00</lastmod>
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="zh"
|
||||
@@ -864,7 +819,7 @@
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/api-reference/kustomization/resources/</loc>
|
||||
<lastmod>2020-11-04T11:15:40-08:00</lastmod>
|
||||
<lastmod>2020-11-11T08:29:43-08:00</lastmod>
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="zh"
|
||||
@@ -894,7 +849,7 @@
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/api-reference/kustomization/secretegenerator/</loc>
|
||||
<lastmod>2020-11-04T11:15:40-08:00</lastmod>
|
||||
<lastmod>2020-11-11T08:29:43-08:00</lastmod>
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="zh"
|
||||
@@ -909,7 +864,7 @@
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/api-reference/kustomization/vars/</loc>
|
||||
<lastmod>2020-11-04T11:15:40-08:00</lastmod>
|
||||
<lastmod>2020-11-11T08:29:43-08:00</lastmod>
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="zh"
|
||||
@@ -922,9 +877,4 @@
|
||||
/>
|
||||
</url>
|
||||
|
||||
<url>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/guides/cmd/version/</loc>
|
||||
<lastmod>2020-09-05T11:36:49-04:00</lastmod>
|
||||
</url>
|
||||
|
||||
</urlset>
|
||||
|
||||
@@ -271,15 +271,6 @@
|
||||
|
||||
|
||||
|
||||
<nav id="TableOfContents">
|
||||
<ul>
|
||||
<li><a href="#removal-directives">Removal directives</a></li>
|
||||
<li><a href="#unstructured-edits">Unstructured edits</a></li>
|
||||
<li><a href="#build-time-side-effects-from-cli-args-or-env-variables">Build-time side effects from CLI args or env variables</a></li>
|
||||
<li><a href="#globs-in-kustomization-files">Globs in kustomization files</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
@@ -316,117 +307,7 @@
|
||||
<h1>Eschewed Features</h1>
|
||||
<div class="lead">Eschewed Features</div>
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/faq/kustomize/eschewedfeatures/" />
|
||||
<p>The maintainers established this list to
|
||||
place bounds on the kustomize feature
|
||||
set. The bounds can be changed with
|
||||
a consensus on the risks.</p>
|
||||
<p>For a bigger picture about why kustomize
|
||||
does some things and not others, see the
|
||||
glossary entry for <a href="/kustomize/api-reference/glossary#declarative-application-management">DAM</a>.</p>
|
||||
<h2 id="removal-directives">Removal directives</h2>
|
||||
<p><code>kustomize</code> supports configurations that can be reasoned about as
|
||||
<em>compositions</em> or <em>mixins</em> - concepts that are widely accepted as
|
||||
a best practice in various programming languages.</p>
|
||||
<p>To this end, <code>kustomize</code> offers various <em>addition</em> directives.
|
||||
One may add labels, annotations, patches, resources, bases, etc.
|
||||
Corresponding <em>removal</em> directives are not offered.</p>
|
||||
<p>Removal semantics would introduce many possibilities for
|
||||
inconsistency, and the need to add code to detect, report and
|
||||
reject it. It would also allow, and possibly encourage,
|
||||
unnecessarily complex configuration layouts.</p>
|
||||
<p>When faced with a situation where removal is desirable, it’s
|
||||
always possible to remove things from a base like labels and
|
||||
annotations, and/or split multi-resource manifests into individual
|
||||
resource files - then add things back as desired via the
|
||||
<a href="/kustomize/api-reference/glossary#kustomization">kustomization</a>.</p>
|
||||
<p>If the underlying base is outside of one’s control, an <a href="/kustomize/api-reference/glossary#off-the-shelf-configuration">OTS
|
||||
workflow</a> is the recommended best practice. Fork the base, remove
|
||||
what you don’t want and commit it to your private fork, then use
|
||||
kustomize on your fork. As often as desired, use <em>git rebase</em> to
|
||||
capture improvements from the upstream base.</p>
|
||||
<h2 id="unstructured-edits">Unstructured edits</h2>
|
||||
<p><em>Structured edits</em> are changes controlled by
|
||||
knowledge of the k8s API, and YAML or JSON syntax.</p>
|
||||
<p>Most edits performed by kustomize can be expressed as
|
||||
<a href="/kustomize/api-reference/glossary#patchjson6902">JSON patches</a> or <a href="/kustomize/api-reference/glossary#patchstrategicmerge">SMP patches</a>.
|
||||
Those can be verbose, so common patches,
|
||||
like adding labels or annotatations, get dedicated
|
||||
transformer plugins - <code>LabelTransformer</code>,
|
||||
<code>AnnotationsTransformer</code>, etc.
|
||||
These accept relatively simple YAML configuration
|
||||
allowing easy targeting of any number of resources.</p>
|
||||
<p>Another class of edits take data from one specific
|
||||
object’s field and use it in another (e.g. a service
|
||||
object’s name found and copied into a container’s
|
||||
command line). These reflection-style edits
|
||||
are called <em>replacements</em>.</p>
|
||||
<p>The above edits create valid output given valid input,
|
||||
and can provide syntactically and semantically
|
||||
informed error messages if inputs are invalid.</p>
|
||||
<p><em>Unstructured edits</em>, edits that don’t limit
|
||||
themselves to a syntax or object structure,
|
||||
come in many forms. A common one in the
|
||||
configuration domain is the template or
|
||||
parameterization approach.</p>
|
||||
<p>In this technique, the source
|
||||
material is sprinkled with strings of the
|
||||
form <code>${VAR}</code>. A scanner replaces them
|
||||
with a value taken from a map using <code>VAR</code>
|
||||
as the map key. It’s trivial to implement.</p>
|
||||
<p>kustomize eschews parameterization, because</p>
|
||||
<ul>
|
||||
<li>The source yaml gets polluted with <code>$VARs</code>
|
||||
and can no longed be applied as is
|
||||
to the cluster (it <em>must</em> be processed).</li>
|
||||
<li>The source material is no longer structured,
|
||||
making it unusable with any YAML processor.
|
||||
It’s no longer <em>data</em>, it’s now logic that
|
||||
must be compiled.</li>
|
||||
<li>Errors in the output are disconnected from
|
||||
the edit that caused it.</li>
|
||||
<li>The input becomes <a href="https://github.com/helm/charts/blob/e002378c13e91bef4a3b0ba718c191ec791ce3f9/stable/artifactory/templates/artifactory-deployment.yaml">unintelligible</a> as the project
|
||||
scales in any number of dimensions (resource
|
||||
count, cluster count, environment count, etc.)</li>
|
||||
</ul>
|
||||
<p>Kustomizations are meant to be sharable and stackable.
|
||||
Imagine tracing down a problem rooted in a
|
||||
clever set of stacked regexp replacements
|
||||
performed by various overlays on some remote base.
|
||||
We’ve used such systems, and never want to again.</p>
|
||||
<p>Other tools (sed, jinja, erb, envsubst, kafka, helm, ksonnet,
|
||||
etc.) provide varying degrees of unstructured editting
|
||||
and/or embedded languages, and can be used instead
|
||||
of, or in a pipe with, kustomize. If you want to
|
||||
go all-in on <em>configuration as a language</em>, consider <a href="https://cuelang.org/">cue</a>.</p>
|
||||
<p>kustomize is going to stick to YAML in / YAML out.</p>
|
||||
<h2 id="build-time-side-effects-from-cli-args-or-env-variables">Build-time side effects from CLI args or env variables</h2>
|
||||
<p><code>kustomize</code> supports the best practice of storing one’s
|
||||
entire configuration in a version control system.</p>
|
||||
<p>Changing <code>kustomize build</code> configuration output as a result
|
||||
of additional arguments or flags to <code>build</code>, or by
|
||||
consulting shell environment variable values in <code>build</code>
|
||||
code, would frustrate that goal.</p>
|
||||
<p><code>kustomize</code> insteads offers <a href="/kustomize/api-reference/glossary#kustomization">kustomization</a> file <code>edit</code>
|
||||
commands. Like any shell command, they can accept
|
||||
environment variable arguments.</p>
|
||||
<p>For example, to set the tag used on an image to match an
|
||||
environment variable, run</p>
|
||||
<pre><code>kustomize edit set image nginx:$MY_NGINX_VERSION
|
||||
</code></pre><p>as part of some encapsulating work flow executed before
|
||||
<code>kustomize build</code>.</p>
|
||||
<h2 id="globs-in-kustomization-files">Globs in kustomization files</h2>
|
||||
<p><code>kustomize</code> supports the best practice of storing one’s
|
||||
entire configuration in a version control system.</p>
|
||||
<p>Globbing the local file system for files not explicitly
|
||||
declared in the <a href="/kustomize/api-reference/glossary#kustomization">kustomization</a> file at <code>kustomize build</code> time
|
||||
would violate that goal.</p>
|
||||
<p>Allowing globbing in a kustomization file would also introduce
|
||||
the same problems as allowing globbing in <a href="https://www.codebyamir.com/blog/pitfalls-java-import-wildcards">java import</a>
|
||||
declarations or BUILD/Makefile dependency rules.</p>
|
||||
<p><code>kustomize</code> will instead provide kustomization file editting
|
||||
commands that accept globbed arguments, expand them at <em>edit
|
||||
time</em> relative to the local file system, and store the resulting
|
||||
explicit names into the kustomization file.</p>
|
||||
<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">
|
||||
|
||||
@@ -446,7 +327,7 @@ explicit names into the kustomization file.</p>
|
||||
|
||||
|
||||
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 4, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/0834e152b203ffeccfbbf1ddd3c1f49debdac341">Redirect kustomize docs to the new unified site. (0834e152)</a>
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 11, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/71b763888cad614abb44b3086e291fe72d601080">Remove duplicate kustomize docs content (71b76388)</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -268,14 +268,6 @@
|
||||
|
||||
|
||||
|
||||
<nav id="TableOfContents">
|
||||
<ul>
|
||||
<li><a href="#kubectl-doesnt-have-the-latest-kustomize-when-will-it-be-updated">kubectl doesn’t have the latest kustomize, when will it be updated?</a></li>
|
||||
<li><a href="#security-file-foo-is-not-in-or-below-bar">security: file ‘foo’ is not in or below ‘bar’</a></li>
|
||||
<li><a href="#some-field-is-not-transformed-by-kustomize">Some field is not transformed by kustomize</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
@@ -302,59 +294,7 @@
|
||||
<h1>FAQ</h1>
|
||||
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/faq/kustomize/" />
|
||||
<h2 id="kubectl-doesnt-have-the-latest-kustomize-when-will-it-be-updated">kubectl doesn’t have the latest kustomize, when will it be updated?</h2>
|
||||
<p>TLDR: This is blocked on either moving kubectl into its own repo, or changing its dependencies. ETA k8s ~1.20.</p>
|
||||
<p>The adoption of go modules in the kubernetes/kubernetes repo broke the update process for kustomize.
|
||||
This is due to the kustomize libraries depending on the kubernetes apimachinery libraries, which are
|
||||
published out of the kubernetes staging directory.</p>
|
||||
<p>2 pieces of work are underway which will allow kustomize to be updated in kubectl:</p>
|
||||
<ul>
|
||||
<li>migrating kubectl out of kubernetes/kubernetes (expected Kubernetes ~1.20)</li>
|
||||
<li>migrating kustomize off of the apimachinery libraries (expected Kuberntes ~1.20)
|
||||
<ul>
|
||||
<li><a href="https://github.com/kubernetes-sigs/kustomize/issues/2506">2506</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<p>Once either of these issues is resolved we will then update kubectl with the latest kustomize version.</p>
|
||||
<h2 id="security-file-foo-is-not-in-or-below-bar">security: file ‘foo’ is not in or below ‘bar’</h2>
|
||||
<p>v2.0 added a security check that prevents
|
||||
kustomizations from reading files outside their own
|
||||
directory root.</p>
|
||||
<p>This was meant to help protect the person inclined to
|
||||
download kustomization directories from the web and use
|
||||
them without inspection to control their production
|
||||
cluster
|
||||
(see <a href="https://github.com/kubernetes-sigs/kustomize/issues/693">#693</a>,
|
||||
<a href="https://github.com/kubernetes-sigs/kustomize/pull/700">#700</a>,
|
||||
<a href="https://github.com/kubernetes-sigs/kustomize/pull/995">#995</a> and
|
||||
<a href="https://github.com/kubernetes-sigs/kustomize/pull/998">#998</a>)</p>
|
||||
<p>Resources (including configmap and secret generators)
|
||||
can <em>still be shared</em> via the recommended best practice
|
||||
of placing them in a directory with their own
|
||||
kustomization file, and referring to this directory as a
|
||||
<a href="/kustomize/api-reference/glossary#base"><code>base</code></a> from any kustomization that
|
||||
wants to use it. This encourages modularity and
|
||||
relocatability.</p>
|
||||
<p>To disable this, use v3, and the <code>load_restrictor</code> flag:</p>
|
||||
<pre><code>kustomize build --load_restrictor none $target
|
||||
</code></pre><h2 id="some-field-is-not-transformed-by-kustomize">Some field is not transformed by kustomize</h2>
|
||||
<p>Example: <a href="https://github.com/kubernetes-sigs/kustomize/issues/1319">#1319</a>, <a href="https://github.com/kubernetes-sigs/kustomize/issues/1322">#1322</a>, <a href="https://github.com/kubernetes-sigs/kustomize/issues/1347">#1347</a> and etc.</p>
|
||||
<p>The fields transformed by kustomize is configured explicitly in <a href="https://github.com/kubernetes-sigs/kustomize/tree/master/api/konfig/builtinpluginconsts/defaultconfig.go">defaultconfig</a>. The configuration itself can be customized by including <code>configurations</code> in <code>kustomization.yaml</code>, e.g.</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kustomize.config.k8s.io/v1beta1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Kustomization</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">configurations</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#000">kustomizeconfig.yaml</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><p>The configuration directive allows customization of the following transformers:</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">commonAnnotations</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000;font-weight:bold">[]</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">commonLabels</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000;font-weight:bold">[]</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">nameprefix</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000;font-weight:bold">[]</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000;font-weight:bold">[]</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">varreference</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000;font-weight:bold">[]</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">namereference</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000;font-weight:bold">[]</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">images</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000;font-weight:bold">[]</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">replicas</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000;font-weight:bold">[]</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><p>To persist the changes to default configuration, submit a PR like <a href="https://github.com/kubernetes-sigs/kustomize/pull/1338">#1338</a>, <a href="https://github.com/kubernetes-sigs/kustomize/pull/1348">#1348</a> and etc.</p>
|
||||
<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">
|
||||
|
||||
@@ -388,7 +328,7 @@ relocatability.</p>
|
||||
|
||||
|
||||
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 4, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/0834e152b203ffeccfbbf1ddd3c1f49debdac341">Redirect kustomize docs to the new unified site. (0834e152)</a>
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 11, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/71b763888cad614abb44b3086e291fe72d601080">Remove duplicate kustomize docs content (71b76388)</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -21,27 +21,21 @@
|
||||
<link rel="icon" type="image/png" href="/kustomize/favicons/android-192x192.png" sizes="192x192">
|
||||
|
||||
<title>Versioning Policy | Kustomize</title><meta property="og:title" content="Versioning Policy" />
|
||||
<meta property="og:description" content="Running kustomize means one is running a particular version of a program (a CLI), using a particular version of underlying packages (a Go API), and reading a particular version of a kustomization file.
|
||||
If you’re having trouble with go get, please read Go API Versioning and be patient.
|
||||
CLI Program Versioning The command kustomize version prints a three field version tag (e.g. v3.0.0) that aspires to semantic versioning." />
|
||||
<meta property="og:description" content="Moved to https://github.com/kubernetes-sigs/cli-experimental" />
|
||||
<meta property="og:type" content="article" />
|
||||
<meta property="og:url" content="https://kubernetes-sigs.github.io/kustomize/faq/versioningpolicy/" />
|
||||
<meta property="article:modified_time" content="2020-11-04T11:15:40-08:00" /><meta property="og:site_name" content="Kustomize" />
|
||||
<meta property="article:modified_time" content="2020-11-11T08:29:43-08:00" /><meta property="og:site_name" content="Kustomize" />
|
||||
<meta itemprop="name" content="Versioning Policy">
|
||||
<meta itemprop="description" content="Running kustomize means one is running a particular version of a program (a CLI), using a particular version of underlying packages (a Go API), and reading a particular version of a kustomization file.
|
||||
If you’re having trouble with go get, please read Go API Versioning and be patient.
|
||||
CLI Program Versioning The command kustomize version prints a three field version tag (e.g. v3.0.0) that aspires to semantic versioning.">
|
||||
<meta itemprop="dateModified" content="2020-11-04T11:15:40-08:00" />
|
||||
<meta itemprop="wordCount" content="1054">
|
||||
<meta itemprop="description" content="Moved to https://github.com/kubernetes-sigs/cli-experimental">
|
||||
<meta itemprop="dateModified" content="2020-11-11T08:29:43-08:00" />
|
||||
<meta itemprop="wordCount" content="3">
|
||||
|
||||
|
||||
|
||||
<meta itemprop="keywords" content="" />
|
||||
<meta name="twitter:card" content="summary"/>
|
||||
<meta name="twitter:title" content="Versioning Policy"/>
|
||||
<meta name="twitter:description" content="Running kustomize means one is running a particular version of a program (a CLI), using a particular version of underlying packages (a Go API), and reading a particular version of a kustomization file.
|
||||
If you’re having trouble with go get, please read Go API Versioning and be patient.
|
||||
CLI Program Versioning The command kustomize version prints a three field version tag (e.g. v3.0.0) that aspires to semantic versioning."/>
|
||||
<meta name="twitter:description" content="Moved to https://github.com/kubernetes-sigs/cli-experimental"/>
|
||||
|
||||
|
||||
|
||||
@@ -279,35 +273,6 @@
|
||||
|
||||
|
||||
|
||||
<nav id="TableOfContents">
|
||||
<ul>
|
||||
<li><a href="#cli-program-versioning">CLI Program Versioning</a>
|
||||
<ul>
|
||||
<li><a href="#installation">Installation</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#go-api-versioning">Go API Versioning</a>
|
||||
<ul>
|
||||
<li></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#kustomization-file-versioning">Kustomization File Versioning</a>
|
||||
<ul>
|
||||
<li><a href="#field-change-policy">Field Change Policy</a></li>
|
||||
<li><a href="#the-edit-fix-command">The <code>edit fix</code> Command</a></li>
|
||||
<li><a href="#examples">Examples</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#relationship-to-the-k8s-api">Relationship to the k8s API</a>
|
||||
<ul>
|
||||
<li><a href="#review-of-k8s-api-versioning">Review of k8s API versioning</a></li>
|
||||
<li><a href="#differences">Differences</a></li>
|
||||
<li><a href="#additional-kustomization-file-rules">Additional Kustomization file rules</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
@@ -344,213 +309,11 @@
|
||||
<h1>Versioning Policy</h1>
|
||||
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/faq/kustomize/versioningpolicy/" />
|
||||
<p>Running <code>kustomize</code> means one is running a
|
||||
particular version of a program (a CLI), using a
|
||||
particular version of underlying packages (a Go
|
||||
API), and reading a particular version of a
|
||||
<a href="/kustomize/api-reference/glossary#kustomization">kustomization</a> file.</p>
|
||||
<blockquote>
|
||||
<p>If you’re having trouble with <code>go get</code>, please
|
||||
read <a href="#go-api-versioning">Go API Versioning</a>
|
||||
and be patient.</p>
|
||||
</blockquote>
|
||||
<h2 id="cli-program-versioning">CLI Program Versioning</h2>
|
||||
<p>The command <code>kustomize version</code> prints a three
|
||||
field version tag (e.g. <code>v3.0.0</code>) that aspires to
|
||||
<a href="https://semver.org">semantic versioning</a>.</p>
|
||||
<p>This notion of semver applies only to the CLI;
|
||||
the command names, their arguments and their flags.</p>
|
||||
<p>The major version changes when some backward
|
||||
incompatibility appears in how the commands
|
||||
behave.</p>
|
||||
<h3 id="installation">Installation</h3>
|
||||
<p>See the <a href="INSTALL.md">installation docs</a>.</p>
|
||||
<h2 id="go-api-versioning">Go API Versioning</h2>
|
||||
<p>The public methods in the public packages
|
||||
of module <code>sigs.k8s.io/kustomize/api</code> constitute
|
||||
the <em>kustomize Go API</em>.</p>
|
||||
<h4 id="version-sigsk8siokustomizev3-and-earlier">Version sigs.k8s.io/kustomize/v3 and earlier</h4>
|
||||
<p>In <code>kustomize/v3</code> (and preceding major versions), the
|
||||
kustomize program and the API live the same Go
|
||||
module at <code>sigs.k8s.io/kustomize</code>, at <a href="https://github.com/golang/go/wiki/Modules#releasing-modules-v2-or-higher">import path</a>
|
||||
<code>sigs.k8s.io/kustomize/v3</code>.</p>
|
||||
<p>This has been fine for the CLI, but it presents a
|
||||
problem for the Go API.</p>
|
||||
<p>The process around Go modules, in particular the
|
||||
notion of <a href="https://research.swtch.com/vgo-mvs">minimal version selection</a>, demands
|
||||
that the module respect semver.</p>
|
||||
<p>Almost all the code in module
|
||||
<code>sigs.k8s.io/kustomize/v3</code> is exposed (not in a
|
||||
directory named <code>internal</code>). Even a minor
|
||||
refactor changing a method name or argument type
|
||||
in some deeply buried (but still public) method is
|
||||
a backward incompatible change. As a result, Go
|
||||
API semver hasn’t been followed. This was a mistake.</p>
|
||||
<p>Some options are</p>
|
||||
<ul>
|
||||
<li>
|
||||
<p>continue to ignore Go API semver and stick to
|
||||
CLI semver (eliminating the usefullness of
|
||||
minimal version selection),</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>obey semver, and increment the module’s major
|
||||
version number with every release (drastically
|
||||
reducing the usefullness of minimal version
|
||||
selection - since virtually all releases will
|
||||
be major),</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>slow down change in the huge API in favor of
|
||||
stability, yet somehow continue to deliver
|
||||
features,</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>drastically reduce the API surface, stabilize on
|
||||
semver there, and refactor as needed inside
|
||||
<code>internal</code>.</p>
|
||||
</li>
|
||||
</ul>
|
||||
<p>The last option seems the most appealing.</p>
|
||||
<h4 id="the-first-stable-api-version-is-coming">The first stable API version is coming</h4>
|
||||
<p>The first stable API version will launch
|
||||
as the Go module</p>
|
||||
<pre><code>sigs.k8s.io/kustomize/api
|
||||
</code></pre><p>The <em>kustomize</em> program itself (<code>main.go</code>
|
||||
and CLI specific code) will have moved out of
|
||||
<code>sigs.k8s.io/kustomize</code> and into the new module
|
||||
<code>sigs.k8s.io/kustomize/kustomize</code>. This is a
|
||||
submodule in the same repo, and it will retain its
|
||||
current notion of semver (e.g. a backward
|
||||
incompatible change in command behavior will
|
||||
trigger a major version bump). This module will
|
||||
not export packages; it’s just home to a <code>main</code>
|
||||
package.</p>
|
||||
<p>The <code>sigs.k8s.io/kustomize/api</code> module will
|
||||
obey semver with a sustainable public
|
||||
surface, informed by current usage. Clients
|
||||
should import packages from this module, i.e.
|
||||
from import paths prefixed by
|
||||
<code>sigs.k8s.io/kustomize/api/</code> at first,
|
||||
and later by <code>sigs.k8s.io/kustomize/api/v2/</code>.
|
||||
The kustomize binary
|
||||
itself is an API client requiring this module.</p>
|
||||
<p>The clients and API will evolve independently.</p>
|
||||
<h2 id="kustomization-file-versioning">Kustomization File Versioning</h2>
|
||||
<p>The kustomization file is a struct that is part of
|
||||
the kustomize Go API (the <code>sigs.k8s.io/kustomize</code>
|
||||
module), but it also evolves as a k8s API object -
|
||||
it has an <code>apiVersion</code> field containing its
|
||||
own version number.</p>
|
||||
<h3 id="field-change-policy">Field Change Policy</h3>
|
||||
<ul>
|
||||
<li>A field’s meaning cannot be changed.</li>
|
||||
<li>A field may be deprecated, then removed.</li>
|
||||
<li>Deprecation means triggering a <em>minor</em> (semver)
|
||||
version bump in the kustomize Go API, and
|
||||
defining a migration path in a non-fatal error
|
||||
message.</li>
|
||||
<li>Removal means triggering a <em>major</em> (semver)
|
||||
version bump in the kustomize Go API, and fatal
|
||||
error if field encountered (as with any unknown
|
||||
field). Likewise a change in <code>apiVersion</code>.</li>
|
||||
</ul>
|
||||
<h3 id="the-edit-fix-command">The <code>edit fix</code> Command</h3>
|
||||
<p>This <code>kustomize</code> command reads a Kustomization
|
||||
file, converts deprecated fields to new
|
||||
fields, and writes it out again in the latest
|
||||
format.</p>
|
||||
<p>This is a type version upgrade mechanism that
|
||||
works within <em>major</em> API revisions. There is no
|
||||
downgrade capability, as there’s no use case for
|
||||
it (see discussion below).</p>
|
||||
<h3 id="examples">Examples</h3>
|
||||
<p>With the 2.0.0 release, there were three field
|
||||
removals:</p>
|
||||
<ul>
|
||||
<li><code>imageTag</code> was deprecated when <code>images</code> was
|
||||
introduced, because the latter offers more
|
||||
general features for image data manipulation.
|
||||
<code>imageTag</code> was removed in v2.0.0.</li>
|
||||
<li><code>patches</code> was deprecated and replaced by
|
||||
<code>patchesStrategicMerge</code> when <code>patchesJson6902</code>
|
||||
was introduced, to make a clearer
|
||||
distinction between patch specification formats.
|
||||
<code>patches</code> was removed in v2.0.0.</li>
|
||||
<li><code>secretGenerator/commands</code> was removed
|
||||
due to security concerns in v2.0.0
|
||||
with no deprecation period.</li>
|
||||
</ul>
|
||||
<p>The <code>edit fix</code> command in a v2.0.x binary
|
||||
will no longer recognize these fields.</p>
|
||||
<h2 id="relationship-to-the-k8s-api">Relationship to the k8s API</h2>
|
||||
<h3 id="review-of-k8s-api-versioning">Review of k8s API versioning</h3>
|
||||
<p>The k8s API has specific <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md">conventions</a> and a
|
||||
process for making <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api_changes.md">changes</a>.</p>
|
||||
<p>The presence of an <code>apiVersion</code> field in a k8s
|
||||
native type signals:</p>
|
||||
<ul>
|
||||
<li>its reliability level (alpha vs beta vs
|
||||
generally available),</li>
|
||||
<li>the existence of code to provide default values
|
||||
to fields not present in a serialization,</li>
|
||||
<li>the existence of code to provide both forward
|
||||
and backward conversion between different
|
||||
versions of types.</li>
|
||||
</ul>
|
||||
<p>The k8s API promises a lossless <em>conversion</em>
|
||||
between versions over a specific range. This
|
||||
means that a recent client can write an object
|
||||
bearing the newest possible value for its version,
|
||||
the server will accept it and store it in
|
||||
“versionless” JSON form in storage, and can
|
||||
convert it to a range of older versions should
|
||||
an older client request data.</p>
|
||||
<p>For native k8s types, this all requires writing Go
|
||||
code in the kubernetes core repo, to provide
|
||||
defaulting and conversions.</p>
|
||||
<p>For CRDs, there’s a <a href="https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/customresources-versioning.md">proposal</a> on how to manage
|
||||
versioning (e.g. a remote service can offer type
|
||||
defaulting and conversions).</p>
|
||||
<h3 id="differences">Differences</h3>
|
||||
<ul>
|
||||
<li>A k8s API server is able to go <em>forward</em> and
|
||||
<em>backward</em> in versioning, to work with older
|
||||
clients, over <a href="https://kubernetes.io/docs/reference/using-api/deprecation-policy">some range</a>.</li>
|
||||
<li>The <code>kustomize edit fix</code> command only moves
|
||||
<em>forward</em> within a <em>major</em> API
|
||||
version.</li>
|
||||
</ul>
|
||||
<p>At the time of writing, the YAML in a
|
||||
kustomization file does not represent a <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md">k8s API</a>
|
||||
object, and the kustomize command and associated
|
||||
library is neither a server of, nor a client to,
|
||||
the k8s API.</p>
|
||||
<h3 id="additional-kustomization-file-rules">Additional Kustomization file rules</h3>
|
||||
<p>In addition to the <a href="#field-change-policy">field change policy</a> described
|
||||
above, kustomization files conform to
|
||||
the following rules.</p>
|
||||
<h4 id="eschew-classic-k8s-fields">Eschew classic k8s fields</h4>
|
||||
<p>Field names with dedicated meaning in k8s
|
||||
(<code>metadata</code>, <code>spec</code>, <code>status</code>, etc.) aren’t used.
|
||||
This is enforced via code review.</p>
|
||||
<h4 id="default-values-for-k8s-kind-and-apiversion">Default values for k8s <code>kind</code> and <code>apiVersion</code></h4>
|
||||
<p>In <code>v3</code> or below, the two <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#resources">special</a> k8s
|
||||
resource fields <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#types-kinds"><code>kind</code></a> and <a href="https://kubernetes.io/docs/concepts/overview/kubernetes-api/#api-versioning"><code>apiVersion</code></a> may
|
||||
be omitted from the kustomization file.</p>
|
||||
<p>If either field is present, they both must be.
|
||||
If present, the value of <code>kind</code> must be:</p>
|
||||
<blockquote>
|
||||
<pre><code>kind: Kustomization
|
||||
</code></pre></blockquote>
|
||||
<p>If missing, the value of <code>apiVersion</code> defaults to</p>
|
||||
<blockquote>
|
||||
<pre><code>apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
</code></pre></blockquote>
|
||||
<p>Moved to <a href="https://github.com/kubernetes-sigs/cli-experimental">https://github.com/kubernetes-sigs/cli-experimental</a></p>
|
||||
|
||||
|
||||
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 4, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/0834e152b203ffeccfbbf1ddd3c1f49debdac341">Redirect kustomize docs to the new unified site. (0834e152)</a>
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 11, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/71b763888cad614abb44b3086e291fe72d601080">Remove duplicate kustomize docs content (71b76388)</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -305,236 +305,6 @@
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">Command Line Options</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmd">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/build/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">build</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdbuild">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/cfg/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">cfg</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdcfg">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/create/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">create</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdcreate">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/edit/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">edit</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdedit">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/fn/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">fn</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdfn">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/help/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">help</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdhelp">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/install-completion/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">install-completion</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdinstall-completion">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/live/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">live</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdlive">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/version/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">version</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdversion">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/components/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">Kustomize Components</a>
|
||||
@@ -624,44 +394,7 @@
|
||||
<h1>Bespoke Application</h1>
|
||||
<div class="lead">Workflow for bespoke applications</div>
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/guides/config_management/bespoke/" />
|
||||
<p>In this workflow, all configuration (resource YAML) files are owned by the user.
|
||||
No content is incorporated from version control repositories owned by others.</p>
|
||||
<p><img src="/kustomize/images/workflowBespoke.jpg" alt="bespoke config workflow image"></p>
|
||||
<h4 id="1-create-a-directory-in-version-control">1) create a directory in version control</h4>
|
||||
<p>Speculate some overall cluster application called <em>ldap</em>;
|
||||
we want to keep its configuration in its own repo.</p>
|
||||
<blockquote>
|
||||
<pre><code>git init ~/ldap
|
||||
</code></pre></blockquote>
|
||||
<h4 id="2-create-a-base">2) create a <a href="/kustomize/api-reference/glossary#base">base</a></h4>
|
||||
<blockquote>
|
||||
<pre><code>mkdir -p ~/ldap/base
|
||||
</code></pre></blockquote>
|
||||
<p>In this directory, create and commit a <a href="/kustomize/api-reference/glossary#kustomization">kustomization</a>
|
||||
file and a set of <a href="/kustomize/api-reference/glossary#resource">resources</a>.</p>
|
||||
<h4 id="3-create-overlays">3) create <a href="/kustomize/api-reference/glossary#overlay">overlays</a></h4>
|
||||
<blockquote>
|
||||
<pre><code>mkdir -p ~/ldap/overlays/staging
|
||||
mkdir -p ~/ldap/overlays/production
|
||||
</code></pre></blockquote>
|
||||
<p>Each of these directories needs a <a href="/kustomize/api-reference/glossary#kustomization">kustomization</a>
|
||||
file and one or more <a href="/kustomize/api-reference/glossary#patch">patches</a>.</p>
|
||||
<p>The <em>staging</em> directory might get a patch
|
||||
that turns on an experiment flag in a configmap.</p>
|
||||
<p>The <em>production</em> directory might get a patch
|
||||
that increases the replica count in a deployment
|
||||
specified in the base.</p>
|
||||
<h4 id="4-bring-up-variants">4) bring up <a href="/kustomize/api-reference/glossary#variant">variants</a></h4>
|
||||
<p>Run kustomize, and pipe the output to <a href="/kustomize/api-reference/glossary#apply">apply</a>.</p>
|
||||
<blockquote>
|
||||
<pre><code>kustomize build ~/ldap/overlays/staging | kubectl apply -f -
|
||||
kustomize build ~/ldap/overlays/production | kubectl apply -f -
|
||||
</code></pre></blockquote>
|
||||
<p>You can also use <a href="https://kubernetes.io/blog/2019/03/25/kubernetes-1-14-release-announcement/">kubectl-v1.14.0</a> to apply your <a href="/kustomize/api-reference/glossary#variant">variants</a>.</p>
|
||||
<blockquote>
|
||||
<pre><code>kubectl apply -k ~/ldap/overlays/staging
|
||||
kubectl apply -k ~/ldap/overlays/production
|
||||
</code></pre></blockquote>
|
||||
<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">
|
||||
|
||||
@@ -688,32 +421,12 @@ kubectl apply -k ~/ldap/overlays/production
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 4, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/0834e152b203ffeccfbbf1ddd3c1f49debdac341">Redirect kustomize docs to the new unified site. (0834e152)</a>
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 11, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/71b763888cad614abb44b3086e291fe72d601080">Remove duplicate kustomize docs content (71b76388)</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -305,236 +305,6 @@
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">Command Line Options</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmd">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/build/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">build</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdbuild">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/cfg/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">cfg</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdcfg">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/create/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">create</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdcreate">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/edit/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">edit</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdedit">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/fn/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">fn</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdfn">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/help/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">help</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdhelp">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/install-completion/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">install-completion</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdinstall-completion">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/live/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">live</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdlive">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/version/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">version</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdversion">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/components/" class="align-left pl-0 pr-2 active td-sidebar-link td-sidebar-link__section">Kustomize Components</a>
|
||||
@@ -624,340 +394,8 @@
|
||||
<h1>Kustomize Components</h1>
|
||||
<div class="lead">Kustomize components guide</div>
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/guides/config_management/components/" />
|
||||
<p>As of <code>v3.7.0</code> Kustomize supports a special type of kustomization that allows
|
||||
one to define reusable pieces of configuration logic that can be included from
|
||||
multiple overlays.</p>
|
||||
<p>Components come in handy when dealing with applications that support multiple
|
||||
optional features and you wish to enable only a subset of them in different
|
||||
overlays, i.e., different features for different environments or audiences.</p>
|
||||
<p>For more details regarding this feature you can read the
|
||||
<a href="https://github.com/kubernetes/enhancements/blob/master/keps/sig-cli/1802-kustomize-components.md">Kustomize Components KEP</a>.</p>
|
||||
<h2 id="use-case">Use case</h2>
|
||||
<p>Suppose you’ve written a very simple Web application:</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">apps/v1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Deployment</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">example</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">template</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">containers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">example</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">example:1.0</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><p>You want to deploy a <strong>community</strong> edition of this application as SaaS, so you
|
||||
add support for persistence (e.g. an external database), and bot detection
|
||||
(e.g. Google reCAPTCHA).</p>
|
||||
<p>You’ve now attracted <strong>enterprise</strong> customers who want to deploy it
|
||||
on-premises, so you add LDAP support, and disable Google reCAPTCHA. At the same
|
||||
time, the <strong>devs</strong> need to be able to test parts of the application, so they
|
||||
want to deploy it with some features enabled and others not.</p>
|
||||
<p>Here’s a matrix with the deployments of this application and the features
|
||||
enabled for each one:</p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th style="text-align:center">External DB</th>
|
||||
<th style="text-align:center">LDAP</th>
|
||||
<th style="text-align:center">reCAPTCHA</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Community</td>
|
||||
<td style="text-align:center">✔️</td>
|
||||
<td style="text-align:center"></td>
|
||||
<td style="text-align:center">✔️</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Enterprise</td>
|
||||
<td style="text-align:center">✔️</td>
|
||||
<td style="text-align:center">✔️</td>
|
||||
<td style="text-align:center"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Dev</td>
|
||||
<td style="text-align:center">✅</td>
|
||||
<td style="text-align:center">✅</td>
|
||||
<td style="text-align:center">✅</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>(✔️ enabled, ✅: optional)</p>
|
||||
<p>So, you want to make it easy to deploy your application in any of the above
|
||||
three environments. Here’s how you can do this with Kustomize components: each
|
||||
opt-in feature gets packaged as a component, so that it can be referred to from
|
||||
multiple higher-level overlays.</p>
|
||||
<p>First, define a place to work:</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#000">DEMO_HOME</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#204a87;font-weight:bold">$(</span>mktemp -d<span style="color:#204a87;font-weight:bold">)</span>
|
||||
</code></pre></div><p>Define a common <strong>base</strong> that has a <code>Deployment</code> and a simple <code>ConfigMap</code>, that
|
||||
is mounted on the application’s container.</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#000">BASE</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#000">$DEMO_HOME</span>/base
|
||||
mkdir <span style="color:#000">$BASE</span>
|
||||
<p>Moved to <a href="https://github.com/kubernetes-sigs/cli-experimental">https://github.com/kubernetes-sigs/cli-experimental</a></p>
|
||||
|
||||
cat <span style="color:#4e9a06"><<EOF >$BASE/kustomization.yaml
|
||||
</span><span style="color:#4e9a06">resources:
|
||||
</span><span style="color:#4e9a06">- deployment.yaml
|
||||
</span><span style="color:#4e9a06">
|
||||
</span><span style="color:#4e9a06">configMapGenerator:
|
||||
</span><span style="color:#4e9a06">- name: conf
|
||||
</span><span style="color:#4e9a06"> literals:
|
||||
</span><span style="color:#4e9a06"> - main.conf=|
|
||||
</span><span style="color:#4e9a06"> color=cornflower_blue
|
||||
</span><span style="color:#4e9a06"> log_level=info
|
||||
</span><span style="color:#4e9a06">EOF</span>
|
||||
|
||||
cat <span style="color:#4e9a06"><<EOF >$BASE/deployment.yaml
|
||||
</span><span style="color:#4e9a06">apiVersion: apps/v1
|
||||
</span><span style="color:#4e9a06">kind: Deployment
|
||||
</span><span style="color:#4e9a06">metadata:
|
||||
</span><span style="color:#4e9a06"> name: example
|
||||
</span><span style="color:#4e9a06">spec:
|
||||
</span><span style="color:#4e9a06"> template:
|
||||
</span><span style="color:#4e9a06"> spec:
|
||||
</span><span style="color:#4e9a06"> containers:
|
||||
</span><span style="color:#4e9a06"> - name: example
|
||||
</span><span style="color:#4e9a06"> image: example:1.0
|
||||
</span><span style="color:#4e9a06"> volumeMounts:
|
||||
</span><span style="color:#4e9a06"> - name: conf
|
||||
</span><span style="color:#4e9a06"> mountPath: /etc/config
|
||||
</span><span style="color:#4e9a06"> volumes:
|
||||
</span><span style="color:#4e9a06"> - name: conf
|
||||
</span><span style="color:#4e9a06"> configMap:
|
||||
</span><span style="color:#4e9a06"> name: conf
|
||||
</span><span style="color:#4e9a06">EOF</span>
|
||||
</code></pre></div><p>Define an <code>external_db</code> component, using <code>kind: Component</code>, that creates a
|
||||
<code>Secret</code> for the DB password and a new entry in the <code>ConfigMap</code>:</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#000">EXT_DB</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#000">$DEMO_HOME</span>/components/external_db
|
||||
mkdir -p <span style="color:#000">$EXT_DB</span>
|
||||
|
||||
cat <span style="color:#4e9a06"><<EOF >$EXT_DB/kustomization.yaml
|
||||
</span><span style="color:#4e9a06">apiVersion: kustomize.config.k8s.io/v1alpha1 # <-- Component notation
|
||||
</span><span style="color:#4e9a06">kind: Component
|
||||
</span><span style="color:#4e9a06">
|
||||
</span><span style="color:#4e9a06">secretGenerator:
|
||||
</span><span style="color:#4e9a06">- name: dbpass
|
||||
</span><span style="color:#4e9a06"> files:
|
||||
</span><span style="color:#4e9a06"> - dbpass.txt
|
||||
</span><span style="color:#4e9a06">
|
||||
</span><span style="color:#4e9a06">patchesStrategicMerge:
|
||||
</span><span style="color:#4e9a06"> - configmap.yaml
|
||||
</span><span style="color:#4e9a06">
|
||||
</span><span style="color:#4e9a06">patchesJson6902:
|
||||
</span><span style="color:#4e9a06">- target:
|
||||
</span><span style="color:#4e9a06"> group: apps
|
||||
</span><span style="color:#4e9a06"> version: v1
|
||||
</span><span style="color:#4e9a06"> kind: Deployment
|
||||
</span><span style="color:#4e9a06"> name: example
|
||||
</span><span style="color:#4e9a06"> path: deployment.yaml
|
||||
</span><span style="color:#4e9a06">EOF</span>
|
||||
|
||||
cat <span style="color:#4e9a06"><<EOF >$EXT_DB/deployment.yaml
|
||||
</span><span style="color:#4e9a06">- op: add
|
||||
</span><span style="color:#4e9a06"> path: /spec/template/spec/volumes/0
|
||||
</span><span style="color:#4e9a06"> value:
|
||||
</span><span style="color:#4e9a06"> name: dbpass
|
||||
</span><span style="color:#4e9a06"> secret:
|
||||
</span><span style="color:#4e9a06"> secretName: dbpass
|
||||
</span><span style="color:#4e9a06">- op: add
|
||||
</span><span style="color:#4e9a06"> path: /spec/template/spec/containers/0/volumeMounts/0
|
||||
</span><span style="color:#4e9a06"> value:
|
||||
</span><span style="color:#4e9a06"> mountPath: /var/run/secrets/db/
|
||||
</span><span style="color:#4e9a06"> name: dbpass
|
||||
</span><span style="color:#4e9a06">EOF</span>
|
||||
|
||||
cat <span style="color:#4e9a06"><<EOF >$EXT_DB/configmap.yaml
|
||||
</span><span style="color:#4e9a06">apiVersion: v1
|
||||
</span><span style="color:#4e9a06">kind: ConfigMap
|
||||
</span><span style="color:#4e9a06">metadata:
|
||||
</span><span style="color:#4e9a06"> name: conf
|
||||
</span><span style="color:#4e9a06">data:
|
||||
</span><span style="color:#4e9a06"> db.conf: |
|
||||
</span><span style="color:#4e9a06"> endpoint=127.0.0.1:1234
|
||||
</span><span style="color:#4e9a06"> name=app
|
||||
</span><span style="color:#4e9a06"> user=admin
|
||||
</span><span style="color:#4e9a06"> pass=/var/run/secrets/db/dbpass.txt
|
||||
</span><span style="color:#4e9a06">EOF</span>
|
||||
</code></pre></div><p>Define an <code>ldap</code> component, that creates a <code>Secret</code> for the LDAP password
|
||||
and a new entry in the <code>ConfigMap</code>:</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#000">LDAP</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#000">$DEMO_HOME</span>/components/ldap
|
||||
mkdir -p <span style="color:#000">$LDAP</span>
|
||||
|
||||
cat <span style="color:#4e9a06"><<EOF >$LDAP/kustomization.yaml
|
||||
</span><span style="color:#4e9a06">apiVersion: kustomize.config.k8s.io/v1alpha1
|
||||
</span><span style="color:#4e9a06">kind: Component
|
||||
</span><span style="color:#4e9a06">
|
||||
</span><span style="color:#4e9a06">secretGenerator:
|
||||
</span><span style="color:#4e9a06">- name: ldappass
|
||||
</span><span style="color:#4e9a06"> files:
|
||||
</span><span style="color:#4e9a06"> - ldappass.txt
|
||||
</span><span style="color:#4e9a06">
|
||||
</span><span style="color:#4e9a06">patchesStrategicMerge:
|
||||
</span><span style="color:#4e9a06"> - configmap.yaml
|
||||
</span><span style="color:#4e9a06">
|
||||
</span><span style="color:#4e9a06">patchesJson6902:
|
||||
</span><span style="color:#4e9a06">- target:
|
||||
</span><span style="color:#4e9a06"> group: apps
|
||||
</span><span style="color:#4e9a06"> version: v1
|
||||
</span><span style="color:#4e9a06"> kind: Deployment
|
||||
</span><span style="color:#4e9a06"> name: example
|
||||
</span><span style="color:#4e9a06"> path: deployment.yaml
|
||||
</span><span style="color:#4e9a06">EOF</span>
|
||||
|
||||
cat <span style="color:#4e9a06"><<EOF >$LDAP/deployment.yaml
|
||||
</span><span style="color:#4e9a06">- op: add
|
||||
</span><span style="color:#4e9a06"> path: /spec/template/spec/volumes/0
|
||||
</span><span style="color:#4e9a06"> value:
|
||||
</span><span style="color:#4e9a06"> name: ldappass
|
||||
</span><span style="color:#4e9a06"> secret:
|
||||
</span><span style="color:#4e9a06"> secretName: ldappass
|
||||
</span><span style="color:#4e9a06">- op: add
|
||||
</span><span style="color:#4e9a06"> path: /spec/template/spec/containers/0/volumeMounts/0
|
||||
</span><span style="color:#4e9a06"> value:
|
||||
</span><span style="color:#4e9a06"> mountPath: /var/run/secrets/ldap/
|
||||
</span><span style="color:#4e9a06"> name: ldappass
|
||||
</span><span style="color:#4e9a06">EOF</span>
|
||||
|
||||
cat <span style="color:#4e9a06"><<EOF >$LDAP/configmap.yaml
|
||||
</span><span style="color:#4e9a06">apiVersion: v1
|
||||
</span><span style="color:#4e9a06">kind: ConfigMap
|
||||
</span><span style="color:#4e9a06">metadata:
|
||||
</span><span style="color:#4e9a06"> name: conf
|
||||
</span><span style="color:#4e9a06">data:
|
||||
</span><span style="color:#4e9a06"> ldap.conf: |
|
||||
</span><span style="color:#4e9a06"> endpoint=ldap://ldap.example.com
|
||||
</span><span style="color:#4e9a06"> bindDN=cn=admin,dc=example,dc=com
|
||||
</span><span style="color:#4e9a06"> pass=/var/run/secrets/ldap/ldappass.txt
|
||||
</span><span style="color:#4e9a06">EOF</span>
|
||||
</code></pre></div><p>Define a <code>recaptcha</code> component, that creates a <code>Secret</code> for the reCAPTCHA
|
||||
site/secret keys and a new entry in the <code>ConfigMap</code>:</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#000">RECAPTCHA</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#000">$DEMO_HOME</span>/components/recaptcha
|
||||
mkdir -p <span style="color:#000">$RECAPTCHA</span>
|
||||
|
||||
cat <span style="color:#4e9a06"><<EOF >$RECAPTCHA/kustomization.yaml
|
||||
</span><span style="color:#4e9a06">apiVersion: kustomize.config.k8s.io/v1alpha1
|
||||
</span><span style="color:#4e9a06">kind: Component
|
||||
</span><span style="color:#4e9a06">
|
||||
</span><span style="color:#4e9a06">secretGenerator:
|
||||
</span><span style="color:#4e9a06">- name: recaptcha
|
||||
</span><span style="color:#4e9a06"> files:
|
||||
</span><span style="color:#4e9a06"> - site_key.txt
|
||||
</span><span style="color:#4e9a06"> - secret_key.txt
|
||||
</span><span style="color:#4e9a06">
|
||||
</span><span style="color:#4e9a06"># Updating the ConfigMap works with generators as well.
|
||||
</span><span style="color:#4e9a06">configMapGenerator:
|
||||
</span><span style="color:#4e9a06">- name: conf
|
||||
</span><span style="color:#4e9a06"> behavior: merge
|
||||
</span><span style="color:#4e9a06"> literals:
|
||||
</span><span style="color:#4e9a06"> - recaptcha.conf=|
|
||||
</span><span style="color:#4e9a06"> enabled=true
|
||||
</span><span style="color:#4e9a06"> site_key=/var/run/secrets/recaptcha/site_key.txt
|
||||
</span><span style="color:#4e9a06"> secret_key=/var/run/secrets/recaptcha/secret_key.txt
|
||||
</span><span style="color:#4e9a06">
|
||||
</span><span style="color:#4e9a06">patchesJson6902:
|
||||
</span><span style="color:#4e9a06">- target:
|
||||
</span><span style="color:#4e9a06"> group: apps
|
||||
</span><span style="color:#4e9a06"> version: v1
|
||||
</span><span style="color:#4e9a06"> kind: Deployment
|
||||
</span><span style="color:#4e9a06"> name: example
|
||||
</span><span style="color:#4e9a06"> path: deployment.yaml
|
||||
</span><span style="color:#4e9a06">EOF</span>
|
||||
|
||||
cat <span style="color:#4e9a06"><<EOF >$RECAPTCHA/deployment.yaml
|
||||
</span><span style="color:#4e9a06">- op: add
|
||||
</span><span style="color:#4e9a06"> path: /spec/template/spec/volumes/0
|
||||
</span><span style="color:#4e9a06"> value:
|
||||
</span><span style="color:#4e9a06"> name: recaptcha
|
||||
</span><span style="color:#4e9a06"> secret:
|
||||
</span><span style="color:#4e9a06"> secretName: recaptcha
|
||||
</span><span style="color:#4e9a06">- op: add
|
||||
</span><span style="color:#4e9a06"> path: /spec/template/spec/containers/0/volumeMounts/0
|
||||
</span><span style="color:#4e9a06"> value:
|
||||
</span><span style="color:#4e9a06"> mountPath: /var/run/secrets/recaptcha/
|
||||
</span><span style="color:#4e9a06"> name: recaptcha
|
||||
</span><span style="color:#4e9a06">EOF</span>
|
||||
</code></pre></div><p>Define a <code>community</code> variant, that bundles the external DB and reCAPTCHA
|
||||
components:</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#000">COMMUNITY</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#000">$DEMO_HOME</span>/overlays/community
|
||||
mkdir -p <span style="color:#000">$COMMUNITY</span>
|
||||
|
||||
cat <span style="color:#4e9a06"><<EOF >$COMMUNITY/kustomization.yaml
|
||||
</span><span style="color:#4e9a06">apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
</span><span style="color:#4e9a06">kind: Kustomization
|
||||
</span><span style="color:#4e9a06">
|
||||
</span><span style="color:#4e9a06">resources:
|
||||
</span><span style="color:#4e9a06"> - ../../base
|
||||
</span><span style="color:#4e9a06">
|
||||
</span><span style="color:#4e9a06">components:
|
||||
</span><span style="color:#4e9a06"> - ../../components/external_db
|
||||
</span><span style="color:#4e9a06"> - ../../components/recaptcha
|
||||
</span><span style="color:#4e9a06">EOF</span>
|
||||
</code></pre></div><p>Define an <code>enterprise</code> overlay, that bundles the external DB and LDAP
|
||||
components:</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#000">ENTERPRISE</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#000">$DEMO_HOME</span>/overlays/enterprise
|
||||
mkdir -p <span style="color:#000">$ENTERPRISE</span>
|
||||
|
||||
cat <span style="color:#4e9a06"><<EOF >$ENTERPRISE/kustomization.yaml
|
||||
</span><span style="color:#4e9a06">apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
</span><span style="color:#4e9a06">kind: Kustomization
|
||||
</span><span style="color:#4e9a06">
|
||||
</span><span style="color:#4e9a06">resources:
|
||||
</span><span style="color:#4e9a06"> - ../../base
|
||||
</span><span style="color:#4e9a06">
|
||||
</span><span style="color:#4e9a06">components:
|
||||
</span><span style="color:#4e9a06"> - ../../components/external_db
|
||||
</span><span style="color:#4e9a06"> - ../../components/ldap
|
||||
</span><span style="color:#4e9a06">EOF</span>
|
||||
</code></pre></div><p>Define a <code>dev</code> overlay, that points to all the components and has LDAP
|
||||
disabled:</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#000">DEV</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#000">$DEMO_HOME</span>/overlays/dev
|
||||
mkdir -p <span style="color:#000">$DEV</span>
|
||||
|
||||
cat <span style="color:#4e9a06"><<EOF >$DEV/kustomization.yaml
|
||||
</span><span style="color:#4e9a06">apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
</span><span style="color:#4e9a06">kind: Kustomization
|
||||
</span><span style="color:#4e9a06">
|
||||
</span><span style="color:#4e9a06">resources:
|
||||
</span><span style="color:#4e9a06"> - ../../base
|
||||
</span><span style="color:#4e9a06">
|
||||
</span><span style="color:#4e9a06">components:
|
||||
</span><span style="color:#4e9a06"> - ../../components/external_db
|
||||
</span><span style="color:#4e9a06"> #- ../../components/ldap
|
||||
</span><span style="color:#4e9a06"> - ../../components/recaptcha
|
||||
</span><span style="color:#4e9a06">EOF</span>
|
||||
</code></pre></div><p>Now, the workspace has the following directories:</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">├── base
|
||||
│ ├── deployment.yaml
|
||||
│ └── kustomization.yaml
|
||||
├── components
|
||||
│ ├── external_db
|
||||
│ │ ├── configmap.yaml
|
||||
│ │ ├── dbpass.txt
|
||||
│ │ ├── deployment.yaml
|
||||
│ │ └── kustomization.yaml
|
||||
│ ├── ldap
|
||||
│ │ ├── configmap.yaml
|
||||
│ │ ├── deployment.yaml
|
||||
│ │ ├── kustomization.yaml
|
||||
│ │ └── ldappass.txt
|
||||
│ └── recaptcha
|
||||
│ ├── deployment.yaml
|
||||
│ ├── kustomization.yaml
|
||||
│ ├── secret_key.txt
|
||||
│ └── site_key.txt
|
||||
└── overlays
|
||||
├── community
|
||||
│ └── kustomization.yaml
|
||||
├── dev
|
||||
│ └── kustomization.yaml
|
||||
└── enterprise
|
||||
└── kustomization.yaml
|
||||
</code></pre></div><p>With this structure, you can generate the YAML manifests for each deployment
|
||||
using <code>kustomize build</code>:</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kustomize build overlays/community
|
||||
kustomize build overlays/enterprise
|
||||
kustomize build overlays/dev
|
||||
</code></pre></div>
|
||||
<div class="section-index">
|
||||
|
||||
|
||||
@@ -983,32 +421,12 @@ kustomize build overlays/dev
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 4, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/0834e152b203ffeccfbbf1ddd3c1f49debdac341">Redirect kustomize docs to the new unified site. (0834e152)</a>
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 11, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/71b763888cad614abb44b3086e291fe72d601080">Remove duplicate kustomize docs content (71b76388)</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -305,236 +305,6 @@
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/" class="align-left pl-0 pr-2 td-sidebar-link td-sidebar-link__section">Command Line Options</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse show" id="kustomizeguidescmd">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/build/" class="align-left pl-0 pr-2 td-sidebar-link td-sidebar-link__section">build</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse show" id="kustomizeguidescmdbuild">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/cfg/" class="align-left pl-0 pr-2 td-sidebar-link td-sidebar-link__section">cfg</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse show" id="kustomizeguidescmdcfg">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/create/" class="align-left pl-0 pr-2 td-sidebar-link td-sidebar-link__section">create</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse show" id="kustomizeguidescmdcreate">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/edit/" class="align-left pl-0 pr-2 td-sidebar-link td-sidebar-link__section">edit</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse show" id="kustomizeguidescmdedit">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/fn/" class="align-left pl-0 pr-2 td-sidebar-link td-sidebar-link__section">fn</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse show" id="kustomizeguidescmdfn">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/help/" class="align-left pl-0 pr-2 td-sidebar-link td-sidebar-link__section">help</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse show" id="kustomizeguidescmdhelp">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/install-completion/" class="align-left pl-0 pr-2 td-sidebar-link td-sidebar-link__section">install-completion</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse show" id="kustomizeguidescmdinstall-completion">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/live/" class="align-left pl-0 pr-2 td-sidebar-link td-sidebar-link__section">live</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse show" id="kustomizeguidescmdlive">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/version/" class="align-left pl-0 pr-2 td-sidebar-link td-sidebar-link__section">version</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse show" id="kustomizeguidescmdversion">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/components/" class="align-left pl-0 pr-2 td-sidebar-link td-sidebar-link__section">Kustomize Components</a>
|
||||
@@ -614,6 +384,8 @@
|
||||
<h1>Guides</h1>
|
||||
<div class="lead">Reference for Kustomize usage and best practices</div>
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/guides/config_management" />
|
||||
<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">
|
||||
|
||||
|
||||
@@ -657,29 +429,6 @@
|
||||
|
||||
|
||||
|
||||
<div class="entry">
|
||||
<h5>
|
||||
<a href="/kustomize/guides/cmd/">Command Line Options</a>
|
||||
</h5>
|
||||
<p>Usage of command line options</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="entry">
|
||||
@@ -690,16 +439,12 @@
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 4, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/0834e152b203ffeccfbbf1ddd3c1f49debdac341">Redirect kustomize docs to the new unified site. (0834e152)</a>
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 11, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/71b763888cad614abb44b3086e291fe72d601080">Remove duplicate kustomize docs content (71b76388)</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -305,236 +305,6 @@
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">Command Line Options</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmd">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/build/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">build</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdbuild">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/cfg/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">cfg</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdcfg">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/create/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">create</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdcreate">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/edit/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">edit</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdedit">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/fn/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">fn</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdfn">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/help/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">help</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdhelp">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/install-completion/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">install-completion</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdinstall-completion">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/live/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">live</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdlive">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/version/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">version</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdversion">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/components/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">Kustomize Components</a>
|
||||
@@ -624,46 +394,7 @@
|
||||
<h1>Off The Shelf Application</h1>
|
||||
<div class="lead">Workflow for off the shelf applications</div>
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/guides/config_management/offtheshelf/" />
|
||||
<p>In this workflow, all files are owned by the user and maintained in a repository under their control, but
|
||||
they are based on an <a href="/kustomize/api-reference/glossary#off-the-shelf-configuration">off-the-shelf</a> configuration that is periodically consulted for updates.</p>
|
||||
<p><img src="/kustomize/images/workflowOts.jpg" alt="off-the-shelf config workflow image"></p>
|
||||
<h4 id="1-find-and-fork-an-ots-config">1) find and <a href="https://guides.github.com/activities/forking/">fork</a> an <a href="/kustomize/api-reference/glossary#off-the-shelf-configuration">OTS</a> config</h4>
|
||||
<h4 id="2-clone-it-as-your-base">2) clone it as your <a href="/kustomize/api-reference/glossary#base">base</a></h4>
|
||||
<p>The <a href="/kustomize/api-reference/glossary#base">base</a> directory is maintained in a repo whose upstream is an <a href="/kustomize/api-reference/glossary#off-the-shelf-configuration">OTS</a> configuration, in this case
|
||||
some user’s <code>ldap</code> repo:</p>
|
||||
<blockquote>
|
||||
<pre><code>mkdir ~/ldap
|
||||
git clone https://github.com/$USER/ldap ~/ldap/base
|
||||
cd ~/ldap/base
|
||||
git remote add upstream git@github.com:$USER/ldap
|
||||
</code></pre></blockquote>
|
||||
<h4 id="3-create-overlays">3) create <a href="/kustomize/api-reference/glossary#overlay">overlays</a></h4>
|
||||
<p>As in the bespoke case above, create and populate an <em>overlays</em> directory.</p>
|
||||
<p>The <a href="/kustomize/api-reference/glossary#overlay">overlays</a> are siblings to each other and to the <a href="/kustomize/api-reference/glossary#base">base</a> they depend on.</p>
|
||||
<blockquote>
|
||||
<pre><code>mkdir -p ~/ldap/overlays/staging
|
||||
mkdir -p ~/ldap/overlays/production
|
||||
</code></pre></blockquote>
|
||||
<p>The user can maintain the <code>overlays</code> directory in a
|
||||
distinct repository.</p>
|
||||
<h4 id="4-bring-up-variants">4) bring up <a href="/kustomize/api-reference/glossary#variant">variants</a></h4>
|
||||
<blockquote>
|
||||
<pre><code>kustomize build ~/ldap/overlays/staging | kubectl apply -f -
|
||||
kustomize build ~/ldap/overlays/production | kubectl apply -f -
|
||||
</code></pre></blockquote>
|
||||
<p>You can also use <a href="https://kubernetes.io/blog/2019/03/25/kubernetes-1-14-release-announcement/">kubectl-v1.14.0</a> to apply your <a href="/kustomize/api-reference/glossary#variant">variants</a>.</p>
|
||||
<blockquote>
|
||||
<pre><code>kubectl apply -k ~/ldap/overlays/staging
|
||||
kubectl apply -k ~/ldap/overlays/production
|
||||
</code></pre></blockquote>
|
||||
<h4 id="5-optionally-capture-changes-from-upstream">5) (optionally) capture changes from upstream</h4>
|
||||
<p>The user can periodically <a href="https://git-scm.com/docs/git-rebase">rebase</a> their <a href="/kustomize/api-reference/glossary#base">base</a> to
|
||||
capture changes made in the upstream repository.</p>
|
||||
<blockquote>
|
||||
<pre><code>cd ~/ldap/base
|
||||
git fetch upstream
|
||||
git rebase upstream/master
|
||||
</code></pre></blockquote>
|
||||
<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">
|
||||
|
||||
@@ -690,32 +421,12 @@ git rebase upstream/master
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 4, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/0834e152b203ffeccfbbf1ddd3c1f49debdac341">Redirect kustomize docs to the new unified site. (0834e152)</a>
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 11, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/71b763888cad614abb44b3086e291fe72d601080">Remove duplicate kustomize docs content (71b76388)</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -25,12 +25,12 @@
|
||||
" />
|
||||
<meta property="og:type" content="article" />
|
||||
<meta property="og:url" content="https://kubernetes-sigs.github.io/kustomize/guides/plugins/builtins/" />
|
||||
<meta property="article:modified_time" content="2020-11-04T11:15:40-08:00" /><meta property="og:site_name" content="Kustomize" />
|
||||
<meta property="article:modified_time" content="2020-11-11T08:29:43-08:00" /><meta property="og:site_name" content="Kustomize" />
|
||||
<meta itemprop="name" content="Builtin Plugins">
|
||||
<meta itemprop="description" content="Builtin Plugins
|
||||
">
|
||||
<meta itemprop="dateModified" content="2020-11-04T11:15:40-08:00" />
|
||||
<meta itemprop="wordCount" content="1782">
|
||||
<meta itemprop="dateModified" content="2020-11-11T08:29:43-08:00" />
|
||||
<meta itemprop="wordCount" content="3">
|
||||
|
||||
|
||||
|
||||
@@ -310,236 +310,6 @@
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">Command Line Options</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmd">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/build/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">build</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdbuild">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/cfg/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">cfg</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdcfg">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/create/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">create</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdcreate">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/edit/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">edit</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdedit">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/fn/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">fn</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdfn">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/help/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">help</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdhelp">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/install-completion/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">install-completion</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdinstall-completion">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/live/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">live</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdlive">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/version/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">version</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdversion">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/components/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">Kustomize Components</a>
|
||||
@@ -593,83 +363,6 @@
|
||||
|
||||
|
||||
|
||||
<nav id="TableOfContents">
|
||||
<ul>
|
||||
<li><a href="#_annotationtransformer_"><em>AnnotationTransformer</em></a>
|
||||
<ul>
|
||||
<li><a href="#usage-via-kustomizationyaml">Usage via <code>kustomization.yaml</code></a></li>
|
||||
<li><a href="#usage-via-plugin">Usage via plugin</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#_configmapgenerator_"><em>ConfigMapGenerator</em></a>
|
||||
<ul>
|
||||
<li><a href="#usage-via-kustomizationyaml-1">Usage via <code>kustomization.yaml</code></a></li>
|
||||
<li><a href="#usage-via-plugin-1">Usage via plugin</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#_imagetagtransformer_"><em>ImageTagTransformer</em></a>
|
||||
<ul>
|
||||
<li><a href="#usage-via-kustomizationyaml-2">Usage via <code>kustomization.yaml</code></a></li>
|
||||
<li><a href="#usage-via-plugin-2">Usage via plugin</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#_labeltransformer_"><em>LabelTransformer</em></a>
|
||||
<ul>
|
||||
<li><a href="#usage-via-kustomizationyaml-3">Usage via <code>kustomization.yaml</code></a></li>
|
||||
<li><a href="#usage-via-plugin-3">Usage via plugin</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#_namespacetransformer_"><em>NamespaceTransformer</em></a>
|
||||
<ul>
|
||||
<li><a href="#usage-via-kustomizationyaml-4">Usage via <code>kustomization.yaml</code></a></li>
|
||||
<li><a href="#usage-via-plugin-4">Usage via plugin</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#_patchesjson6902_"><em>PatchesJson6902</em></a>
|
||||
<ul>
|
||||
<li><a href="#usage-via-kustomizationyaml-5">Usage via <code>kustomization.yaml</code></a></li>
|
||||
<li><a href="#usage-via-plugin-5">Usage via plugin</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#_patchesstrategicmerge_"><em>PatchesStrategicMerge</em></a>
|
||||
<ul>
|
||||
<li><a href="#usage-via-kustomizationyaml-6">Usage via <code>kustomization.yaml</code></a></li>
|
||||
<li><a href="#usage-via-plugin-6">Usage via plugin</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#_patchtransformer_"><em>PatchTransformer</em></a>
|
||||
<ul>
|
||||
<li><a href="#usage-via-kustomizationyaml-7">Usage via <code>kustomization.yaml</code></a></li>
|
||||
<li><a href="#usage-via-plugin-7">Usage via plugin</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#_prefixsuffixtransformer_"><em>PrefixSuffixTransformer</em></a>
|
||||
<ul>
|
||||
<li><a href="#usage-via-kustomizationyaml-8">Usage via <code>kustomization.yaml</code></a></li>
|
||||
<li><a href="#usage-via-plugin-8">Usage via plugin</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#_replicacounttransformer_"><em>ReplicaCountTransformer</em></a>
|
||||
<ul>
|
||||
<li><a href="#usage-via-kustomizationyaml-9">Usage via <code>kustomization.yaml</code></a></li>
|
||||
<li><a href="#usage-via-plugin-9">Usage via plugin</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#_secretgenerator_"><em>SecretGenerator</em></a>
|
||||
<ul>
|
||||
<li><a href="#usage-via-kustomizationyaml-10">Usage via <code>kustomization.yaml</code></a></li>
|
||||
<li><a href="#usage-via-plugin-10">Usage via plugin</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#_helmchartinflationgenerator_"><em>HelmChartInflationGenerator</em></a>
|
||||
<ul>
|
||||
<li><a href="#usage-via-kustomizationyaml-11">Usage via <code>kustomization.yaml</code></a></li>
|
||||
<li><a href="#usage-via-plugin-11">Usage via plugin</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
@@ -716,604 +409,11 @@
|
||||
<h1>Builtin Plugins</h1>
|
||||
<div class="lead">Builtin Plugins</div>
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/guides/extending_kustomize/builtins" />
|
||||
<h1 id="builtin-plugins">Builtin Plugins</h1>
|
||||
<p>A list of kustomize’s builtin plugins - both
|
||||
generators and transformers.</p>
|
||||
<p>For each plugin, an example is given for</p>
|
||||
<ul>
|
||||
<li>
|
||||
<p>implicitly triggering
|
||||
the plugin via a dedicated kustomization
|
||||
file field (e.g. the <code>AnnotationsTransformer</code> is
|
||||
triggered by the <code>commonAnnotations</code> field).</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>explicitly triggering the plugin
|
||||
via the <code>generators</code> or <code>transformers</code> field
|
||||
(by providing a config file specifying the
|
||||
plugin).</p>
|
||||
</li>
|
||||
</ul>
|
||||
<p>The former method is convenient but limited in
|
||||
power as most of the plugins arguments must
|
||||
be defaulted. The latter method allows for
|
||||
complete plugin argument specification.</p>
|
||||
<h2 id="_annotationtransformer_"><em>AnnotationTransformer</em></h2>
|
||||
<h3 id="usage-via-kustomizationyaml">Usage via <code>kustomization.yaml</code></h3>
|
||||
<h4 id="field-name-commonannotations">field name: <code>commonAnnotations</code></h4>
|
||||
<p>Adds annotions (non-identifying metadata) to add
|
||||
all resources. Like labels, these are key value
|
||||
pairs.</p>
|
||||
<pre><code>commonAnnotations:
|
||||
oncallPager: 800-555-1212
|
||||
</code></pre><h3 id="usage-via-plugin">Usage via plugin</h3>
|
||||
<h4 id="arguments">Arguments</h4>
|
||||
<blockquote>
|
||||
<p>Annotations map[string]string</p>
|
||||
<p>FieldSpecs []<a href="https://github.com/kubernetes-sigs/kustomize/tree/master/api/types/fieldspec.go">config.FieldSpec</a></p>
|
||||
</blockquote>
|
||||
<h4 id="example">Example</h4>
|
||||
<blockquote>
|
||||
<pre><code>apiVersion: builtin
|
||||
kind: AnnotationsTransformer
|
||||
metadata:
|
||||
name: not-important-to-example
|
||||
annotations:
|
||||
app: myApp
|
||||
greeting/morning: a string with blanks
|
||||
fieldSpecs:
|
||||
- path: metadata/annotations
|
||||
create: true
|
||||
</code></pre></blockquote>
|
||||
<h2 id="_configmapgenerator_"><em>ConfigMapGenerator</em></h2>
|
||||
<h3 id="usage-via-kustomizationyaml-1">Usage via <code>kustomization.yaml</code></h3>
|
||||
<h4 id="field-name-configmapgenerator">field name: <code>configMapGenerator</code></h4>
|
||||
<p>Each entry in this list results in the creation of
|
||||
one ConfigMap resource (it’s a generator of n maps).</p>
|
||||
<p>The example below creates three ConfigMaps. One with the names and contents of
|
||||
the given files, one with key/value as data, and a third which sets an
|
||||
annotation and label via <code>options</code> for that single ConfigMap.</p>
|
||||
<p>Each configMapGenerator item accepts a parameter of
|
||||
<code>behavior: [create|replace|merge]</code>.
|
||||
This allows an overlay to modify or
|
||||
replace an existing configMap from the parent.</p>
|
||||
<p>Also, each entry has an <code>options</code> field, that has the
|
||||
same subfields as the kustomization file’s <code>generatorOptions</code> field.</p>
|
||||
<p>This <code>options</code> field allows one to add labels and/or
|
||||
annotations to the generated instance, or to individually
|
||||
disable the name suffix hash for that instance.
|
||||
Labels and annotations added here will not be overwritten
|
||||
by the global options associated with the kustomization
|
||||
file <code>generatorOptions</code> field. However, due to how
|
||||
booleans behave, if the global <code>generatorOptions</code> field
|
||||
specifies <code>disableNameSuffixHash: true</code>, this will
|
||||
trump any attempt to locally override it.</p>
|
||||
<pre><code># These labels are added to all configmaps and secrets.
|
||||
generatorOptions:
|
||||
labels:
|
||||
fruit: apple
|
||||
|
||||
configMapGenerator:
|
||||
- name: my-java-server-props
|
||||
behavior: merge
|
||||
files:
|
||||
- application.properties
|
||||
- more.properties
|
||||
- name: my-java-server-env-vars
|
||||
literals:
|
||||
- JAVA_HOME=/opt/java/jdk
|
||||
- JAVA_TOOL_OPTIONS=-agentlib:hprof
|
||||
options:
|
||||
disableNameSuffixHash: true
|
||||
labels:
|
||||
pet: dog
|
||||
- name: dashboards
|
||||
files:
|
||||
- mydashboard.json
|
||||
options:
|
||||
annotations:
|
||||
dashboard: "1"
|
||||
labels:
|
||||
app.kubernetes.io/name: "app1"
|
||||
</code></pre><p>It is also possible to
|
||||
<a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/#define-the-key-to-use-when-creating-a-configmap-from-a-file">define a key</a>
|
||||
to set a name different than the filename.</p>
|
||||
<p>The example below creates a ConfigMap
|
||||
with the name of file as <code>myFileName.ini</code>
|
||||
while the <em>actual</em> filename from which the
|
||||
configmap is created is <code>whatever.ini</code>.</p>
|
||||
<pre><code>configMapGenerator:
|
||||
- name: app-whatever
|
||||
files:
|
||||
- myFileName.ini=whatever.ini
|
||||
</code></pre><h3 id="usage-via-plugin-1">Usage via plugin</h3>
|
||||
<h4 id="arguments-1">Arguments</h4>
|
||||
<blockquote>
|
||||
<p><a href="https://github.com/kubernetes-sigs/kustomize/tree/master/api/types/configmapargs.go">types.ConfigMapArgs</a></p>
|
||||
</blockquote>
|
||||
<h4 id="example-1">Example</h4>
|
||||
<blockquote>
|
||||
<pre><code>apiVersion: builtin
|
||||
kind: ConfigMapGenerator
|
||||
metadata:
|
||||
name: mymap
|
||||
envs:
|
||||
- devops.env
|
||||
- uxteam.env
|
||||
literals:
|
||||
- FRUIT=apple
|
||||
- VEGETABLE=carrot
|
||||
</code></pre></blockquote>
|
||||
<h2 id="_imagetagtransformer_"><em>ImageTagTransformer</em></h2>
|
||||
<h3 id="usage-via-kustomizationyaml-2">Usage via <code>kustomization.yaml</code></h3>
|
||||
<h4 id="field-name-images">field name: <code>images</code></h4>
|
||||
<p>Images modify the name, tags and/or digest for images
|
||||
without creating patches. E.g. Given this
|
||||
kubernetes Deployment fragment:</p>
|
||||
<pre><code>containers:
|
||||
- name: mypostgresdb
|
||||
image: postgres:8
|
||||
- name: nginxapp
|
||||
image: nginx:1.7.9
|
||||
- name: myapp
|
||||
image: my-demo-app:latest
|
||||
- name: alpine-app
|
||||
image: alpine:3.7
|
||||
</code></pre><p>one can change the <code>image</code> in the following ways:</p>
|
||||
<ul>
|
||||
<li><code>postgres:8</code> to <code>my-registry/my-postgres:v1</code>,</li>
|
||||
<li>nginx tag <code>1.7.9</code> to <code>1.8.0</code>,</li>
|
||||
<li>image name <code>my-demo-app</code> to <code>my-app</code>,</li>
|
||||
<li>alpine’s tag <code>3.7</code> to a digest value</li>
|
||||
</ul>
|
||||
<p>all with the following <em>kustomization</em>:</p>
|
||||
<pre><code>images:
|
||||
- name: postgres
|
||||
newName: my-registry/my-postgres
|
||||
newTag: v1
|
||||
- name: nginx
|
||||
newTag: 1.8.0
|
||||
- name: my-demo-app
|
||||
newName: my-app
|
||||
- name: alpine
|
||||
digest: sha256:24a0c4b4a4c0eb97a1aabb8e29f18e917d05abfe1b7a7c07857230879ce7d3d3
|
||||
</code></pre><h3 id="usage-via-plugin-2">Usage via plugin</h3>
|
||||
<h4 id="arguments-2">Arguments</h4>
|
||||
<blockquote>
|
||||
<p>ImageTag <a href="https://github.com/kubernetes-sigs/kustomize/tree/master/api/types/image.go">image.Image</a></p>
|
||||
<p>FieldSpecs []<a href="https://github.com/kubernetes-sigs/kustomize/tree/master/api/types/fieldspec.go">config.FieldSpec</a></p>
|
||||
</blockquote>
|
||||
<h4 id="example-2">Example</h4>
|
||||
<blockquote>
|
||||
<pre><code>apiVersion: builtin
|
||||
kind: ImageTagTransformer
|
||||
metadata:
|
||||
name: not-important-to-example
|
||||
imageTag:
|
||||
name: nginx
|
||||
newTag: v2
|
||||
</code></pre></blockquote>
|
||||
<h2 id="_labeltransformer_"><em>LabelTransformer</em></h2>
|
||||
<h3 id="usage-via-kustomizationyaml-3">Usage via <code>kustomization.yaml</code></h3>
|
||||
<h4 id="field-name-commonlabels">field name: <code>commonLabels</code></h4>
|
||||
<p>Adds labels to all resources and selectors</p>
|
||||
<pre><code>commonLabels:
|
||||
someName: someValue
|
||||
owner: alice
|
||||
app: bingo
|
||||
</code></pre><h3 id="usage-via-plugin-3">Usage via plugin</h3>
|
||||
<h4 id="arguments-3">Arguments</h4>
|
||||
<blockquote>
|
||||
<p>Labels map[string]string</p>
|
||||
<p>FieldSpecs []<a href="https://github.com/kubernetes-sigs/kustomize/tree/master/api/types/fieldspec.go">config.FieldSpec</a></p>
|
||||
</blockquote>
|
||||
<h4 id="example-3">Example</h4>
|
||||
<blockquote>
|
||||
<pre><code>apiVersion: builtin
|
||||
kind: LabelTransformer
|
||||
metadata:
|
||||
name: not-important-to-example
|
||||
labels:
|
||||
app: myApp
|
||||
env: production
|
||||
fieldSpecs:
|
||||
- path: metadata/labels
|
||||
create: true
|
||||
</code></pre></blockquote>
|
||||
<h2 id="_namespacetransformer_"><em>NamespaceTransformer</em></h2>
|
||||
<h3 id="usage-via-kustomizationyaml-4">Usage via <code>kustomization.yaml</code></h3>
|
||||
<h4 id="field-name-namespace">field name: <code>namespace</code></h4>
|
||||
<p>Adds namespace to all resources</p>
|
||||
<pre><code>namespace: my-namespace
|
||||
</code></pre><h3 id="usage-via-plugin-4">Usage via plugin</h3>
|
||||
<h4 id="arguments-4">Arguments</h4>
|
||||
<blockquote>
|
||||
<p><a href="https://github.com/kubernetes-sigs/kustomize/tree/master/api/types/objectmeta.go">types.ObjectMeta</a></p>
|
||||
<p>FieldSpecs []<a href="https://github.com/kubernetes-sigs/kustomize/tree/master/api/types/fieldspec.go">config.FieldSpec</a></p>
|
||||
</blockquote>
|
||||
<h4 id="example-4">Example</h4>
|
||||
<blockquote>
|
||||
<pre><code>apiVersion: builtin
|
||||
kind: NamespaceTransformer
|
||||
metadata:
|
||||
name: not-important-to-example
|
||||
namespace: test
|
||||
fieldSpecs:
|
||||
- path: metadata/namespace
|
||||
create: true
|
||||
- path: subjects
|
||||
kind: RoleBinding
|
||||
group: rbac.authorization.k8s.io
|
||||
- path: subjects
|
||||
kind: ClusterRoleBinding
|
||||
group: rbac.authorization.k8s.io
|
||||
</code></pre></blockquote>
|
||||
<h2 id="_patchesjson6902_"><em>PatchesJson6902</em></h2>
|
||||
<h3 id="usage-via-kustomizationyaml-5">Usage via <code>kustomization.yaml</code></h3>
|
||||
<h4 id="field-name-patchesjson6902">field name: <code>patchesJson6902</code></h4>
|
||||
<p>Each entry in this list should resolve to
|
||||
a kubernetes object and a JSON patch that will be applied
|
||||
to the object.
|
||||
The JSON patch is documented at <a href="https://tools.ietf.org/html/rfc6902">https://tools.ietf.org/html/rfc6902</a></p>
|
||||
<p>target field points to a kubernetes object within the same kustomization
|
||||
by the object’s group, version, kind, name and namespace.
|
||||
path field is a relative file path of a JSON patch file.
|
||||
The content in this patch file can be either in JSON format as</p>
|
||||
<pre><code> [
|
||||
{"op": "add", "path": "/some/new/path", "value": "value"},
|
||||
{"op": "replace", "path": "/some/existing/path", "value": "new value"}
|
||||
]
|
||||
</code></pre><p>or in YAML format as</p>
|
||||
<pre><code>- op: add
|
||||
path: /some/new/path
|
||||
value: value
|
||||
- op: replace
|
||||
path: /some/existing/path
|
||||
value: new value
|
||||
</code></pre><pre><code>patchesJson6902:
|
||||
- target:
|
||||
version: v1
|
||||
kind: Deployment
|
||||
name: my-deployment
|
||||
path: add_init_container.yaml
|
||||
- target:
|
||||
version: v1
|
||||
kind: Service
|
||||
name: my-service
|
||||
path: add_service_annotation.yaml
|
||||
</code></pre><p>The patch content can be an inline string as well:</p>
|
||||
<pre><code>patchesJson6902:
|
||||
- target:
|
||||
version: v1
|
||||
kind: Deployment
|
||||
name: my-deployment
|
||||
patch: |-
|
||||
- op: add
|
||||
path: /some/new/path
|
||||
value: value
|
||||
- op: replace
|
||||
path: /some/existing/path
|
||||
value: "new value"
|
||||
</code></pre><h3 id="usage-via-plugin-5">Usage via plugin</h3>
|
||||
<h4 id="arguments-5">Arguments</h4>
|
||||
<blockquote>
|
||||
<p>Target <a href="https://github.com/kubernetes-sigs/kustomize/tree/master/api/types/patchtarget.go">types.PatchTarget</a></p>
|
||||
<p>Path string</p>
|
||||
<p>JsonOp string</p>
|
||||
</blockquote>
|
||||
<h4 id="example-5">Example</h4>
|
||||
<blockquote>
|
||||
<pre><code>apiVersion: builtin
|
||||
kind: PatchJson6902Transformer
|
||||
metadata:
|
||||
name: not-important-to-example
|
||||
target:
|
||||
group: apps
|
||||
version: v1
|
||||
kind: Deployment
|
||||
name: my-deploy
|
||||
path: jsonpatch.json
|
||||
</code></pre></blockquote>
|
||||
<h2 id="_patchesstrategicmerge_"><em>PatchesStrategicMerge</em></h2>
|
||||
<h3 id="usage-via-kustomizationyaml-6">Usage via <code>kustomization.yaml</code></h3>
|
||||
<h4 id="field-name-patchesstrategicmerge">field name: <code>patchesStrategicMerge</code></h4>
|
||||
<p>Each entry in this list should be either a relative
|
||||
file path or an inline content
|
||||
resolving to a partial or complete resource
|
||||
definition.</p>
|
||||
<p>The names in these (possibly partial) resource
|
||||
files must match names already loaded via the
|
||||
<code>resources</code> field. These entries are used to
|
||||
<em>patch</em> (modify) the known resources.</p>
|
||||
<p>Small patches that do one thing are best, e.g. modify
|
||||
a memory request/limit, change an env var in a
|
||||
ConfigMap, etc. Small patches are easy to review and
|
||||
easy to mix together in overlays.</p>
|
||||
<pre><code>patchesStrategicMerge:
|
||||
- service_port_8888.yaml
|
||||
- deployment_increase_replicas.yaml
|
||||
- deployment_increase_memory.yaml
|
||||
</code></pre><p>The patch content can be a inline string as well.</p>
|
||||
<pre><code>patchesStrategicMerge:
|
||||
- |-
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: nginx
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: nginx
|
||||
image: nignx:latest
|
||||
</code></pre><p>Note that kustomize does not support more than one patch
|
||||
for the same object that contain a <em>delete</em> directive. To remove
|
||||
several fields / slice elements from an object create a single
|
||||
patch that performs all the needed deletions.</p>
|
||||
<h3 id="usage-via-plugin-6">Usage via plugin</h3>
|
||||
<h4 id="arguments-6">Arguments</h4>
|
||||
<blockquote>
|
||||
<p>Paths []<a href="https://github.com/kubernetes-sigs/kustomize/tree/master/api/types/patchstrategicmerge.go">types.PatchStrategicMerge</a></p>
|
||||
<p>Patches string</p>
|
||||
</blockquote>
|
||||
<h4 id="example-6">Example</h4>
|
||||
<blockquote>
|
||||
<pre><code>apiVersion: builtin
|
||||
kind: PatchStrategicMergeTransformer
|
||||
metadata:
|
||||
name: not-important-to-example
|
||||
paths:
|
||||
- patch.yaml
|
||||
</code></pre></blockquote>
|
||||
<h2 id="_patchtransformer_"><em>PatchTransformer</em></h2>
|
||||
<h3 id="usage-via-kustomizationyaml-7">Usage via <code>kustomization.yaml</code></h3>
|
||||
<h4 id="field-name-patches">field name: <code>patches</code></h4>
|
||||
<p>Each entry in this list should resolve to an Patch
|
||||
object, which includes a patch and a target selector.
|
||||
The patch can be either a strategic merge patch or a
|
||||
JSON patch. it can be either a patch file or an inline
|
||||
string. The target selects
|
||||
resources by group, version, kind, name, namespace,
|
||||
labelSelector and annotationSelector. A resource
|
||||
which matches all the specified fields is selected
|
||||
to apply the patch.</p>
|
||||
<pre><code>patches:
|
||||
- path: patch.yaml
|
||||
target:
|
||||
group: apps
|
||||
version: v1
|
||||
kind: Deployment
|
||||
name: deploy.*
|
||||
labelSelector: "env=dev"
|
||||
annotationSelector: "zone=west"
|
||||
- patch: |-
|
||||
- op: replace
|
||||
path: /some/existing/path
|
||||
value: new value
|
||||
target:
|
||||
kind: MyKind
|
||||
labelSelector: "env=dev"
|
||||
</code></pre><p>The <code>name</code> and <code>namespace</code> fields of the patch target selector are
|
||||
automatically anchored regular expressions. This means that the value <code>myapp</code>
|
||||
is equivalent to <code>^myapp$</code>.</p>
|
||||
<h3 id="usage-via-plugin-7">Usage via plugin</h3>
|
||||
<h4 id="arguments-7">Arguments</h4>
|
||||
<blockquote>
|
||||
<p>Path string</p>
|
||||
<p>Patch string</p>
|
||||
<p>Target *<a href="https://github.com/kubernetes-sigs/kustomize/tree/master/api/types/selector.go">types.Selector</a></p>
|
||||
</blockquote>
|
||||
<h4 id="example-7">Example</h4>
|
||||
<blockquote>
|
||||
<pre><code>apiVersion: builtin
|
||||
kind: PatchTransformer
|
||||
metadata:
|
||||
name: not-important-to-example
|
||||
patch: '[{"op": "replace", "path": "/spec/template/spec/containers/0/image", "value": "nginx:latest"}]'
|
||||
target:
|
||||
name: .*Deploy
|
||||
kind: Deployment
|
||||
</code></pre></blockquote>
|
||||
<h2 id="_prefixsuffixtransformer_"><em>PrefixSuffixTransformer</em></h2>
|
||||
<h3 id="usage-via-kustomizationyaml-8">Usage via <code>kustomization.yaml</code></h3>
|
||||
<h4 id="field-names-nameprefix-namesuffix">field names: <code>namePrefix</code>, <code>nameSuffix</code></h4>
|
||||
<p>Prepends or postfixes the value to the names
|
||||
of all resources.</p>
|
||||
<p>E.g. a deployment named <code>wordpress</code> could
|
||||
become <code>alices-wordpress</code> or <code>wordpress-v2</code>
|
||||
or <code>alices-wordpress-v2</code>.</p>
|
||||
<pre><code>namePrefix: alices-
|
||||
nameSuffix: -v2
|
||||
</code></pre><p>The suffix is appended before the content hash if
|
||||
the resource type is ConfigMap or Secret.</p>
|
||||
<h3 id="usage-via-plugin-8">Usage via plugin</h3>
|
||||
<h4 id="arguments-8">Arguments</h4>
|
||||
<blockquote>
|
||||
<p>Prefix string</p>
|
||||
<p>Suffix string</p>
|
||||
<p>FieldSpecs []<a href="https://github.com/kubernetes-sigs/kustomize/tree/master/api/types/fieldspec.go">config.FieldSpec</a></p>
|
||||
</blockquote>
|
||||
<h4 id="example-8">Example</h4>
|
||||
<blockquote>
|
||||
<pre><code>apiVersion: builtin
|
||||
kind: PrefixSuffixTransformer
|
||||
metadata:
|
||||
name: not-important-to-example
|
||||
prefix: baked-
|
||||
suffix: -pie
|
||||
fieldSpecs:
|
||||
- path: metadata/name
|
||||
</code></pre></blockquote>
|
||||
<h2 id="_replicacounttransformer_"><em>ReplicaCountTransformer</em></h2>
|
||||
<h3 id="usage-via-kustomizationyaml-9">Usage via <code>kustomization.yaml</code></h3>
|
||||
<h4 id="field-name-replicas">field name: <code>replicas</code></h4>
|
||||
<p>Replicas modified the number of replicas for a resource.</p>
|
||||
<p>E.g. Given this kubernetes Deployment fragment:</p>
|
||||
<pre><code>kind: Deployment
|
||||
metadata:
|
||||
name: deployment-name
|
||||
spec:
|
||||
replicas: 3
|
||||
</code></pre><p>one can change the number of replicas to 5
|
||||
by adding the following to your kustomization:</p>
|
||||
<pre><code>replicas:
|
||||
- name: deployment-name
|
||||
count: 5
|
||||
</code></pre><p>This field accepts a list, so many resources can
|
||||
be modified at the same time.</p>
|
||||
<p>As this declaration does not take in a <code>kind:</code> nor a <code>group:</code>
|
||||
it will match any <code>group</code> and <code>kind</code> that has a matching name and
|
||||
that is one of:</p>
|
||||
<ul>
|
||||
<li><code>Deployment</code></li>
|
||||
<li><code>ReplicationController</code></li>
|
||||
<li><code>ReplicaSet</code></li>
|
||||
<li><code>StatefulSet</code></li>
|
||||
</ul>
|
||||
<p>For more complex use cases, revert to using a patch.</p>
|
||||
<h3 id="usage-via-plugin-9">Usage via plugin</h3>
|
||||
<h4 id="arguments-9">Arguments</h4>
|
||||
<blockquote>
|
||||
<p>Replica <a href="https://github.com/kubernetes-sigs/kustomize/tree/master/api/types/replica.go">types.Replica</a></p>
|
||||
<p>FieldSpecs []<a href="https://github.com/kubernetes-sigs/kustomize/tree/master/api/types/fieldspec.go">config.FieldSpec</a></p>
|
||||
</blockquote>
|
||||
<h4 id="example-9">Example</h4>
|
||||
<blockquote>
|
||||
<pre><code>apiVersion: builtin
|
||||
kind: ReplicaCountTransformer
|
||||
metadata:
|
||||
name: not-important-to-example
|
||||
replica:
|
||||
name: myapp
|
||||
count: 23
|
||||
fieldSpecs:
|
||||
- path: spec/replicas
|
||||
create: true
|
||||
kind: Deployment
|
||||
- path: spec/replicas
|
||||
create: true
|
||||
kind: ReplicationController
|
||||
</code></pre></blockquote>
|
||||
<h2 id="_secretgenerator_"><em>SecretGenerator</em></h2>
|
||||
<h3 id="usage-via-kustomizationyaml-10">Usage via <code>kustomization.yaml</code></h3>
|
||||
<h4 id="field-name-secretgenerator">field name: <code>secretGenerator</code></h4>
|
||||
<p>Each entry in the argument list
|
||||
results in the creation of
|
||||
one Secret resource
|
||||
(it’s a generator of n secrets).</p>
|
||||
<p>This works like the <code>configMapGenerator</code> field
|
||||
described above.</p>
|
||||
<pre><code>secretGenerator:
|
||||
- name: app-tls
|
||||
files:
|
||||
- secret/tls.cert
|
||||
- secret/tls.key
|
||||
type: "kubernetes.io/tls"
|
||||
- name: app-tls-namespaced
|
||||
# you can define a namespace to generate
|
||||
# a secret in, defaults to: "default"
|
||||
namespace: apps
|
||||
files:
|
||||
- tls.crt=catsecret/tls.cert
|
||||
- tls.key=secret/tls.key
|
||||
type: "kubernetes.io/tls"
|
||||
- name: env_file_secret
|
||||
envs:
|
||||
- env.txt
|
||||
type: Opaque
|
||||
- name: secret-with-annotation
|
||||
files:
|
||||
- app-config.yaml
|
||||
type: Opaque
|
||||
options:
|
||||
annotations:
|
||||
app_config: "true"
|
||||
labels:
|
||||
app.kubernetes.io/name: "app2"
|
||||
</code></pre><h3 id="usage-via-plugin-10">Usage via plugin</h3>
|
||||
<h4 id="arguments-10">Arguments</h4>
|
||||
<blockquote>
|
||||
<p><a href="https://github.com/kubernetes-sigs/kustomize/tree/master/api/types/objectmeta.go">types.ObjectMeta</a></p>
|
||||
<p><a href="https://github.com/kubernetes-sigs/kustomize/tree/master/api/types/secretargs.go">types.SecretArgs</a></p>
|
||||
</blockquote>
|
||||
<h4 id="example-10">Example</h4>
|
||||
<blockquote>
|
||||
<pre><code>apiVersion: builtin
|
||||
kind: SecretGenerator
|
||||
metadata:
|
||||
name: my-secret
|
||||
namespace: whatever
|
||||
behavior: merge
|
||||
envs:
|
||||
- a.env
|
||||
- b.env
|
||||
files:
|
||||
- obscure=longsecret.txt
|
||||
literals:
|
||||
- FRUIT=apple
|
||||
- VEGETABLE=carrot
|
||||
</code></pre></blockquote>
|
||||
<h2 id="_helmchartinflationgenerator_"><em>HelmChartInflationGenerator</em></h2>
|
||||
<h3 id="usage-via-kustomizationyaml-11">Usage via <code>kustomization.yaml</code></h3>
|
||||
<h4 id="field-name-helmchartinflationgenerator">field name: <code>helmChartInflationGenerator</code></h4>
|
||||
<p>Each entry in the argument list results in the pulling
|
||||
and rendering of a helm chart.</p>
|
||||
<p>Each entry can have following fields:</p>
|
||||
<ul>
|
||||
<li><code>chartName</code>: The name of the chart that you want to use.</li>
|
||||
<li><code>chartRepoUrl</code>: [Optional] The URL of the repository which contains the chart. If
|
||||
this is provided, the plugin will try to fetch remote charts. Otherwise it will
|
||||
try to load local chart in <code>chartHome</code>.</li>
|
||||
<li><code>chartVersion</code>: [Optional] Version of the chart. Will use latest version
|
||||
if this is omitted.</li>
|
||||
<li><code>chartHome</code>: [Optional] Provide the path to the parent directory for local chart.</li>
|
||||
<li><code>chartRelease</code>: [Optional] The name of the repo where to find the chart.</li>
|
||||
<li><code>values</code>: [Optional] A path to the values file.</li>
|
||||
<li><code>releaseName</code>: [Optional] The release name that will be set in the chart.</li>
|
||||
<li><code>releaseNamespace</code>: [Optional] The namespace which will be used by <code>--namespace</code>
|
||||
flag in <code>helm template</code> command.</li>
|
||||
<li><code>helmBin</code>: [Optional] Path to helm binary. Default is <code>helm</code>.</li>
|
||||
<li><code>helmHome</code>: [Optional] Path to helm home directory.</li>
|
||||
</ul>
|
||||
<pre><code>helmChartInflationGenerator:
|
||||
- chartName: minecraft
|
||||
chartRepoUrl: https://kubernetes-charts.storage.googleapis.com
|
||||
chartVersion: v1.2.0
|
||||
releaseName: test
|
||||
releaseNamespace: testNamespace
|
||||
</code></pre><h3 id="usage-via-plugin-11">Usage via plugin</h3>
|
||||
<h4 id="arguments-11">Arguments</h4>
|
||||
<blockquote>
|
||||
<p>ChartName string</p>
|
||||
<p>ChartVersion string</p>
|
||||
<p>ChartRepoURL string</p>
|
||||
<p>ChartHome string</p>
|
||||
<p>ChartRepoName string</p>
|
||||
<p>HelmBin string</p>
|
||||
<p>HelmHome string</p>
|
||||
<p>Values string</p>
|
||||
<p>ReleaseName string</p>
|
||||
<p>ReleaseNamespace string</p>
|
||||
</blockquote>
|
||||
<h4 id="example-11">Example</h4>
|
||||
<blockquote>
|
||||
<pre><code>apiVersion: builtin
|
||||
kind: HelmChartInflationGenerator
|
||||
metadata:
|
||||
name: myMap
|
||||
chartName: minecraft
|
||||
chartRepoUrl: https://kubernetes-charts.storage.googleapis.com
|
||||
chartVersion: v1.2.0
|
||||
helmBin: /usr/bin/helm
|
||||
helmHome: /tmp/helmHome
|
||||
releaseName: test
|
||||
releaseNamespace: testNamespace
|
||||
values: values.yaml
|
||||
</code></pre></blockquote>
|
||||
<p>Moved to <a href="https://github.com/kubernetes-sigs/cli-experimental">https://github.com/kubernetes-sigs/cli-experimental</a></p>
|
||||
|
||||
|
||||
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 4, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/0834e152b203ffeccfbbf1ddd3c1f49debdac341">Redirect kustomize docs to the new unified site. (0834e152)</a>
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 11, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/71b763888cad614abb44b3086e291fe72d601080">Remove duplicate kustomize docs content (71b76388)</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -25,12 +25,12 @@
|
||||
" />
|
||||
<meta property="og:type" content="article" />
|
||||
<meta property="og:url" content="https://kubernetes-sigs.github.io/kustomize/guides/plugins/execpluginguidedexample/" />
|
||||
<meta property="article:modified_time" content="2020-11-04T11:15:40-08:00" /><meta property="og:site_name" content="Kustomize" />
|
||||
<meta property="article:modified_time" content="2020-11-11T08:29:43-08:00" /><meta property="og:site_name" content="Kustomize" />
|
||||
<meta itemprop="name" content="Exec plugin on linux">
|
||||
<meta itemprop="description" content="Exec plugin on linux in 60 seconds
|
||||
">
|
||||
<meta itemprop="dateModified" content="2020-11-04T11:15:40-08:00" />
|
||||
<meta itemprop="wordCount" content="465">
|
||||
<meta itemprop="dateModified" content="2020-11-11T08:29:43-08:00" />
|
||||
<meta itemprop="wordCount" content="3">
|
||||
|
||||
|
||||
|
||||
@@ -310,236 +310,6 @@
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">Command Line Options</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmd">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/build/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">build</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdbuild">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/cfg/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">cfg</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdcfg">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/create/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">create</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdcreate">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/edit/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">edit</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdedit">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/fn/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">fn</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdfn">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/help/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">help</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdhelp">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/install-completion/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">install-completion</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdinstall-completion">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/live/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">live</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdlive">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/version/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">version</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdversion">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/components/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">Kustomize Components</a>
|
||||
@@ -593,23 +363,6 @@
|
||||
|
||||
|
||||
|
||||
<nav id="TableOfContents">
|
||||
<ul>
|
||||
<li>
|
||||
<ul>
|
||||
<li></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#make-a-place-to-work">Make a place to work</a></li>
|
||||
<li><a href="#create-a-kustomization">Create a kustomization</a></li>
|
||||
<li><a href="#make-a-home-for-plugins">Make a home for plugins</a></li>
|
||||
<li><a href="#create-the-plugin">Create the plugin</a></li>
|
||||
<li><a href="#install-kustomize">Install kustomize</a></li>
|
||||
<li><a href="#review-the-layout">Review the layout</a></li>
|
||||
<li><a href="#build-your-app-using-the-plugin">Build your app, using the plugin</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
@@ -656,164 +409,11 @@
|
||||
<h1>Exec plugin on linux</h1>
|
||||
<div class="lead">Exec plugin on linux in 60 seconds</div>
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/guides/extending_kustomize/execpluginguidedexample" />
|
||||
<p>This is a (no reading allowed!) 60 second copy/paste guided
|
||||
example. Full plugin docs <a href="..">here</a>.</p>
|
||||
<p>This demo writes and uses a somewhat ridiculous
|
||||
<em>exec</em> plugin (written in bash) that generates a
|
||||
<code>ConfigMap</code>.</p>
|
||||
<p>This is a guide to try it without damaging your
|
||||
current setup.</p>
|
||||
<h4 id="requirements">requirements</h4>
|
||||
<ul>
|
||||
<li>linux, git, curl, Go 1.13</li>
|
||||
</ul>
|
||||
<h2 id="make-a-place-to-work">Make a place to work</h2>
|
||||
<pre><code>DEMO=$(mktemp -d)
|
||||
</code></pre><h2 id="create-a-kustomization">Create a kustomization</h2>
|
||||
<p>Make a kustomization directory to
|
||||
hold all your config:</p>
|
||||
<pre><code>MYAPP=$DEMO/myapp
|
||||
mkdir -p $MYAPP
|
||||
</code></pre><p>Make a deployment config:</p>
|
||||
<pre><code>cat <<'EOF' >$MYAPP/deployment.yaml
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: the-deployment
|
||||
spec:
|
||||
replicas: 3
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: the-container
|
||||
image: monopole/hello:1
|
||||
command: ["/hello",
|
||||
"--port=8080",
|
||||
"--date=$(THE_DATE)",
|
||||
"--enableRiskyFeature=$(ENABLE_RISKY)"]
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
env:
|
||||
- name: THE_DATE
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: the-map
|
||||
key: today
|
||||
- name: ALT_GREETING
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: the-map
|
||||
key: altGreeting
|
||||
- name: ENABLE_RISKY
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: the-map
|
||||
key: enableRisky
|
||||
EOF
|
||||
</code></pre><p>Make a service config:</p>
|
||||
<pre><code>cat <<EOF >$MYAPP/service.yaml
|
||||
kind: Service
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: the-service
|
||||
spec:
|
||||
type: LoadBalancer
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 8666
|
||||
targetPort: 8080
|
||||
EOF
|
||||
</code></pre><p>Now make a config file for the plugin
|
||||
you’re about to write.</p>
|
||||
<p>This config file is just another k8s resource
|
||||
object. The values of its <code>apiVersion</code> and <code>kind</code>
|
||||
fields are used to <em>find</em> the plugin code on your
|
||||
filesystem (more on this later).</p>
|
||||
<pre><code>cat <<'EOF' >$MYAPP/cmGenerator.yaml
|
||||
apiVersion: myDevOpsTeam
|
||||
kind: SillyConfigMapGenerator
|
||||
metadata:
|
||||
name: whatever
|
||||
argsOneLiner: Bienvenue true
|
||||
EOF
|
||||
</code></pre><p>Finally, make a kustomization file
|
||||
referencing all of the above:</p>
|
||||
<pre><code>cat <<EOF >$MYAPP/kustomization.yaml
|
||||
commonLabels:
|
||||
app: hello
|
||||
resources:
|
||||
- deployment.yaml
|
||||
- service.yaml
|
||||
generators:
|
||||
- cmGenerator.yaml
|
||||
EOF
|
||||
</code></pre><p>Review the files</p>
|
||||
<pre><code>ls -C1 $MYAPP
|
||||
</code></pre><h2 id="make-a-home-for-plugins">Make a home for plugins</h2>
|
||||
<p>Plugins must live in a particular place for
|
||||
kustomize to find them.</p>
|
||||
<p>This demo will use the ephemeral directory:</p>
|
||||
<pre><code>PLUGIN_ROOT=$DEMO/kustomize/plugin
|
||||
</code></pre><p>The plugin config defined above in
|
||||
<code>$MYAPP/cmGenerator.yaml</code> specifies:</p>
|
||||
<blockquote>
|
||||
<pre><code>apiVersion: myDevOpsTeam
|
||||
kind: SillyConfigMapGenerator
|
||||
</code></pre></blockquote>
|
||||
<p>This means the plugin must live in a directory
|
||||
named:</p>
|
||||
<pre><code>MY_PLUGIN_DIR=$PLUGIN_ROOT/myDevOpsTeam/sillyconfigmapgenerator
|
||||
|
||||
mkdir -p $MY_PLUGIN_DIR
|
||||
</code></pre><p>The directory name is the plugin config’s
|
||||
<em>apiVersion</em> followed by its lower-cased <em>kind</em>.</p>
|
||||
<p>A plugin gets its own directory to hold itself,
|
||||
its tests and any supplemental data files it
|
||||
might need.</p>
|
||||
<h2 id="create-the-plugin">Create the plugin</h2>
|
||||
<p>There are two kinds of plugins, <em>exec</em> and <em>Go</em>.</p>
|
||||
<p>Make an <em>exec</em> plugin, installing it to the
|
||||
correct directory and file name. The file name
|
||||
must match the plugin’s <em>kind</em> (in this case,
|
||||
<code>SillyConfigMapGenerator</code>):</p>
|
||||
<pre><code>cat <<'EOF' >$MY_PLUGIN_DIR/SillyConfigMapGenerator
|
||||
#!/bin/bash
|
||||
# Skip the config file name argument.
|
||||
shift
|
||||
today=`date +%F`
|
||||
echo "
|
||||
kind: ConfigMap
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: the-map
|
||||
data:
|
||||
today: $today
|
||||
altGreeting: "$1"
|
||||
enableRisky: "$2"
|
||||
"
|
||||
EOF
|
||||
</code></pre><p>By definition, an <em>exec</em> plugin must be executable:</p>
|
||||
<pre><code>chmod a+x $MY_PLUGIN_DIR/SillyConfigMapGenerator
|
||||
</code></pre><h2 id="install-kustomize">Install kustomize</h2>
|
||||
<p>Per the <a href="/kustomize/installation">instructions</a>:</p>
|
||||
<pre><code>curl -s "https://raw.githubusercontent.com/\
|
||||
kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash
|
||||
mkdir -p $DEMO/bin
|
||||
mv kustomize $DEMO/bin
|
||||
</code></pre><h2 id="review-the-layout">Review the layout</h2>
|
||||
<pre><code>tree $DEMO
|
||||
</code></pre><h2 id="build-your-app-using-the-plugin">Build your app, using the plugin</h2>
|
||||
<pre><code>XDG_CONFIG_HOME=$DEMO $DEMO/bin/kustomize build --enable_alpha_plugins $MYAPP
|
||||
</code></pre><p>Above, if you had set</p>
|
||||
<blockquote>
|
||||
<pre><code>PLUGIN_ROOT=$HOME/.config/kustomize/plugin
|
||||
</code></pre></blockquote>
|
||||
<p>there would be no need to use <code>XDG_CONFIG_HOME</code> in the
|
||||
<em>kustomize</em> command above.</p>
|
||||
<p>Moved to <a href="https://github.com/kubernetes-sigs/cli-experimental">https://github.com/kubernetes-sigs/cli-experimental</a></p>
|
||||
|
||||
|
||||
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 4, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/0834e152b203ffeccfbbf1ddd3c1f49debdac341">Redirect kustomize docs to the new unified site. (0834e152)</a>
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 11, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/71b763888cad614abb44b3086e291fe72d601080">Remove duplicate kustomize docs content (71b76388)</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -25,12 +25,12 @@
|
||||
" />
|
||||
<meta property="og:type" content="article" />
|
||||
<meta property="og:url" content="https://kubernetes-sigs.github.io/kustomize/guides/plugins/goplugincaveats/" />
|
||||
<meta property="article:modified_time" content="2020-11-04T11:15:40-08:00" /><meta property="og:site_name" content="Kustomize" />
|
||||
<meta property="article:modified_time" content="2020-11-11T08:29:43-08:00" /><meta property="og:site_name" content="Kustomize" />
|
||||
<meta itemprop="name" content="Go plugin Caveats">
|
||||
<meta itemprop="description" content="Go plugin Caveats
|
||||
">
|
||||
<meta itemprop="dateModified" content="2020-11-04T11:15:40-08:00" />
|
||||
<meta itemprop="wordCount" content="532">
|
||||
<meta itemprop="dateModified" content="2020-11-11T08:29:43-08:00" />
|
||||
<meta itemprop="wordCount" content="3">
|
||||
|
||||
|
||||
|
||||
@@ -310,236 +310,6 @@
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">Command Line Options</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmd">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/build/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">build</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdbuild">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/cfg/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">cfg</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdcfg">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/create/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">create</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdcreate">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/edit/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">edit</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdedit">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/fn/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">fn</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdfn">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/help/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">help</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdhelp">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/install-completion/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">install-completion</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdinstall-completion">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/live/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">live</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdlive">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/version/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">version</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdversion">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/components/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">Kustomize Components</a>
|
||||
@@ -593,20 +363,6 @@
|
||||
|
||||
|
||||
|
||||
<nav id="TableOfContents">
|
||||
<ul>
|
||||
<li><a href="#the-skew-problem">The skew problem</a></li>
|
||||
<li><a href="#why-support-go-plugins">Why support Go plugins</a>
|
||||
<ul>
|
||||
<li><a href="#safety">Safety</a></li>
|
||||
<li><a href="#debugging">Debugging</a></li>
|
||||
<li><a href="#unit-of-contribution">Unit of contribution</a></li>
|
||||
<li><a href="#ecosystems-grow-through-use">Ecosystems grow through use</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
@@ -653,94 +409,11 @@
|
||||
<h1>Go plugin Caveats</h1>
|
||||
<div class="lead">Go plugin Caveats</div>
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/guides/extending_kustomize/goplugincaveats" />
|
||||
<p>A <em>Go plugin</em> is a compilation artifact described
|
||||
by the Go <a href="https://golang.org/pkg/plugin">plugin package</a>. It is built with
|
||||
special flags and cannot run on its own.
|
||||
It must be loaded into a running Go program.</p>
|
||||
<blockquote>
|
||||
<p>A normal program written in Go might be usable
|
||||
as <em>exec plugin</em>, but is not a <em>Go plugin</em>.</p>
|
||||
</blockquote>
|
||||
<p>Go plugins allow kustomize extensions that run
|
||||
without the cost marshalling/unmarshalling all
|
||||
resource data to/from a subprocess for each plugin
|
||||
run. The Go plugin API assures a certain level of
|
||||
consistency to avoid confusing downstream
|
||||
transformers.</p>
|
||||
<p>Go plugins work as described in the <a href="https://golang.org/pkg/plugin">plugin
|
||||
package</a>, but fall short of common notions
|
||||
associated with the word <em>plugin</em>.</p>
|
||||
<h2 id="the-skew-problem">The skew problem</h2>
|
||||
<p>Go plugin compilation creates an <a href="https://en.wikipedia.org/wiki/Executable_and_Linkable_Format">ELF</a> formatted
|
||||
<code>.so</code> file, which by definition has no information
|
||||
about the provenance of the object code.</p>
|
||||
<p>Skew between the compilation conditions (versions
|
||||
of package dependencies, <code>GOOS</code>, <code>GOARCH</code>) of the
|
||||
main program ELF and the plugin ELF will cause
|
||||
plugin load failure, with non-helpful error
|
||||
messages.</p>
|
||||
<p>Exec plugins also lack provenance, but won’t fail
|
||||
due to compilation skew.</p>
|
||||
<p>In either case, the only sensible way to share a
|
||||
plugin is as some kind of <em>bundle</em> (a git repo
|
||||
URL, a git archive file, a tar file, etc.)
|
||||
containing source code, tests and associated data,
|
||||
unpackable under
|
||||
<code>$XDG_CONFIG_HOME/kustomize/plugin</code>.</p>
|
||||
<p>In the case of a Go plugin, an <em>end user</em>
|
||||
accepting a shared plugin <em>must compile both
|
||||
kustomize and the plugin</em>.</p>
|
||||
<p>This means a one-time run of</p>
|
||||
<pre><code># Or whatever is appropriate at time of reading
|
||||
GOPATH=${whatever} GO111MODULE=on go get sigs.k8s.io/kustomize/api
|
||||
</code></pre><p>and then a normal development cycle using</p>
|
||||
<pre><code>go build -buildmode plugin \
|
||||
-o ${wherever}/${kind}.so ${wherever}/${kind}.go
|
||||
</code></pre><p>with paths and the release version tag (e.g. <code>v3.0.0</code>)
|
||||
adjusted as needed.</p>
|
||||
<p>For comparison, consider what one
|
||||
must do to write a <a href="https://www.tensorflow.org/guide/extend/op">tensorflow plugin</a>.</p>
|
||||
<h2 id="why-support-go-plugins">Why support Go plugins</h2>
|
||||
<h3 id="safety">Safety</h3>
|
||||
<p>The Go plugin developer sees the same API offered
|
||||
to native kustomize operations, assuring certain
|
||||
semantics, invariants, checks, etc. An exec
|
||||
plugin sub-process dealing with this via
|
||||
stdin/stdout will have an easier time screwing
|
||||
things up for downstream transformers and
|
||||
consumers.</p>
|
||||
<p>Minor point: if the plugin reads files via
|
||||
the kustomize-provided file <code>Loader</code> interface, it
|
||||
will be constrained by kustomize file loading
|
||||
restrictions. Of course, nothing but a code audit
|
||||
prevents a Go plugin from importing the <code>io</code> package
|
||||
and doing whatever it wants.</p>
|
||||
<h3 id="debugging">Debugging</h3>
|
||||
<p>A Go plugin developer can debug the plugin <em>in
|
||||
situ</em>, setting breakpoints inside the plugin and
|
||||
elsewhere while running a plugin in feature tests.</p>
|
||||
<p>To get the best of both worlds (shareability and safety),
|
||||
a developer can write an <code>.go</code> program that functions
|
||||
as an <em>exec plugin</em>, but can be processed by <code>go generate</code>
|
||||
to emit a <em>Go plugin</em> (or vice versa).</p>
|
||||
<h3 id="unit-of-contribution">Unit of contribution</h3>
|
||||
<p>All the builtin generators and transformers
|
||||
are themselves Go plugins. This means that
|
||||
the kustomize maintainers can promote a contributed
|
||||
plugin to a builtin without needing code changes
|
||||
(beyond those mandated by normal code review).</p>
|
||||
<h3 id="ecosystems-grow-through-use">Ecosystems grow through use</h3>
|
||||
<p>Tooling could ease Go plugin <em>sharing</em>, but this
|
||||
requires some critical mass of Go plugin
|
||||
<em>authoring</em>, which in turn is hampered by
|
||||
confusion around sharing. <a href="https://github.com/golang/go/wiki/Modules">Go modules</a>, once they
|
||||
are more widely adopted, will solve the
|
||||
biggest plugin sharing difficulty: ambiguous
|
||||
plugin vs host dependencies.</p>
|
||||
<p>Moved to <a href="https://github.com/kubernetes-sigs/cli-experimental">https://github.com/kubernetes-sigs/cli-experimental</a></p>
|
||||
|
||||
|
||||
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 4, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/0834e152b203ffeccfbbf1ddd3c1f49debdac341">Redirect kustomize docs to the new unified site. (0834e152)</a>
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 11, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/71b763888cad614abb44b3086e291fe72d601080">Remove duplicate kustomize docs content (71b76388)</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -25,12 +25,12 @@
|
||||
" />
|
||||
<meta property="og:type" content="article" />
|
||||
<meta property="og:url" content="https://kubernetes-sigs.github.io/kustomize/guides/plugins/gopluginguidedexample/" />
|
||||
<meta property="article:modified_time" content="2020-11-04T11:15:40-08:00" /><meta property="og:site_name" content="Kustomize" />
|
||||
<meta property="article:modified_time" content="2020-11-11T08:29:43-08:00" /><meta property="og:site_name" content="Kustomize" />
|
||||
<meta itemprop="name" content="Go plugin example">
|
||||
<meta itemprop="description" content="Go plugin example
|
||||
">
|
||||
<meta itemprop="dateModified" content="2020-11-04T11:15:40-08:00" />
|
||||
<meta itemprop="wordCount" content="1057">
|
||||
<meta itemprop="dateModified" content="2020-11-11T08:29:43-08:00" />
|
||||
<meta itemprop="wordCount" content="3">
|
||||
|
||||
|
||||
|
||||
@@ -310,236 +310,6 @@
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">Command Line Options</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmd">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/build/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">build</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdbuild">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/cfg/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">cfg</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdcfg">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/create/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">create</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdcreate">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/edit/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">edit</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdedit">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/fn/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">fn</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdfn">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/help/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">help</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdhelp">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/install-completion/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">install-completion</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdinstall-completion">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/live/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">live</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdlive">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/version/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">version</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdversion">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/components/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">Kustomize Components</a>
|
||||
@@ -593,34 +363,6 @@
|
||||
|
||||
|
||||
|
||||
<nav id="TableOfContents">
|
||||
<ul>
|
||||
<li>
|
||||
<ul>
|
||||
<li></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#make-a-place-to-work">Make a place to work</a></li>
|
||||
<li><a href="#install-kustomize">Install kustomize</a></li>
|
||||
<li><a href="#make-a-home-for-plugins">Make a home for plugins</a>
|
||||
<ul>
|
||||
<li><a href="#what-apiversion-and-kind">What apiVersion and kind</a></li>
|
||||
<li><a href="#define-the-plugins-home-dir">Define the plugin’s home dir</a></li>
|
||||
<li><a href="#download-the-sopsencodedsecrets-plugin">Download the SopsEncodedSecrets plugin</a></li>
|
||||
<li><a href="#try-the-plugins-own-test">Try the plugin’s own test</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#create-a-kustomization">Create a kustomization</a>
|
||||
<ul>
|
||||
<li><a href="#assure-you-have-an-encryption-tool-installed">Assure you have an encryption tool installed</a></li>
|
||||
<li><a href="#install-sops">Install <code>sops</code></a></li>
|
||||
<li><a href="#create-data-encrypted-with-your-private-key">Create data encrypted with your private key</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#build-your-app-using-the-plugin">Build your app, using the plugin</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
@@ -667,240 +409,11 @@
|
||||
<h1>Go plugin example</h1>
|
||||
<div class="lead">Go plugin example</div>
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/guides/extending_kustomize/gopluginguidedexample" />
|
||||
<h1 id="go-plugin-guided-example-for-linux">Go Plugin Guided Example for Linux</h1>
|
||||
<p>This is a (no reading allowed!) 60 second copy/paste guided
|
||||
example.</p>
|
||||
<p>Full plugin docs <a href="README.md">here</a>.
|
||||
Be sure to read the <a href="goPluginCaveats.md">Go plugin caveats</a>.</p>
|
||||
<p>This demo uses a Go plugin, <code>SopsEncodedSecrets</code>,
|
||||
that lives in the <a href="https://github.com/monopole/sopsencodedsecrets">sopsencodedsecrets repository</a>.
|
||||
This is an inprocess <a href="https://golang.org/pkg/plugin">Go plugin</a>, not an
|
||||
sub-process exec plugin that happens to be written
|
||||
in Go (which is another option for Go authors).</p>
|
||||
<p>This is a guide to try it without damaging your
|
||||
current setup.</p>
|
||||
<h4 id="requirements">requirements</h4>
|
||||
<ul>
|
||||
<li>linux, git, curl, Go 1.13</li>
|
||||
</ul>
|
||||
<p>For encryption</p>
|
||||
<ul>
|
||||
<li>gpg</li>
|
||||
</ul>
|
||||
<p>Or</p>
|
||||
<ul>
|
||||
<li>Google cloud (gcloud) install</li>
|
||||
<li>a Google account with KMS permission</li>
|
||||
</ul>
|
||||
<h2 id="make-a-place-to-work">Make a place to work</h2>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#8f5902;font-style:italic"># Keeping these separate to avoid cluttering the DEMO dir.</span>
|
||||
<span style="color:#000">DEMO</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#204a87;font-weight:bold">$(</span>mktemp -d<span style="color:#204a87;font-weight:bold">)</span>
|
||||
<span style="color:#000">tmpGoPath</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#204a87;font-weight:bold">$(</span>mktemp -d<span style="color:#204a87;font-weight:bold">)</span>
|
||||
</code></pre></div><h2 id="install-kustomize">Install kustomize</h2>
|
||||
<p>Need v3.0.0 for what follows, and you must <em>compile</em>
|
||||
it (not download the binary from the release page):</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#000">GOPATH</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#000">$tmpGoPath</span> go install sigs.k8s.io/kustomize/kustomize
|
||||
</code></pre></div><h2 id="make-a-home-for-plugins">Make a home for plugins</h2>
|
||||
<p>A kustomize plugin is fully determined by
|
||||
its configuration file and source code.</p>
|
||||
<p>Kustomize plugin configuration files are formatted
|
||||
as kubernetes resource objects, meaning
|
||||
<code>apiVersion</code>, <code>kind</code> and <code>metadata</code> are <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/#required-fields">required
|
||||
fields</a> in these config files.</p>
|
||||
<p>The kustomize program reads the config file
|
||||
(because the config file name appears in the
|
||||
<code>generators</code> or <code>transformers</code> field in the
|
||||
kustomization file), then locates the Go plugin’s
|
||||
object code at the following location:</p>
|
||||
<blockquote>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#000">$XDG_CONFIG_HOME</span>/kustomize/plugin/<span style="color:#000">$apiVersion</span>/<span style="color:#000">$lKind</span>/<span style="color:#000">$kind</span>.so
|
||||
</code></pre></div></blockquote>
|
||||
<p>where <code>lKind</code> holds the lowercased kind. The
|
||||
plugin is then loaded and fed its config, and the
|
||||
plugin’s output becomes part of the overall
|
||||
<code>kustomize build</code> process.</p>
|
||||
<p>The same plugin might be used multiple times in
|
||||
one kustomize build, but with different config
|
||||
files. Also, kustomize might customize config
|
||||
data before sending it to the plugin, for whatever
|
||||
reason. For these reasons, kustomize owns the
|
||||
mapping between plugins and config data; it’s not
|
||||
left to plugins to find their own config.</p>
|
||||
<p>This demo will house the plugin it uses at the
|
||||
ephemeral directory</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#000">PLUGIN_ROOT</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#000">$DEMO</span>/kustomize/plugin
|
||||
</code></pre></div><p>and ephemerally set <code>XDG_CONFIG_HOME</code> on a command
|
||||
line below.</p>
|
||||
<h3 id="what-apiversion-and-kind">What apiVersion and kind</h3>
|
||||
<p>At this stage in the development of kustomize
|
||||
plugins, plugin code doesn’t know or care what
|
||||
<code>apiVersion</code> or <code>kind</code> appears in the config file
|
||||
sent to it.</p>
|
||||
<p>The plugin could check these fields, but it’s the
|
||||
remaining fields that provide actual configuration
|
||||
data, and at this point the successful parsing of
|
||||
these other fields are the only thing that matters
|
||||
to a plugin.</p>
|
||||
<p>This demo uses a plugin called <em>SopsEncodedSecrets</em>,
|
||||
and it lives in the <a href="https://github.com/monopole/sopsencodedsecrets">SopsEncodedSecrets repository</a>.</p>
|
||||
<p>Somewhat arbitrarily, we’ll chose to install
|
||||
this plugin with</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#000">apiVersion</span><span style="color:#ce5c00;font-weight:bold">=</span>mygenerators
|
||||
<span style="color:#000">kind</span><span style="color:#ce5c00;font-weight:bold">=</span>SopsEncodedSecrets
|
||||
</code></pre></div><h3 id="define-the-plugins-home-dir">Define the plugin’s home dir</h3>
|
||||
<p>By convention, the ultimate home of the plugin
|
||||
code and supplemental data, tests, documentation,
|
||||
etc. is the lowercase form of its kind.</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#000">lKind</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#204a87;font-weight:bold">$(</span><span style="color:#204a87">echo</span> <span style="color:#000">$kind</span> <span style="color:#000;font-weight:bold">|</span> awk <span style="color:#4e9a06">'{print tolower($0)}'</span><span style="color:#204a87;font-weight:bold">)</span>
|
||||
</code></pre></div><h3 id="download-the-sopsencodedsecrets-plugin">Download the SopsEncodedSecrets plugin</h3>
|
||||
<p>In this case, the repo name matches the lowercase
|
||||
kind already, so we just clone the repo and get
|
||||
the proper directory name automatically:</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">mkdir -p <span style="color:#000">$PLUGIN_ROOT</span>/<span style="color:#4e9a06">${</span><span style="color:#000">apiVersion</span><span style="color:#4e9a06">}</span>
|
||||
<span style="color:#204a87">cd</span> <span style="color:#000">$PLUGIN_ROOT</span>/<span style="color:#4e9a06">${</span><span style="color:#000">apiVersion</span><span style="color:#4e9a06">}</span>
|
||||
git clone git@github.com:monopole/sopsencodedsecrets.git
|
||||
</code></pre></div><p>Remember this directory:</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#000">MY_PLUGIN_DIR</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#000">$PLUGIN_ROOT</span>/<span style="color:#4e9a06">${</span><span style="color:#000">apiVersion</span><span style="color:#4e9a06">}</span>/<span style="color:#4e9a06">${</span><span style="color:#000">lKind</span><span style="color:#4e9a06">}</span>
|
||||
</code></pre></div><h3 id="try-the-plugins-own-test">Try the plugin’s own test</h3>
|
||||
<p>Plugins may come with their own tests.
|
||||
This one does, and it hopefully passes:</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#204a87">cd</span> <span style="color:#000">$MY_PLUGIN_DIR</span>
|
||||
go <span style="color:#204a87">test</span> SopsEncodedSecrets_test.go
|
||||
</code></pre></div><p>Build the object code for use by kustomize:</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#204a87">cd</span> <span style="color:#000">$MY_PLUGIN_DIR</span>
|
||||
<span style="color:#000">GOPATH</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#000">$tmpGoPath</span> go build -buildmode plugin -o <span style="color:#4e9a06">${</span><span style="color:#000">kind</span><span style="color:#4e9a06">}</span>.so <span style="color:#4e9a06">${</span><span style="color:#000">kind</span><span style="color:#4e9a06">}</span>.go
|
||||
</code></pre></div><p>This step may succeed, but kustomize might
|
||||
ultimately fail to load the plugin because of
|
||||
dependency <a href="/docs/plugins/README.md#caveats">skew</a>.</p>
|
||||
<p>On load failure</p>
|
||||
<ul>
|
||||
<li>
|
||||
<p>be sure to build the plugin with the same
|
||||
version of Go (<em>go1.13</em>) on the same <code>$GOOS</code>
|
||||
(<em>linux</em>) and <code>$GOARCH</code> (<em>amd64</em>) used to build
|
||||
the kustomize being <a href="#install-kustomize">used in this demo</a>.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>change the plugin’s dependencies in its <code>go.mod</code>
|
||||
to match the versions used by kustomize (check
|
||||
kustomize’s <code>go.mod</code> used in its tagged commit).</p>
|
||||
</li>
|
||||
</ul>
|
||||
<p>Lacking tools and metadata to allow this to be
|
||||
automated, there won’t be a Go plugin ecosystem.</p>
|
||||
<p>Kustomize has adopted a Go plugin architecture as
|
||||
to ease accept new generators and transformers
|
||||
(just write a plugin), and to be sure that native
|
||||
operations (also constructed and tested as
|
||||
plugins) are compartmentalized, orderable and
|
||||
reusable instead of bizarrely woven throughout the
|
||||
code as a individual special cases.</p>
|
||||
<h2 id="create-a-kustomization">Create a kustomization</h2>
|
||||
<p>Make a kustomization directory to
|
||||
hold all your config:</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#000">MYAPP</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#000">$DEMO</span>/myapp
|
||||
mkdir -p <span style="color:#000">$MYAPP</span>
|
||||
</code></pre></div><p>Make a config file for the SopsEncodedSecrets plugin.</p>
|
||||
<p>Its <code>apiVersion</code> and <code>kind</code> allow the plugin to be
|
||||
found:</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">cat <span style="color:#4e9a06"><<EOF >$MYAPP/secGenerator.yaml
|
||||
</span><span style="color:#4e9a06">apiVersion: ${apiVersion}
|
||||
</span><span style="color:#4e9a06">kind: ${kind}
|
||||
</span><span style="color:#4e9a06">metadata:
|
||||
</span><span style="color:#4e9a06"> name: mySecretGenerator
|
||||
</span><span style="color:#4e9a06">name: forbiddenValues
|
||||
</span><span style="color:#4e9a06">namespace: production
|
||||
</span><span style="color:#4e9a06">file: myEncryptedData.yaml
|
||||
</span><span style="color:#4e9a06">keys:
|
||||
</span><span style="color:#4e9a06">- ROCKET
|
||||
</span><span style="color:#4e9a06">- CAR
|
||||
</span><span style="color:#4e9a06">EOF</span>
|
||||
</code></pre></div><p>This plugin expects to find more data in
|
||||
<code>myEncryptedData.yaml</code>; we’ll get to that shortly.</p>
|
||||
<p>Make a kustomization file referencing the plugin
|
||||
config:</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">cat <span style="color:#4e9a06"><<EOF >$MYAPP/kustomization.yaml
|
||||
</span><span style="color:#4e9a06">commonLabels:
|
||||
</span><span style="color:#4e9a06"> app: hello
|
||||
</span><span style="color:#4e9a06">generators:
|
||||
</span><span style="color:#4e9a06">- secGenerator.yaml
|
||||
</span><span style="color:#4e9a06">EOF</span>
|
||||
</code></pre></div><p>Now generate the real encrypted data.</p>
|
||||
<h3 id="assure-you-have-an-encryption-tool-installed">Assure you have an encryption tool installed</h3>
|
||||
<p>We’re going to use <a href="https://github.com/mozilla/sops">sops</a> to encode a file. Choose either GPG or Google Cloud KMS as the secret provider to continue.</p>
|
||||
<h4 id="gpg">GPG</h4>
|
||||
<p>Try this:</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">gpg --list-keys
|
||||
</code></pre></div><p>If it returns a list, presumably you’ve already created keys. If not, try import test keys from sops for dev.</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">curl https://raw.githubusercontent.com/mozilla/sops/master/pgp/sops_functional_tests_key.asc <span style="color:#000;font-weight:bold">|</span> gpg --import
|
||||
<span style="color:#000">SOPS_PGP_FP</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#4e9a06">"1022470DE3F0BC54BC6AB62DE05550BC07FB1A0A"</span>
|
||||
</code></pre></div><h4 id="google-cloude-kms">Google Cloude KMS</h4>
|
||||
<p>Try this:</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">gcloud kms keys list --location global --keyring sops
|
||||
</code></pre></div><p>If it succeeds, presumably you’ve already created keys and placed them in a keyring called sops. If not, do this:</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">gcloud kms keyrings create sops --location global
|
||||
gcloud kms keys create sops-key --location global <span style="color:#4e9a06">\
|
||||
</span><span style="color:#4e9a06"></span> --keyring sops --purpose encryption
|
||||
</code></pre></div><p>Extract your keyLocation for use below:</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#000">keyLocation</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#204a87;font-weight:bold">$(</span><span style="color:#4e9a06">\
|
||||
</span><span style="color:#4e9a06"></span> gcloud kms keys list --location global --keyring sops <span style="color:#000;font-weight:bold">|</span><span style="color:#4e9a06">\
|
||||
</span><span style="color:#4e9a06"></span> grep GOOGLE <span style="color:#000;font-weight:bold">|</span> cut -d <span style="color:#4e9a06">" "</span> -f1<span style="color:#204a87;font-weight:bold">)</span>
|
||||
<span style="color:#204a87">echo</span> <span style="color:#000">$keyLocation</span>
|
||||
</code></pre></div><h3 id="install-sops">Install <code>sops</code></h3>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#000">GOPATH</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#000">$tmpGoPath</span> go install go.mozilla.org/sops/cmd/sops
|
||||
</code></pre></div><h3 id="create-data-encrypted-with-your-private-key">Create data encrypted with your private key</h3>
|
||||
<p>Create raw data to encrypt:</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">cat <span style="color:#4e9a06"><<EOF >$MYAPP/myClearData.yaml
|
||||
</span><span style="color:#4e9a06">VEGETABLE: carrot
|
||||
</span><span style="color:#4e9a06">ROCKET: saturn-v
|
||||
</span><span style="color:#4e9a06">FRUIT: apple
|
||||
</span><span style="color:#4e9a06">CAR: dymaxion
|
||||
</span><span style="color:#4e9a06">EOF</span>
|
||||
</code></pre></div><p>Encrypt the data into file the plugin wants to read:</p>
|
||||
<p>With PGP</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#000">$tmpGoPath</span>/bin/sops --encrypt <span style="color:#4e9a06">\
|
||||
</span><span style="color:#4e9a06"></span> --pgp <span style="color:#000">$SOPS_PGP_FP</span> <span style="color:#4e9a06">\
|
||||
</span><span style="color:#4e9a06"></span> <span style="color:#000">$MYAPP</span>/myClearData.yaml ><span style="color:#000">$MYAPP</span>/myEncryptedData.yaml
|
||||
</code></pre></div><p>Or GCP KMS</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#000">$tmpGoPath</span>/bin/sops --encrypt <span style="color:#4e9a06">\
|
||||
</span><span style="color:#4e9a06"></span> --gcp-kms <span style="color:#000">$keyLocation</span> <span style="color:#4e9a06">\
|
||||
</span><span style="color:#4e9a06"></span> <span style="color:#000">$MYAPP</span>/myClearData.yaml ><span style="color:#000">$MYAPP</span>/myEncryptedData.yaml
|
||||
</code></pre></div><p>Review the files</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">tree <span style="color:#000">$DEMO</span>
|
||||
</code></pre></div><p>This should look something like:</p>
|
||||
<blockquote>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">/tmp/tmp.0kIE9VclPt
|
||||
├── kustomize
|
||||
│ └── plugin
|
||||
│ └── mygenerators
|
||||
│ └── sopsencodedsecrets
|
||||
│ ├── go.mod
|
||||
│ ├── go.sum
|
||||
│ ├── LICENSE
|
||||
│ ├── README.md
|
||||
│ ├── SopsEncodedSecrets.go
|
||||
│ ├── SopsEncodedSecrets.so
|
||||
│ └── SopsEncodedSecrets_test.go
|
||||
└── myapp
|
||||
├── kustomization.yaml
|
||||
├── myClearData.yaml
|
||||
├── myEncryptedData.yaml
|
||||
└── secGenerator.yaml
|
||||
</code></pre></div></blockquote>
|
||||
<h2 id="build-your-app-using-the-plugin">Build your app, using the plugin</h2>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#000">XDG_CONFIG_HOME</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#000">$DEMO</span> <span style="color:#000">$tmpGoPath</span>/bin/kustomize build --enable_alpha_plugins <span style="color:#000">$MYAPP</span>
|
||||
</code></pre></div><p>This should emit a kubernetes secret, with
|
||||
encrypted data for the names <code>ROCKET</code> and <code>CAR</code>.</p>
|
||||
<p>Above, if you had set</p>
|
||||
<blockquote>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#000">PLUGIN_ROOT</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#000">$HOME</span>/.config/kustomize/plugin
|
||||
</code></pre></div></blockquote>
|
||||
<p>there would be no need to use <code>XDG_CONFIG_HOME</code> in the
|
||||
<em>kustomize</em> command above.</p>
|
||||
<p>Moved to <a href="https://github.com/kubernetes-sigs/cli-experimental">https://github.com/kubernetes-sigs/cli-experimental</a></p>
|
||||
|
||||
|
||||
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 4, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/0834e152b203ffeccfbbf1ddd3c1f49debdac341">Redirect kustomize docs to the new unified site. (0834e152)</a>
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 11, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/71b763888cad614abb44b3086e291fe72d601080">Remove duplicate kustomize docs content (71b76388)</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -305,236 +305,6 @@
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">Command Line Options</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmd">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/build/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">build</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdbuild">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/cfg/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">cfg</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdcfg">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/create/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">create</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdcreate">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/edit/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">edit</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdedit">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/fn/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">fn</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdfn">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/help/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">help</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdhelp">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/install-completion/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">install-completion</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdinstall-completion">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/live/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">live</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdlive">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/cmd/version/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">version</a>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="collapse " id="kustomizeguidescmdversion">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="td-sidebar-nav__section pr-md-3">
|
||||
<li class="td-sidebar-nav__section-title">
|
||||
<a href="/kustomize/guides/components/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">Kustomize Components</a>
|
||||
@@ -588,25 +358,6 @@
|
||||
|
||||
|
||||
|
||||
<nav id="TableOfContents">
|
||||
<ul>
|
||||
<li><a href="#specification-in-kustomizationyaml">Specification in <code>kustomization.yaml</code></a></li>
|
||||
<li><a href="#configuration">Configuration</a></li>
|
||||
<li><a href="#placement">Placement</a></li>
|
||||
<li><a href="#execution">Execution</a>
|
||||
<ul>
|
||||
<li></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#authoring">Authoring</a>
|
||||
<ul>
|
||||
<li><a href="#exec-plugins">Exec plugins</a></li>
|
||||
<li><a href="#go-plugins">Go plugins</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
@@ -643,274 +394,8 @@
|
||||
<h1>Kustomize Plugins</h1>
|
||||
<div class="lead">Kustomize plugins guide</div>
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/guides/extending_kustomize/plugins" />
|
||||
<p>Kustomize offers a plugin framework allowing people to write their own resource <em>generators</em>
|
||||
and <em>transformers</em>.</p>
|
||||
<p>Write a plugin when changing <a href="https://github.com/kubernetes-sigs/kustomize/tree/master/examples/generatorOptions.md">generator options</a>
|
||||
or <a href="https://github.com/kubernetes-sigs/kustomize/tree/master/examples/transformerconfigs">transformer configs</a> doesn’t meet your needs.</p>
|
||||
<ul>
|
||||
<li>
|
||||
<p>A <em>generator</em> plugin could be a helm chart
|
||||
inflator, or a plugin that emits all the
|
||||
components (deployment, service, scaler,
|
||||
ingress, etc.) needed by someone’s <a href="https://12factor.net">12-factor</a>
|
||||
application, based on a smaller number of free
|
||||
variables.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>A <em>transformer</em> plugin might perform special
|
||||
container command line edits, or any other
|
||||
transformation beyond those provided by the
|
||||
builtin (<code>namePrefix</code>, <code>commonLabels</code>, etc.)
|
||||
transformers.</p>
|
||||
</li>
|
||||
</ul>
|
||||
<h2 id="specification-in-kustomizationyaml">Specification in <code>kustomization.yaml</code></h2>
|
||||
<p>Start by adding a <code>generators</code> and/or <code>transformers</code>
|
||||
field to your kustomization.</p>
|
||||
<p>Each field accepts a string list:</p>
|
||||
<blockquote>
|
||||
<pre><code>generators:
|
||||
- relative/path/to/some/file.yaml
|
||||
- relative/path/to/some/kustomization
|
||||
- /absolute/path/to/some/kustomization
|
||||
- https://github.com/org/repo/some/kustomization
|
||||
<p>Moved to <a href="https://github.com/kubernetes-sigs/cli-experimental">https://github.com/kubernetes-sigs/cli-experimental</a></p>
|
||||
|
||||
transformers:
|
||||
- {as above}
|
||||
</code></pre></blockquote>
|
||||
<p>The value of each entry in a <code>generators</code> or
|
||||
<code>transformers</code> list must be a relative path to a
|
||||
YAML file, or a path or URL to a <a href="/kustomize/api-reference/glossary#kustomization">kustomization</a>.
|
||||
This is the same format as demanded by the
|
||||
<code>resources</code> field.</p>
|
||||
<p>YAML files are read from disk directly. Paths or
|
||||
URLs leading to kustomizations trigger an
|
||||
in-process kustomization run. Each of the
|
||||
resulting objects is now further interpreted by
|
||||
kustomize as a <em>plugin configuration</em> object.</p>
|
||||
<h2 id="configuration">Configuration</h2>
|
||||
<p>A kustomization file could have the following lines:</p>
|
||||
<pre><code>generators:
|
||||
- chartInflator.yaml
|
||||
</code></pre><p>Given this, the kustomization process would expect
|
||||
to find a file called <code>chartInflator.yaml</code> in the
|
||||
kustomization <a href="/kustomize/api-reference/glossary#kustomization-root">root</a>.</p>
|
||||
<p>This is the plugin’s configuration file;
|
||||
it contains a YAML configuration object.</p>
|
||||
<p>The file <code>chartInflator.yaml</code> could contain:</p>
|
||||
<pre><code>apiVersion: someteam.example.com/v1
|
||||
kind: ChartInflator
|
||||
metadata:
|
||||
name: notImportantHere
|
||||
chartName: minecraft
|
||||
</code></pre><p><strong>The <code>apiVersion</code> and <code>kind</code> fields are
|
||||
used to locate the plugin.</strong></p>
|
||||
<p>Thus, these fields are required. They are also
|
||||
required because a kustomize plugin configuration
|
||||
object is also a <a href="/kustomize/api-reference/glossary#kubernetes-style-object">k8s object</a>.</p>
|
||||
<p>To get the plugin ready to generate or transform,
|
||||
it is given the entire contents of the
|
||||
configuration file.</p>
|
||||
<p>For more examples of plugin configuration YAML,
|
||||
browse the unit tests below the <a href="https://github.com/kubernetes-sigs/kustomize/tree/master/plugin/builtin">plugins</a> root,
|
||||
e.g. the tests for <a href="https://github.com/kubernetes-sigs/kustomize/tree/master/plugin/someteam.example.com/v1/chartinflator/ChartInflator_test.go">ChartInflator</a> or
|
||||
<a href="https://github.com/kubernetes-sigs/kustomize/tree/master/plugin/builtin/prefixsuffixtransformer/PrefixSuffixTransformer_test.go">NameTransformer</a>.</p>
|
||||
<h2 id="placement">Placement</h2>
|
||||
<p>Each plugin gets its own dedicated directory named</p>
|
||||
<pre><code>$XDG_CONFIG_HOME/kustomize/plugin
|
||||
/${apiVersion}/LOWERCASE(${kind})
|
||||
</code></pre><p>The default value of <a href="https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html"><code>XDG_CONFIG_HOME</code></a> is
|
||||
<code>$HOME/.config</code>.</p>
|
||||
<p>The one-plugin-per-directory requirement eases
|
||||
creation of a plugin bundle (source, tests, plugin
|
||||
data files, etc.) for sharing.</p>
|
||||
<p>In the case of a <a href="#go-plugins">Go plugin</a>, it also
|
||||
allows one to provide a <code>go.mod</code> file for the
|
||||
single plugin, easing resolution of package
|
||||
version dependency skew.</p>
|
||||
<p>When loading, kustomize will first look for an
|
||||
<em>executable</em> file called</p>
|
||||
<pre><code>$XDG_CONFIG_HOME/kustomize/plugin
|
||||
/${apiVersion}/LOWERCASE(${kind})/${kind}
|
||||
</code></pre><p>If this file is not found or is not executable,
|
||||
kustomize will look for a file called <code>${kind}.so</code>
|
||||
in the same directory and attempt to load it as a
|
||||
<a href="#go-plugins">Go plugin</a>.</p>
|
||||
<p>If both checks fail, the plugin load fails the overall
|
||||
<code>kustomize build</code>.</p>
|
||||
<h2 id="execution">Execution</h2>
|
||||
<p>Plugins are only used during a run of the
|
||||
<code>kustomize build</code> command.</p>
|
||||
<p>Generator plugins are run after processing the
|
||||
<code>resources</code> field (which itself can be viewed as a
|
||||
generator, simply reading objects from disk).</p>
|
||||
<p>The full set of resources is then passed into the
|
||||
transformation pipeline, wherein builtin
|
||||
transformations like <code>namePrefix</code> and
|
||||
<code>commonLabel</code> are applied (if they were specified
|
||||
in the kustomization file), followed by the
|
||||
user-specified transformers in the <code>transformers</code>
|
||||
field.</p>
|
||||
<p>The order specified in the <code>transformers</code> field is
|
||||
respected, as transformers cannot be expected to
|
||||
be commutative.</p>
|
||||
<h4 id="no-security">No Security</h4>
|
||||
<p>Kustomize plugins do not run in any kind of
|
||||
kustomize-provided sandbox. There’s no notion
|
||||
of <em>“plugin security”</em>.</p>
|
||||
<p>A <code>kustomize build</code> that tries to use plugins but
|
||||
omits the flag</p>
|
||||
<blockquote>
|
||||
<p><code>--enable_alpha_plugins</code></p>
|
||||
</blockquote>
|
||||
<p>will not load plugins and will fail with a
|
||||
warning about plugin use.</p>
|
||||
<p>The use of this flag is an opt-in acknowledging
|
||||
the unstable (alpha) plugin API, the absence of
|
||||
plugin provenance, and the fact that a plugin
|
||||
is not part of kustomize.</p>
|
||||
<p>To be clear, some kustomize plugin downloaded
|
||||
from the internet might wonderfully transform
|
||||
k8s config in a desired manner, while also
|
||||
quietly doing anything the user could do to the
|
||||
system running <code>kustomize build</code>.</p>
|
||||
<h2 id="authoring">Authoring</h2>
|
||||
<p>There are two kinds of plugins, <a href="#exec-plugins">exec</a> and <a href="#go-plugins">Go</a>.</p>
|
||||
<h3 id="exec-plugins">Exec plugins</h3>
|
||||
<p>A <em>exec plugin</em> is any executable that accepts a
|
||||
single argument on its command line - the name of
|
||||
a YAML file containing its configuration (the file name
|
||||
provided in the kustomization file).</p>
|
||||
<blockquote>
|
||||
<p>TODO: restrictions on plugin to allow the <em>same exec
|
||||
plugin</em> to be targeted by both the
|
||||
<code>generators</code> and <code>transformers</code> fields.</p>
|
||||
<ul>
|
||||
<li>first arg could be the fixed string
|
||||
<code>generate</code> or <code>transform</code>,
|
||||
(the name of the configuration file moves to
|
||||
the 2nd arg), or</li>
|
||||
<li>or by default an exec plugin behaves as a tranformer
|
||||
unless a flag <code>-g</code> is provided, switching the
|
||||
exec plugin to behave as a generator.</li>
|
||||
</ul>
|
||||
</blockquote>
|
||||
<h4 id="examples">Examples</h4>
|
||||
<ul>
|
||||
<li><a href="https://github.com/kubernetes-sigs/kustomize/tree/master/plugin/someteam.example.com/v1/chartinflator">helm chart inflator</a> - A generator that inflates a helm chart.</li>
|
||||
<li><a href="https://github.com/kubernetes-sigs/kustomize/tree/master/plugin/someteam.example.com/v1/bashedconfigmap">bashed config map</a> - Super simple configMap generation from bash.</li>
|
||||
<li><a href="https://github.com/kubernetes-sigs/kustomize/tree/master/plugin/someteam.example.com/v1/sedtransformer">sed transformer</a> - Define your unstructured edits using a
|
||||
plugin like this one.</li>
|
||||
<li><a href="https://github.com/kubernetes-sigs/kustomize/tree/master/plugin/someteam.example.com/v1/gogetter">hashicorp go-getter</a> - Download kustomize layes and build it to generate resources</li>
|
||||
</ul>
|
||||
<p>A generator plugin accepts nothing on <code>stdin</code>, but emits
|
||||
generated resources to <code>stdout</code>.</p>
|
||||
<p>A transformer plugin accepts resource YAML on <code>stdin</code>,
|
||||
and emits those resources, presumably transformed, to
|
||||
<code>stdout</code>.</p>
|
||||
<p>kustomize uses an exec plugin adapter to provide
|
||||
marshalled resources on <code>stdin</code> and capture
|
||||
<code>stdout</code> for further processing.</p>
|
||||
<h4 id="generator-options">Generator Options</h4>
|
||||
<p>A generator exec plugin can adjust the generator options for the resources it emits by setting one of the following internal annotations.</p>
|
||||
<blockquote>
|
||||
<p>NOTE: These annotations are local to kustomize and will not be included in the final output.</p>
|
||||
</blockquote>
|
||||
<p><strong><code>kustomize.config.k8s.io/needs-hash</code></strong></p>
|
||||
<p>Resources can be marked as needing to be processed by the internal hash transformer by including the <code>needs-hash</code> annotation. When set valid values for the annotation are <code>"true"</code> and <code>"false"</code> which respectively enable or disable hash suffixing for the resource. Omitting the annotation is equivalent to setting the value <code>"false"</code>.</p>
|
||||
<p>Hashes are determined as follows:</p>
|
||||
<ul>
|
||||
<li>For <code>ConfigMap</code> resources, hashes are based on the values of the <code>name</code>, <code>data</code>, and <code>binaryData</code> fields.</li>
|
||||
<li>For <code>Secret</code> resources, hashes are based on the values of the <code>name</code>, <code>type</code>, <code>data</code>, and <code>stringData</code> fields.</li>
|
||||
<li>For any other object type, hashes are based on the entire object content (i.e. all fields).</li>
|
||||
</ul>
|
||||
<p>Example:</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">ConfigMap</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">cm-test</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">annotations</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kustomize.config.k8s.io/needs-hash</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">"true"</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">data</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">foo</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">bar</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><p><strong><code>kustomize.config.k8s.io/behavior</code></strong></p>
|
||||
<p>The <code>behavior</code> 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.</p>
|
||||
<p>Example:</p>
|
||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">ConfigMap</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">cm-test</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">annotations</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kustomize.config.k8s.io/behavior</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">"merge"</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">data</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">foo</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">bar</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||
</span></code></pre></div><h3 id="go-plugins">Go plugins</h3>
|
||||
<p>Be sure to read <a href="goplugincaveats/">Go plugin caveats</a>.</p>
|
||||
<p>A <code>.go</code> file can be a <a href="https://golang.org/pkg/plugin/">Go plugin</a> if it declares
|
||||
‘main’ as it’s package, and exports a symbol to
|
||||
which useful functions are attached.</p>
|
||||
<p>It can further be used as a <em>kustomize</em> plugin if
|
||||
the symbol is named ‘KustomizePlugin’ and the
|
||||
attached functions implement the <code>Configurable</code>,
|
||||
<code>Generator</code> and <code>Transformer</code> interfaces.</p>
|
||||
<p>A Go plugin for kustomize looks like this:</p>
|
||||
<blockquote>
|
||||
<pre><code>package main
|
||||
|
||||
import (
|
||||
"sigs.k8s.io/kustomize/api/resmap"
|
||||
...
|
||||
)
|
||||
|
||||
type plugin struct {...}
|
||||
|
||||
var KustomizePlugin plugin
|
||||
|
||||
func (p *plugin) Config(
|
||||
h *resmap.PluginHelpers,
|
||||
c []byte) error {...}
|
||||
|
||||
func (p *plugin) Generate() (resmap.ResMap, error) {...}
|
||||
|
||||
func (p *plugin) Transform(m resmap.ResMap) error {...}
|
||||
</code></pre></blockquote>
|
||||
<p>Use of the identifiers <code>plugin</code>, <code>KustomizePlugin</code>
|
||||
and implementation of the method signature
|
||||
<code>Config</code> is required.</p>
|
||||
<p>Implementing the <code>Generator</code> or <code>Transformer</code>
|
||||
method allows (respectively) the plugin’s config
|
||||
file to be added to the <code>generators</code> or
|
||||
<code>transformers</code> field in the kustomization file.
|
||||
Do one or the other or both as desired.</p>
|
||||
<h4 id="examples-1">Examples</h4>
|
||||
<ul>
|
||||
<li><a href="https://github.com/kubernetes-sigs/kustomize/tree/master/plugin/someteam.example.com/v1/someservicegenerator">service generator</a> - generate a service from a name and port argument.</li>
|
||||
<li><a href="https://github.com/kubernetes-sigs/kustomize/tree/master/plugin/someteam.example.com/v1/stringprefixer">string prefixer</a> - uses the value in <code>metadata/name</code> as the prefix.
|
||||
This particular example exists to show how a plugin can
|
||||
transform the behavior of a plugin. See the
|
||||
<code>TestTransformedTransformers</code> test in the <code>target</code> package.</li>
|
||||
<li><a href="https://github.com/kubernetes-sigs/kustomize/tree/master/plugin/someteam.example.com/v1/dateprefixer">date prefixer</a> - prefix the current date to resource names, a simple
|
||||
example used to modify the string prefixer plugin just mentioned.</li>
|
||||
<li><a href="https://github.com/kubernetes-sigs/kustomize/tree/master/plugin/someteam.example.com/v1/secretsfromdatabase">secret generator</a> - generate secrets from a toy database.</li>
|
||||
<li><a href="https://github.com/monopole/sopsencodedsecrets">sops encoded secrets</a> - a more complex secret generator that converts SOPS files into Kubernetes Secrets</li>
|
||||
<li><a href="https://github.com/omninonsense/kustomize-sopsgenerator">SOPSGenerator</a> - another generator that decrypts SOPS files into Secrets</li>
|
||||
<li><a href="https://github.com/kubernetes-sigs/kustomize/tree/master/plugin/builtin">All the builtin plugins</a>.
|
||||
User authored plugins are
|
||||
on the same footing as builtin operations.</li>
|
||||
</ul>
|
||||
<p>A Go plugin can be both a generator and a
|
||||
transformer. The <code>Generate</code> method will run along
|
||||
with all the other generators before the
|
||||
<code>Transform</code> method runs.</p>
|
||||
<p>Here’s a build command that sensibly assumes the
|
||||
plugin source code sits in the directory where
|
||||
kustomize expects to find <code>.so</code> files:</p>
|
||||
<pre><code>d=$XDG_CONFIG_HOME/kustomize/plugin\
|
||||
/${apiVersion}/LOWERCASE(${kind})
|
||||
|
||||
go build -buildmode plugin \
|
||||
-o $d/${kind}.so $d/${kind}.go
|
||||
</code></pre>
|
||||
<div class="section-index">
|
||||
|
||||
|
||||
@@ -927,8 +412,6 @@ go build -buildmode plugin \
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="entry">
|
||||
<h5>
|
||||
<a href="/kustomize/guides/plugins/builtins/">Builtin Plugins</a>
|
||||
@@ -938,14 +421,6 @@ go build -buildmode plugin \
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="entry">
|
||||
<h5>
|
||||
<a href="/kustomize/guides/plugins/execpluginguidedexample/">Exec plugin on linux</a>
|
||||
@@ -955,8 +430,6 @@ go build -buildmode plugin \
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="entry">
|
||||
<h5>
|
||||
<a href="/kustomize/guides/plugins/goplugincaveats/">Go plugin Caveats</a>
|
||||
@@ -976,20 +449,12 @@ go build -buildmode plugin \
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 4, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/0834e152b203ffeccfbbf1ddd3c1f49debdac341">Redirect kustomize docs to the new unified site. (0834e152)</a>
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 11, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/71b763888cad614abb44b3086e291fe72d601080">Remove duplicate kustomize docs content (71b76388)</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -370,12 +370,8 @@
|
||||
<h1>Binaries</h1>
|
||||
<div class="lead">Install Kustomize by downloading precompiled binaries.</div>
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/installation/kustomize/binaries/" />
|
||||
<p>Binaries at various versions for linux, MacOs and Windows are published on the <a href="https://github.com/kubernetes-sigs/kustomize/releases">releases page</a>.</p>
|
||||
<p>The following <a href="https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh">script</a> detects your OS and downloads the appropriate kustomize binary to your
|
||||
current working directory.</p>
|
||||
<pre><code>curl -s "https://raw.githubusercontent.com/\
|
||||
kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash
|
||||
</code></pre>
|
||||
<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">
|
||||
|
||||
|
||||
@@ -398,7 +394,7 @@ kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash
|
||||
|
||||
|
||||
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 4, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/0834e152b203ffeccfbbf1ddd3c1f49debdac341">Redirect kustomize docs to the new unified site. (0834e152)</a>
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 11, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/71b763888cad614abb44b3086e291fe72d601080">Remove duplicate kustomize docs content (71b76388)</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -370,13 +370,7 @@
|
||||
<h1>Chocolatey</h1>
|
||||
<div class="lead">Install Kustomize for Windows using Chocolatey</div>
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/installation/kustomize/chocolatey/" />
|
||||
<pre><code>choco install kustomize
|
||||
</code></pre><p>For support on the chocolatey package
|
||||
and prior releases, see:</p>
|
||||
<ul>
|
||||
<li><a href="https://chocolatey.org/packages/kustomize">Choco Package</a></li>
|
||||
<li><a href="https://github.com/kenmaglio/choco-kustomize">Package Source</a></li>
|
||||
</ul>
|
||||
<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">
|
||||
|
||||
@@ -400,7 +394,7 @@ and prior releases, see:</p>
|
||||
|
||||
|
||||
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 4, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/0834e152b203ffeccfbbf1ddd3c1f49debdac341">Redirect kustomize docs to the new unified site. (0834e152)</a>
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 11, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/71b763888cad614abb44b3086e291fe72d601080">Remove duplicate kustomize docs content (71b76388)</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -370,11 +370,8 @@
|
||||
<h1>Homebrew / MacPorts</h1>
|
||||
<div class="lead">Install Kustomize for MacOS using Homebrew or MacPorts</div>
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/installation/kustomize/homebrew/" />
|
||||
<p>For <a href="https://brew.sh">Homebrew</a> users:</p>
|
||||
<pre><code>brew install kustomize
|
||||
</code></pre><p>For <a href="https://www.macports.org">MacPorts</a> users:</p>
|
||||
<pre><code>sudo port install kustomize
|
||||
</code></pre>
|
||||
<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">
|
||||
|
||||
|
||||
@@ -397,7 +394,7 @@
|
||||
|
||||
|
||||
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 4, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/0834e152b203ffeccfbbf1ddd3c1f49debdac341">Redirect kustomize docs to the new unified site. (0834e152)</a>
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 11, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/71b763888cad614abb44b3086e291fe72d601080">Remove duplicate kustomize docs content (71b76388)</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -357,6 +357,7 @@
|
||||
<h1>Installation</h1>
|
||||
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/installation/kustomize/" />
|
||||
<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">
|
||||
|
||||
@@ -408,7 +409,7 @@
|
||||
|
||||
|
||||
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 4, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/0834e152b203ffeccfbbf1ddd3c1f49debdac341">Redirect kustomize docs to the new unified site. (0834e152)</a>
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 11, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/71b763888cad614abb44b3086e291fe72d601080">Remove duplicate kustomize docs content (71b76388)</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -334,13 +334,6 @@
|
||||
|
||||
|
||||
|
||||
<nav id="TableOfContents">
|
||||
<ul>
|
||||
<li><a href="#install-the-kustomize-cli-from-source-without-cloning-the-repo">Install the kustomize CLI from source without cloning the repo</a></li>
|
||||
<li><a href="#install-the-kustomize-cli-from-local-source-with-cloning-the-repo">Install the kustomize CLI from local source with cloning the repo</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
@@ -377,30 +370,8 @@
|
||||
<h1>Go Source</h1>
|
||||
<div class="lead">Install Kustomize from the Go source code</div>
|
||||
<meta http-equiv="refresh" content="0; url=https://kubectl.docs.kubernetes.io/installation/kustomize/source/" />
|
||||
<p>Requires <a href="https://golang.org">Go</a> to be installed.</p>
|
||||
<h2 id="install-the-kustomize-cli-from-source-without-cloning-the-repo">Install the kustomize CLI from source without cloning the repo</h2>
|
||||
<pre><code>GOBIN=$(pwd)/ GO111MODULE=on go get sigs.k8s.io/kustomize/kustomize/v3
|
||||
</code></pre><h2 id="install-the-kustomize-cli-from-local-source-with-cloning-the-repo">Install the kustomize CLI from local source with cloning the repo</h2>
|
||||
<pre><code># Need go 1.13 or higher
|
||||
unset GOPATH
|
||||
# see https://golang.org/doc/go1.13#modules
|
||||
unset GO111MODULES
|
||||
<p>Moved to <a href="https://github.com/kubernetes-sigs/cli-experimental">https://github.com/kubernetes-sigs/cli-experimental</a></p>
|
||||
|
||||
# clone the repo
|
||||
git clone git@github.com:kubernetes-sigs/kustomize.git
|
||||
# get into the repo root
|
||||
cd kustomize
|
||||
|
||||
# Optionally checkout a particular tag if you don't
|
||||
# want to build at head
|
||||
git checkout kustomize/v3.2.3
|
||||
|
||||
# build the binary
|
||||
(cd kustomize; go install .)
|
||||
|
||||
# run it
|
||||
~/go/bin/kustomize version
|
||||
</code></pre>
|
||||
<div class="section-index">
|
||||
|
||||
|
||||
@@ -423,7 +394,7 @@ git checkout kustomize/v3.2.3
|
||||
|
||||
|
||||
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 4, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/0834e152b203ffeccfbbf1ddd3c1f49debdac341">Redirect kustomize docs to the new unified site. (0834e152)</a>
|
||||
<div class="text-muted mt-5 pt-3 border-top">Last modified November 11, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/71b763888cad614abb44b3086e291fe72d601080">Remove duplicate kustomize docs content (71b76388)</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<sitemap>
|
||||
<loc>https://kubernetes-sigs.github.io/kustomize/en/sitemap.xml</loc>
|
||||
|
||||
<lastmod>2020-11-04T11:15:40-08:00</lastmod>
|
||||
<lastmod>2020-11-11T08:29:43-08:00</lastmod>
|
||||
|
||||
</sitemap>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user