Skip to content

Instantly share code, notes, and snippets.

Avatar
🐢
it's pronounced turtle cuddle

Robert Van Voorhees voor

🐢
it's pronounced turtle cuddle
View GitHub Profile
@voor
voor / kapp-config.yaml
Last active Sep 24, 2021
Kapp Config for Cluster API
View kapp-config.yaml
apiVersion: kapp.k14s.io/v1alpha1
kind: Config
minimumRequiredVersion: 0.34.0
# This section makes sure that kapp passes on the necessary kapp labels to derived Cluster API resources.
# Missing this section would mean that follow-on objects created by Cluster API would be missed in kapp inspect calls.
templateRules:
- resourceMatchers:
- apiVersionKindMatcher: {apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3, kind: AWSMachineTemplate}
@voor
voor / current-version.yml
Created Sep 14, 2021
Simple gist that shows the flexibility of ytt and how it can achieve an intended outcome without impacting other commands.
View current-version.yml
#@data/values
#! Note that the file coming out of imgpkg would NOT contain the data/values, you would need to access it with the following CLI command:
#! ytt -f package-template.yaml --data-values-file current-version.yml
#! The data/values is just included here so it'll work properly on ytt playground.
---
apiVersion: imgpkg.carvel.dev/v1alpha1
bundle:
image: harbor.example.com/imgpkg/charts/secretgen-controller@sha256:e302989e79a3c4f17eb5d101ba1c773ea717cde49b5606ffc6424429d70fb8d0
tag: v0.5.0
@voor
voor / imgpkg-chart.sh
Created Aug 12, 2021
Create an imgpkg bundle from a helm chart with any additional overlays you might need.
View imgpkg-chart.sh
#!/usr/bin/env sh
set -eux -o pipefail
CHART_NAME=gitlab-runner
SERVICE_FOLDER=${CHART_NAME}
CHART_REPO_NAME=gitlab
CHART_REPO_URL=https://charts.gitlab.io
HARBOR_REPO=your.repo.example.com
View join.yaml
#@ load("@ytt:data", "data")
RUNNER_TAG_LIST: #@ ",".join([x.strip() for x in data.values.tags])
View merge-by-key-only.yaml
#@ load("@ytt:overlay", "overlay")
#@ load("@ytt:data", "data")
#@ def key_overlay():
metadata:
name: simple-app
#@ end
#@overlay/match by=overlay.subset(key_overlay()),when="1+"
---
View config.yaml
#@ load("@ytt:base64", "base64")
#@ load("@ytt:yaml", "yaml")
#@ def server_config():
_: |
c.ServerApp.token = '<generated>'
alkdalsdkasdlaskdasldaskdsl
blah blah blah
#@ end
View file1.yaml
#@ load("@ytt:base64", "base64")
#@ load("@ytt:data", "data")
#@ load("@ytt:yaml", "yaml")
#! rego
#@ load("policy.rego.lib.txt", "rego_auth_policy")
---
apiVersion: v1
data:
@voor
voor / file1.yml
Created Feb 21, 2021
Both input files becoming a single yaml document
View file1.yml
---
id: 1
meta:
ebook: .epub
@voor
voor / android_package_names.sh
Last active Feb 15, 2021
Remove Samsung Bloatware or other Malware baked into Android phones
View android_package_names.sh
#!/bin/bash
set -euo pipefail
# Remove whitespace
function remWS {
if [ -z "${1}" ]; then
cat | tr -d '[:space:]'
else
echo "${1}" | tr -d '[:space:]'
View 00-values.yaml
#@data/values
---
aws:
vpc:
name: staging
clusters:
- name: hey