Skip to content

Instantly share code, notes, and snippets.

View mbigras's full-sized avatar

Max Bigras mbigras

View GitHub Profile
$ /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
@mbigras
mbigras / Default (OSX).sublime-keymap
Last active March 3, 2023 17:07
Sublime Text settings
// 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"
}
},
@mbigras
mbigras / README.md
Last active June 22, 2023 20:12
Describe how Kustomize plugins work with examples
@mbigras
mbigras / nested-code-blocks.md
Last active June 26, 2023 20:26
Nested code blocks in technical documentation

Nested code blocks

Nested code blocks clarify technical documentation but rendering them with markdown is tricky.

Overview

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:

@mbigras
mbigras / Cat in Go.md
Last active August 29, 2023 05:51
This gist contains the cat Unix command—written in Go.

Cat in Go

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).

Getting started

The following procedure shows how to build and run cat.