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
kind: PersistentVolumeClaim | |
apiVersion: v1 | |
metadata: | |
name: ebs-test-claim | |
spec: | |
accessModes: | |
- ReadWriteOnce | |
resources: | |
requests: | |
storage: 1Mi |
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
sudo apt-get purge golang* | |
sudo rm -rf /usr/lib/go-1.6/ /usr/lib/go-1.6/src/ /usr/lib/go-1.6/src/runtime/ /usr/lib/go-1.6/src/runtime/race | |
curl -O https://storage.googleapis.com/golang/go1.11.1.linux-amd64.tar.gz | |
sudo tar -C /usr/local -xzf go1.11.1.linux-amd64.tar.gz | |
mkdir -p ~/go; echo "export GOPATH=$HOME/go" >> ~/.bashrc | |
echo "export PATH=$PATH:$HOME/go/bin:/usr/local/go/bin" >> ~/.bashrc | |
source ~/.bashrc | |
go get github.com/go-sql-driver/mysql |
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
kubectl exec -n kube-system $(kubectl get pods -n kube-system | grep dns | awk '{print $1}') -- kill -SIGUSR1 1 |
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
curl -ks -u "oauthadmin:$(kubectl get secrets -n kube-system platform-oidc-credentials -o yaml | grep OAUTH2_CLIENT_REGISTRATION_SECRET | awk '{print $2}' | (base64 -D && echo "\n") | head -n 1 | sed 's/\\n//g')" -X GET https://mycluster.icp:9443/oidc/endpoint/OP/registration |
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/sh | |
masterNode='x.x.x.x' | |
dockerRegistry='mycluster.icp' | |
dockerRegistryPort='8500' | |
user="admin" | |
sudo echo "$masterNode $dockerRegistry" | sudo tee -a /etc/hosts > /dev/null | |
openssl s_client -showcerts -connect "$dockerRegistry:$dockerRegistryPort" </dev/null 2>/dev/null|openssl x509 -outform PEM >$dockerRegistry.docker.crt | |
# FOR OSX | |
# sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain $dockerRegistry.docker.crt |
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/sh | |
kubectl get secrets -o yaml example-com-tls | grep -E 'tls.(crt|key)' | while read line; | |
do | |
OUT=$(echo $line | awk -F:\ '{print$1}') | |
echo $line | awk -F:\ '{print$NF}' | base64 -d -i - > mycluster-icp-$OUT | |
done |
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
kubectl get secrets -o json --namespace old | jq '.items[].metadata.namespace = "new"' | kubectl create -f - |
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
curl -k -Lo helm https://mycluster.icp:8443/helm-api/cli/linux-amd64/helm --header "Authorization: $(bx pr tokens | grep "Access token:" | cut -d' ' -f3- | sed -e 's/^[[:space:]]*//')" && chmod +x helm && sudo mv helm /usr/local/bin/helm |
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 | |
CLUSTER_HOST="mycluster.icp" | |
USER=admin | |
PW=admin | |
ID=id-mycluster-account | |
echo -e "Resetting Helm client env ..." | |
echo -e "" | |
sudo rm -rf ~/.helm |
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 | |
# ----------------------------------------------------------------------------------------------------\\ | |
# Description: | |
# Setup and deploy Weave Scope into a running Kubernetes Cluster | |
# ----------------------------------------------------------------------------------------------------\\ | |
set -e | |
kubectl apply -f "https://cloud.weave.works/k8s/scope.yaml?k8s-version=$(kubectl version | base64 | tr -d '\n')" | |
# https://gist.github.com/592fd3bccb49874235597e4ec553cac3 (waiter.sh) |