Skip to content

Commit

Permalink
manifest becomes kustomization
Browse files Browse the repository at this point in the history
  • Loading branch information
monopole committed Apr 13, 2018
1 parent 5d2605a commit 1aee18a
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 51 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SHELL := /bin/bash -euo pipefail

config_file_name = Kube-manifest.yaml
config_file_name = kustomize.yaml
example_config = docs/$(config_file_name)

.PHONY: all
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[demo]: demos/README.md
[imageBase]: docs/base.jpg
[imageOverlay]: docs/overlay.jpg
[manifest]: docs/glossary.md#manifest
[kustomization]: docs/glossary.md#kustomization
[overlay]: docs/glossary.md#overlay
[resources]: docs/glossary.md#resource
[workflows]: docs/workflows.md
Expand All @@ -29,7 +29,7 @@ go get k8s.io/kubectl/cmd/kustomize

#### 1) Make a base

A [base] configuration is a [manifest] listing a set of
A [base] configuration is a [kustomization] file listing a set of
k8s [resources] - deployments, services, configmaps,
secrets that serve some common purpose.

Expand Down
22 changes: 11 additions & 11 deletions demos/helloWorld.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[hello]: https://github.com/monopole/hello
[instance]: ../docs/glossary.md#instance
[instances]: ../docs/glossary.md#instance
[manifest]: ../docs/glossary.md#manifest
[kustomization]: ../docs/glossary.md#kustomization
[original]: https://github.com/kinflate/example-hello
[overlay]: ../docs/glossary.md#overlay
[overlays]: ../docs/glossary.md#overlay
Expand Down Expand Up @@ -74,11 +74,11 @@ cluster:
to instantiate the _hello_ service. `kubectl`
would only recognize the resource files.

## The Base Manifest
## The Base Kustomization

The `base` directory has a [manifest] file:
The `base` directory has a [kustomization] file:

<!-- @showManifest @test -->
<!-- @showKustomization @test -->
```
BASE=$DEMO_HOME/base
more $BASE/kustomize.yaml
Expand Down Expand Up @@ -125,12 +125,12 @@ mkdir -p $OVERLAYS/staging
mkdir -p $OVERLAYS/production
```

#### Staging Manifest
#### Staging Kustomization

In the `staging` directory, make a manifest
In the `staging` directory, make a kustomization
defining a new name prefix, and some different labels.

<!-- @makeStagingManifest @test -->
<!-- @makeStagingKustomization @test -->
```
cat <<'EOF' >$OVERLAYS/staging/kustomize.yaml
kustomizationName: makes-staging-hello
Expand Down Expand Up @@ -167,12 +167,12 @@ data:
EOF
```

#### Production Manifest
#### Production Kustomization

In the production directory, make a manifest
In the production directory, make a kustomization
with a different name prefix and labels.

