The following examples illustrate how Kustomize plugins work.
The following examples illustrate how Kustomize plugins work--that is, illustrate Kustomize Kubernetes Resource Model (KRM) Functions Specification with the following examples:
$ /usr/local/bin/kustomize version | |
{Version:kustomize/v4.5.7 GitCommit:56d82a8378dfc8dc3b3b1085e5a6e67b82966bd7 BuildDate:2022-08-02T16:28:01Z GoOs:darwin GoArch:amd64} | |
$ /usr/local/bin/kustomize build https://gist.github.com/bc7947cb727d7f9217e7862d961a1ffd.git | |
apiVersion: v1 | |
data: | |
hello: world | |
kind: ConfigMap | |
metadata: | |
name: hello-dc6fm46dhm | |
$ /usr/local/bin/kustomize build git@gist.github.com:bc7947cb727d7f9217e7862d961a1ffd.git |
kind: Kustomization | |
apiVersion: kustomize.config.k8s.io/v1beta1 | |
generators: | |
- | | |
kind: ConfigMapGenerator | |
apiVersion: builtin | |
metadata: | |
name: hello | |
literals: | |
- hello=world |
$ cd $(mktemp -d) | |
$ git clone git@github.com:kubernetes-sigs/kustomize.git | |
Cloning into 'kustomize'... | |
remote: Enumerating objects: 80611, done. | |
remote: Counting objects: 100% (100/100), done. | |
remote: Compressing objects: 100% (65/65), done. | |
remote: Total 80611 (delta 52), reused 75 (delta 35), pack-reused 80511 | |
Receiving objects: 100% (80611/80611), 91.58 MiB | 1.98 MiB/s, done. | |
Resolving deltas: 100% (47788/47788), done. | |
$ cd kustomize |
Build mbigras/blueapp:v1 Docker image. | |
cat <<'Dockerfile' | docker build -t mbigras/blueapp:v1 - | |
# syntax=docker/dockerfile:1.3-labs see https://www.docker.com/blog/introduction-to-heredocs-in-dockerfiles/ | |
FROM python | |
RUN pip install flask gunicorn | |
RUN cat <<App >app.py | |
import os | |
from flask import Flask, jsonify |
kind: ConfigMap | |
apiVersion: v1 | |
metadata: | |
name: myconfig | |
data: | |
HELLO: world | |
SPAM: eggs | |
--- | |
apiVersion: v1 | |
kind: Pod |
// Note: Put this file at the "$HOME/Library/Application Support/Sublime Text/Packages/User/Default (OSX).sublime-keymap" path. | |
[ | |
{ | |
"keys": ["super+."], | |
"command": "edit_settings", | |
"args": { | |
"base_file": "${packages}/Default/Default ($platform).sublime-keymap", | |
"default": "[\n\t$0\n]\n" | |
} | |
}, |
The following examples illustrate how Kustomize plugins work.
The following examples illustrate how Kustomize plugins work--that is, illustrate Kustomize Kubernetes Resource Model (KRM) Functions Specification with the following examples:
Nested code blocks clarify technical documentation but rendering them with markdown is tricky.
Google Cloud Platform (GCP) technical documentation is formatted well enough; however, emulating that format with markdown is tricky.
The following are the main features about GCP documentation that I like:
This gist contains the cat Unix command—written in Go.
The following Go program concatenates files passed as command-line arguments. If you don't pass any command-line arguments, then cat reads from stdin (it's the cat Unix utility).
The following procedure shows how to build and run cat.