I hereby claim:
- I am mvasilenko on github.
- I am mvasilenko (https://keybase.io/mvasilenko) on keybase.
- I have a public key ASASSXmI8z0EAqmbnrGYI04yWDdRLrffy8uXpNl6aXd55wo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| # for importing cloudflare hosted dns zones into terraform | |
| # list zones | |
| curl -s -X GET "https://api.cloudflare.com/client/v4/zones/?per_page=100" -H "X-Auth-Email: $auth_email" -H "X-Auth-Key: $auth_key" -H "Content-Type: application/json"| jq -r '.result[] | "\(.id) \(.name)"' | |
| # list records at the zone 1234567890 | |
| curl -X GET "https://api.cloudflare.com/client/v4/zones/1234567890/dns_records?per_page=100" -H "X-Auth-Email: $auth_email" -H "X-Auth-Key: $auth_key" -H "Content-Type: application/json"| jq -r '.result[] | "\(.id) \(.name) |
| # set your CloudFlare key & email | |
| export auth_email=$CLOUDFLARE_EMAIL | |
| export auth_key=$CLOUDFLARE_TOKEN | |
| # list your DNS zones hosted at CloudFlare | |
| curl -s -X GET "https://api.cloudflare.com/client/v4/zones/?per_page=100" -H "X-Auth-Email: $auth_email" -H "X-Auth-Key: $auth_key" -H "Content-Type: application/json"| jq -r '.result[] | "\(.id) \(.name)"' | |
| # expected output: | |
| # a3c9c7d3861e52cf23c835102c258d63 example1.com | |
| # f47d1debb65621ca89039b9fbfeb726a example2.com |
| --- | |
| apiVersion: v1 | |
| kind: Namespace | |
| metadata: | |
| name: ns1 | |
| --- | |
| apiVersion: v1 | |
| kind: ServiceAccount | |
| metadata: | |
| name: ns1-sa |
| get_network_mode() { | |
| docker inspect --format='{{.HostConfig.NetworkMode}}' "$1" | |
| } | |
| created_by_kubelet() { | |
| [[ $(docker inspect --format='{{.Name}}' "$1") =~ ^/k8s_ ]] | |
| } | |
| db.getCollectionInfos().forEach(function(coll) { | |
| if (coll.type === "collection" ) { | |
| db[coll.name].getIndexes().forEach(function(index) { | |
| if ("id" !== index.name) { | |
| //print( JSON.stringify( index )) | |
| var indexKey = index.key // save the key, and transform index into the "options" | |
| delete index.v | |
| delete index.key | |
| index.background = true // optional: force background to be true | |
| print("db." + coll.name + ".createIndex(" + JSON.stringify(indexKey) + ", " + JSON.stringify(index) + ")"); |
| // List all indexes in all databases | |
| db.getMongo().getDBNames().forEach(function(dbName) { | |
| if (dbName != "admin" && dbName != "local" && dbName != "config") { | |
| db.getSiblingDB(dbName).getCollectionNames().forEach(function(coll) { | |
| db.getSiblingDB(dbName)[coll].getIndexes().forEach(function(index) { | |
| if ("id" !== index.name) { | |
| print("db.getSiblingDB('" + dbName + "')." + coll + ".ensureIndex(" + tojson(index.key) + ")"); | |
| } | |
| }); |
| ## This creates a working single node Azure Kubernetes Cluster | |
| ## and with an Azure Container Registry. Note, the ACR is in | |
| ## the same resource group as the AKS for demo purposes. For | |
| ## dev you should have ACR in separate resource group. | |
| echo "Beginning AKS Setup for Demo" | |
| date | |
| AKS_RESOURCE_GROUP=aks-rg1 | |
| AKS_CLUSTER_NAME=aks-c1 |
| $ kubectl run nginx --image=nginx --dry-run -o yaml | |
| apiVersion: extensions/v1beta1 | |
| kind: Deployment | |
| metadata: | |
| creationTimestamp: null | |
| labels: | |
| run: nginx | |
| name: nginx | |
| spec: |
| #!/bin/bash | |
| # get namespaces list | |
| NAMESPACES=$(kubectl get namespaces --output=jsonpath={.items..metadata.name}) | |
| # delete stuck pods in each namespace | |
| for NS in $NAMESPACES;do | |
| kubectl get pods -n $NS | awk "\$3==\"Terminating\" {print \"kubectl delete -n $NS pod \" \$1 \" --grace-period=0 --force\"}" | xargs -0 bash -c | |
| done |