This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func CreateKubernetesClient() (*kubernetes.Clientset, error) { | |
// Try in-cluster config | |
config, err := rest.InClusterConfig() | |
if err != nil { | |
// If there's an error, it means we're not in-cluster, try out-of-cluster config | |
kubeconfig := os.Getenv("KUBECONFIG") // Path to a kubeconfig. Only required if out-of-cluster | |
if kubeconfig == "" { | |
kubeconfig = os.Getenv("HOME") + "/.kube/config" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -x | |
REGION=$1 | |
ZONE=$REGION-a | |
gcloud compute routers create router-$REGION --network=default --region=$REGION | |
gcloud compute routers nats create nat-$REGION \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: apps/v1 | |
kind: DaemonSet | |
metadata: | |
name: customizations | |
labels: | |
app: customizations | |
spec: | |
selector: | |
matchLabels: | |
app: customizations |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: iperf3-server | |
spec: | |
replicas: 1 | |
revisionHistoryLimit: 10 | |
selector: | |
matchLabels: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: iperf3-server | |
spec: | |
replicas: 1 | |
revisionHistoryLimit: 10 | |
selector: | |
matchLabels: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"node": { | |
"nodeName": "gke-standard-cluster-1-default-pool-8fd0527d-sv9q", | |
"systemContainers": [ | |
{ | |
"name": "runtime", | |
"startTime": "2019-11-26T00:38:22Z", | |
"cpu": { | |
"time": "2019-11-26T00:45:50Z", | |
"usageNanoCores": 28894845, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function prune_old_rows() { | |
var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
var sheet = ss.getSheetByName('Form Submissions'); | |
var rows = sheet.getDataRange(); | |
var numRows = rows.getNumRows(); | |
var values = rows.getValues(); | |
// assumes that there is a column "Added" as the first column |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -x | |
openstack project create upgrade-demo-1 | |
openstack project create upgrade-demo-2 | |
openstack project create upgrade-demo-3 | |
INPUT=$1 | |
while read line; do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
BRICK=$1 | |
setfattr -n trusted.glusterfs.volume-id -v 0x$(grep volume-id /var/lib/glusterd/vols/$BRICK/info | cut -d= -f2 | sed 's/-//g') /srv/glusterfs/$BRICK |