Skip to content

Instantly share code, notes, and snippets.

☘️
O'Internets

Cory O'Daniel coryodaniel

☘️
O'Internets
Block or report user

Report or block coryodaniel

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@coryodaniel
coryodaniel / block.tf
Last active Nov 26, 2019
Optional dynamic blocks in terraform
View block.tf
variable "gpu" {
description = "Enable and configure node GPUs"
type = object({
type = string
count = number
})
default = null
# or...
View resume.yaml
kind: Resume
apiVersion: fancy.coryodaniel.com/v1alpha1
metadata:
name: cory-odaniel
namespace: engineers
labels: {}
annotations: {}
spec: {}
status: WIP
@coryodaniel
coryodaniel / kubeflow.txt
Created Nov 20, 2019
kubeflow.lol.installer
View kubeflow.txt
customresourcedefinition.apiextensions.k8s.io/applications.app.k8s.io created
serviceaccount/application-controller-service-account created
clusterrole.rbac.authorization.k8s.io/application-controller-cluster-role created
clusterrolebinding.rbac.authorization.k8s.io/application-controller-cluster-role-binding created
configmap/application-controller-parameters created
service/application-controller-service created
statefulset.apps/application-controller-stateful-set created
application.app.k8s.io/kubeflow created
customresourcedefinition.apiextensions.k8s.io/certificaterequests.cert-manager.io created
customresourcedefinition.apiextensions.k8s.io/certificates.cert-manager.io created
@coryodaniel
coryodaniel / generate_name.tf
Created Nov 11, 2019
Make terraform respect "generate_name" kubernetes_*
View generate_name.tf
provider "kubernetes" {
config_context = "docker-desktop"
}
resource "kubernetes_job" "demo" {
metadata {
generate_name = "demo-"
}
spec {
template {
View namespace-destroyer.sh
NAMESPACE=monitoring
kubectl proxy &
kubectl get namespace $NAMESPACE -o json |jq '.spec = {"finalizers":[]}' >temp.json
curl -k -H "Content-Type: application/json" -X PUT --data-binary @temp.json 127.0.0.1:8001/api/v1/namespaces/$NAMESPACE/finalize
@coryodaniel
coryodaniel / patch.json
Created Oct 14, 2019
Kustomize JSON Patch container args
View patch.json
---
[
{
"op": "add",
"path": "/spec/template/spec/containers/0/args/-",
"value": "--dns01-self-check-nameservers"
},
{
"op": "add",
"path": "/spec/template/spec/containers/0/args/-",
View deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
app: my-deployment
name: my-deployment
spec:
replicas: 1
selector:
View gist:630fb2c6c21c3347e1646a19508bb11c
./overlays/prod/kustomization.yaml
./overlays/staging/kustomization.yaml
./pasta
./base/deployment.yaml
./base/kustomization.yaml
@coryodaniel
coryodaniel / kustomize.vars.pasta
Last active Oct 7, 2019
Kustomize w/ per-overlay input vars (via pasta.rb)
View kustomize.vars.pasta
eyIuL292ZXJsYXlzL3Byb2Qva3VzdG9taXphdGlvbi55YW1sIjoibmFtZXNwYWNlOiBwcm9kXG5iYXNlczpcbiAgLSAuLi8uLi9iYXNlXG5jb25maWdNYXBHZW5lcmF0b3I6XG4gIC0gbmFtZTogbXktY29uZmlnXG4gICAgYmVoYXZpb3I6IHJlcGxhY2VcbiAgICBsaXRlcmFsczpcbiAgICAgIC0gTUlYX0VOVj1wcm9kXG4iLCIuL292ZXJsYXlzL3N0YWdpbmcva3VzdG9taXphdGlvbi55YW1sIjoibmFtZXNwYWNlOiBzdGFnaW5nXG5iYXNlczpcbiAgLSAuLi8uLi9iYXNlXG4iLCIuL3Bhc3RhIjoiIyEgL3Vzci9iaW4vZW52IHJ1YnlcblxucmVxdWlyZSAnb3B0cGFyc2UnXG5yZXF1aXJlICdqc29uJ1xucmVxdWlyZSBcImJhc2U2NFwiXG5yZXF1aXJlICdmaWxldXRpbHMnXG5cbiRvdXQgPSBcIi90bXAvbG9sXCJcbm9wdGlvbnMgPSB7fVxuT3B0aW9uUGFyc2VyLm5ldyBkbyB8b3B0c3xcbiAgb3B0cy5iYW5uZXIgPSBcIlVzYWdlOiBwYXN0YS5yYiBbb3B0aW9uc11cIlxuXG4gIG9wdHMub24oXCItdlwiLCBcIi0tW25vLV12ZXJib3NlXCIsIFwiUnVuIHZlcmJvc2VseVwiKSBkbyB8dnxcbiAgICBvcHRpb25zWzp2ZXJib3NlXSA9IHZcbiAgZW5kXG5cbiAgb3B0cy5vbihcIi1wU1RSXCIsIFwiLS1wYXN0ZT1TVFJcIiwgXCJTdHJpbmcgdG8gcGFzdGVcIikgZG8gfHB8XG4gICAgb3B0aW9uc1s6cGFzdGVdID0gcFxuICBlbmRcblxuICBvcHRzLm9uKFwiLWNQQVRIXCIsIFwiLS1jb3B5PVBBVEhcIiwgXCJQYXRoIHRvIGNvcHlcIikgZG8gfGN8XG4gICAg
@coryodaniel
coryodaniel / pasta.rb
Last active Oct 7, 2019
pasta - copy and paste filesystems
View pasta.rb
#! /usr/bin/env ruby
require 'optparse'
require 'json'
require "base64"
require 'fileutils'
$out = "/tmp/lol"
options = {}
OptionParser.new do |opts|
You can’t perform that action at this time.