From 428e980eb56909d0aee2afeb1bc95279aacd936f Mon Sep 17 00:00:00 2001 From: Jeffrey Regan Date: Fri, 13 Apr 2018 11:17:10 -0700 Subject: [PATCH] Example kustomization file. --- docs/kustomize.yaml | 116 ++++++++++++++++++++++++++++++++++++++------ 1 file changed, 101 insertions(+), 15 deletions(-) diff --git a/docs/kustomize.yaml b/docs/kustomize.yaml index 8db80898b..1caee88ba 100644 --- a/docs/kustomize.yaml +++ b/docs/kustomize.yaml @@ -1,15 +1,101 @@ -namePrefix: some-prefix -# Labels to add to all objects and selectors. -# These labels would also be used to form the selector for apply --prune -# Named differently than “labels” to avoid confusion with metadata for this object -labelsToAdd: - app: helloworld -annotationsToAdd: - note: This is an example annotation -resources: [] -#- service.yaml -#- ../some-dir/ -# There could also be configmaps in Base, which would make these overlays -configMapGenerator: [] -# There could be secrets in Base, if just using a fork/rebase workflow -secretGenerator: [] +# ---------------------------------------------------- +# Example kustomize.yaml content. +# +# This file declares the customization provided by +# the kustomize program. +# +# Since customization is, by definition, _custom_, +# there are no sensible default values for the fields +# in this file. +# +# The field values used below are merely examples, not +# to be copied literally. The values won't work if +# they happen to be references to external files that +# don't exist. +# +# In practice, fields with no value should simply be +# omitted from kustomize.yaml to reduce the content +# visible in configuration reviews. +# ---------------------------------------------------- + + +# Value of this field is prepended to the +# names of all resources, e.g. a deployment named +# "wordpress" becomes "alices-wordpress". +namePrefix: alices- + +# Labels to add to all resources and selectors. +commonLabels: + someName: someValue + owner: alice + app: bingo + +# Annotations (non-identifying metadata) +# to add to all resources. Like labels, +# these are key value pairs. +commonAnnotations: + oncallPager: 800-555-1212 + +# Each entry in this list must resolve to an existing +# resource definition in YAML. These are the resource +# files that kustomize reads, modifies and emits as a +# YAML string, with resources separated by document +# markers ("---"). +resources: +- some-service.yaml +- ../some-dir/some-deployment.yaml + +# Each entry in this list results in the creation of +# one ConfigMap resource (it's a generator of n maps). +# The example below creates a ConfigMap with the +# names and contents of the given files. +configMapGenerator: +- name: myJavaServerProps + files: + - application.properties + - more.properties + +# Each entry in this list results in the creation of +# one Secret resource (it's a generator of n secrets). +# A command can do anything to get a secret, +# e.g. prompt the user directly, start a webserver to +# initate an oauth dance, etc. +secretGenerator: +- name: app-tls + commands: + tls.crt: "cat secret/tls.cert" + tls.key: "cat secret/tls.key" + type: "kubernetes.io/tls" + +# Each entry in this list should resolve to a directory +# containing a kustomization file, else the +# customization fails. +# +# The presence of this field means this file (the file +# you a reading) is an _overlay_ that further +# customizes information coming from these _bases_. +# +# Typical use case: a dev, staging and production +# environment that are mostly identical but differing +# crucial ways (image tags, a few server arguments, +# etc. that differ from the common base). +bases: +- ../../base + +# Each entry in this list should resolve to +# a partial or complete resource definition file. +# +# The names in these (possibly partial) resource files +# must match names already loaded via the `resources` +# field or via `resources` loaded transitively via the +# `bases` entries. These entries are used to _patch_ +# (modify) the known resources. +# +# 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. +patches: +- service_port_8888.yaml +- deployment_increase_replicas.yaml +- deployment_increase_memory.yaml