<!-- @makeProductionManifest @test -->
<!-- @makeProductionKustomization @test -->
```
cat <<EOF >$OVERLAYS/production/kustomize.yaml
kustomizationName: makes-production-tuthello
Expand Down Expand Up @@ -215,7 +215,7 @@ EOF
- a _base_ directory - a slightly customized clone
of the original configuration, and

- an _overlays_ directory, containing the manifests
- an _overlays_ directory, containing the kustomizations
and patches required to create distinct _staging_
and _production_ instances in a cluster.

Expand Down
54 changes: 27 additions & 27 deletions docs/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
[bases]: #base
[bespoke]: #bespoke-configuration
[kustomize]: #kustomize
[manifest]: #manifest
[kustomization]: #kustomization
[off-the-shelf]: #off-the-shelf
[overlay]: #overlay
[overlays]: #overlay
Expand Down Expand Up @@ -73,7 +73,7 @@ be able to [apply] a base to a cluster directly.

## bespoke configuration

A _bespoke_ configuration is a [manifest] and some
A _bespoke_ configuration is a [kustomization] and some
[resources] created and maintained internally by some
organization for their own purposes.

Expand Down Expand Up @@ -120,28 +120,14 @@ an [overlay] to a [base].
> deployments with a large number of replicas and higher
> cpu and memory requests.
## kustomization

## kustomize

_kustomize_ is a command line tool supporting template-free
customization of declarative configuration targetted to
k8s.

_Targetted to k8s means_ that kustomize may need some
limited understanding of API resources, k8s concepts
like names, labels, namespaces, etc. and the semantics
of resource patching.

kustomize is an implementation of [DAM].

## manifest

A _manifest_ is a file called `kustomize.yaml` that
A _kustomization_ is a file called `kustomize.yaml` that
describes a configuration consumable by [kustomize].

Here's an [example](Kube-manifest.yaml).
Here's an [example](kustomize.yaml).

A manifest contains fields falling into these categories:
A kustomization contains fields falling into these categories:

* Immediate customization instructions -
_nameprefix_, _labelprefix_, etc.
Expand All @@ -153,12 +139,26 @@ A manifest contains fields falling into these categories:
resources defined in a [base]
(only meaningful in an [overlay]).
* [bases] - path to a directory containing
a [manifest] (only meaningful in an [overlay]).
a [kustomization] (only meaningful in an [overlay]).
* (_TBD_) Standard k8s API kind-version fields.

## kustomize

_kustomize_ is a command line tool supporting template-free
customization of declarative configuration targetted to
k8s.

_Targetted to k8s means_ that kustomize may need some
limited understanding of API resources, k8s concepts
like names, labels, namespaces, etc. and the semantics
of resource patching.

kustomize is an implementation of [DAM].


## off-the-shelf configuration

An _off-the-shelf_ configuration is a manifest and
An _off-the-shelf_ configuration is a kustomization and
resources intentionally published somewhere for others
to use.

Expand All @@ -184,8 +184,8 @@ own [overlays] to do further customization.
An _overlay_ is a [target] that modifies (and thus
depends on) another target.

The [manifest] in an overlay refers to (via file path,
URI or other method) to _some other manifest_, known as
The [kustomization] in an overlay refers to (via file path,
URI or other method) to _some other kustomization_, known as
its [base].

An overlay is unusable without its base.
Expand All @@ -207,7 +207,7 @@ One configures the cluser like this:
> kubectl apply -f -
> ```
Usage of the base is implicit (the overlay's manifest
Usage of the base is implicit (the overlay's kustomization
points to the base).

An overlay may act as a base to another overlay.
Expand All @@ -225,7 +225,7 @@ A _patch_ is a partially defined k8s resource with a
name that must match a resource already known per
traversal rules built into [kustomize].

_Patch_ is a field in the manifest, distinct from
_Patch_ is a field in the kustomization, distinct from
resources, because a patch file looks like a resource
file, but has different semantics. A patch depends on
(modifies) a resource, whereas a resourse has no
Expand All @@ -252,7 +252,7 @@ The _target_ is the argument to `build`, e.g.:
`$target` must be a path to a directory that
immediately contains a file called
`kustomize.yaml` (i.e. a [manifest]).
`kustomize.yaml` (i.e. a [kustomization]).

The target contains, or refers to, all the information
needed to create customized resources to send to the
Expand Down
6 changes: 1 addition & 5 deletions docs/Kube-manifest.yaml → docs/kustomize.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# This is a generated example; do not edit. Rebuild with 'make docs'.

apiVersion: manifest.k8s.io/v1alpha1
kind: Manifest
metadata:
name: helloworld
kustomizationName: helloworld
description: helloworld does useful stuff.
namePrefix: some-prefix
# Labels to add to all objects and selectors.
Expand Down
10 changes: 5 additions & 5 deletions docs/workflows.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[base]: glossary.md#base
[fork]: https://guides.github.com/activities/forking/
[instances]: glossary.md#instance
[manifest]: glossary.md#manifest
[kustomization]: glossary.md#kustomization
[off-the-shelf]: glossary.md#off-the-shelf
[overlays]: glossary.md#overlay
[patch]: glossary.md#patch
Expand Down Expand Up @@ -39,8 +39,8 @@ control repositories owned by others.
> mkdir -p ~/ldap/base
> ```
In this directory, create and commit a [manifest]
and a set of [resources].
In this directory, create and commit a [kustomization]
file and a set of [resources].

#### 3) create [overlays]

Expand All @@ -49,8 +49,8 @@ and a set of [resources].
> mkdir -p ~/ldap/overlays/production
> ```
Each of these directories needs a [manifest]
and one or more [patches].
Each of these directories needs a [kustomization]
file and one or more [patches].

The _staging_ directory might get a patch
that turns on an experiment flag in a configmap.
Expand Down

0 comments on commit 1aee18a

Please sign in to comment.