Skip to content

Instantly share code, notes, and snippets.

View joshgav's full-sized avatar

Josh Gavant joshgav

View GitHub Profile
@joshgav
joshgav / platforms_contributors.md
Last active March 27, 2023 18:18
Contributors to Platforms whitepaper

Appendix: Contributors

Thank you to the many members of CNCF WG Platforms who have contributed feedback and insights on this paper, in particular the following:

  • Abby Bangser
  • Abhinav Mishra
  • Abi Noda
  • Alex Chesser
  • Brad Bazemore
@joshgav
joshgav / multitenancy_clusters.md
Last active May 16, 2022 14:54
Blog post on multitenancy with clusters

Clusters for all cloud tenants

A decision which faces many large organizations as they adopt cloud architecture is how to provide isolated spaces within the same environments and clusters for various teams and purposes. For example, marketing and sales applications may need to be isolated from an organization's customer-facing applications; and development teams building any app usually require extra spaces for tests and verification.

Namespace as unit of tenancy

To address this need, many organizations have started to use namespaces as units of isolation and tenancy, a pattern previously described by Google and Kubernetes contributors. But namespace-scoped isolation is often insufficient because some concerns are managed at cluster scope. In particular, installing new resource types (CRDs) is a cluster-scoped activity; and today independent te

@joshgav
joshgav / envsubst.sh
Last active August 10, 2020 19:49
A bash equivalent of gettext's envsubst executable.
# envsubst invokes all shell substitutions in a file
# use by first sourcing this file, e.g. `source envsubst.sh` or `. envsubst.sh`,
# and then invoking `envsubst` on STDIN or a specific file
# it should only be invoked on trusted or scrubbed files to avoid injection attacks
function envsubst {
local infile=${1}
if [[ "${SUPPRESS_ENVSUBST_WARNING}" != "1" ]]; then
>&2 echo "[WARNING] the envsubst function should only be used on trusted files because it is vulnerable to injection attacks"
fi
@joshgav
joshgav / install.sh
Created May 28, 2019 16:14
mac app installers
# install tmux
TMUX_VER=2.9a
LIBEVENT_VER=2.1.10
PREFIX=${HOME}/.local
# get tmux and libevent
curl -LO https://github.com/tmux/tmux/releases/download/${TMUX_VER}/${TMUX_VER}.tar.gz
curl -LO https://github.com/libevent/libevent/releases/download/release-${LIBEVENT_VER}-stable/libevent-${LIBEVENT_VER}-stable.tar.gz
tar -xzf "./tmux-${TMUX_VER}.tar.gz"
@joshgav
joshgav / github_practices.md
Created March 8, 2019 21:49
GitHub open project best practices

Open source on GitHub: what and why

  • Participants: users, contributors and maintainers.
    • We're looking for users.
    • README.md and CONTRIBUTING.md
  • Why open source?
    • Collect better feedback on our software from users.
    • Gather direct insights into how users use our software.
    • Developers are empowered to:
      1. fix problems and answer questions themselves and maybe even blog about it
  1. open detailed and actionable issues for us
@joshgav
joshgav / create_file_share.sh
Created February 13, 2019 23:34
Create an SMB file share in Azure Storage and mount in a Linux system.
#! /usr/bin/env bash
# requires cifs-utils - `apt install cifs-utils`
group_name=joshgav-oryx-test-group
group_location=westus2
storage_account_name=joshgavoryxsharetest
storage_account_group_name=${group_name}
storage_account_location=${group_location}
share_name=intermediate
@joshgav
joshgav / create_azure_web.sh
Last active February 1, 2019 23:48
Create an Azure Web App
app_name=your-unique-name
app_repo_url=https://github.com/your-name-here/your-repo-here
location=westus
# choose from: `az webapp list-runtimes --linux`
runtime='NODE|10.10'
env_vars=(
APPINSIGHTS_INSTRUMENTATIONKEY=af4b1113-bc85-41d0-be2b-343c3f178b7b
YOUR_ENV_VAR=test
)
@joshgav
joshgav / azurerm.sh
Last active September 27, 2018 19:06
Azure resource management helper shell scripts
declare prefix="azuregosdkjuglaptop"
# cleanup_groups requests deletion of groups with names starting with `prefix`
# it returns after request acceptance, i.e. it does not wait for deletion to actually finish
# `prefix` string "___": first letters of names of groups to delete
function cleanup_groups () {
declare prefix=${1:-"___"} # default to unlikely value for safety
# set up jmespath query
jmespath_query="[? starts_with(name, \`${prefix}\`)].name"