This file contains 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
resource "digitalocean_droplet" "haproxy-www" { | |
image = "ubuntu-14-04-x64" | |
name = "haproxy-www" | |
region = "nyc2" | |
size = "512mb" | |
private_networking = true | |
ssh_keys = [ | |
"${var.ssh_fingerprint}" | |
] | |
connection { |
This file contains 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
variable "count" { | |
default = 1 | |
} | |
variable "flavor" { | |
default = "m1.small" | |
} | |
resource "openstack_networking_floatingip_v2" "fip" { | |
count = "${var.count}" |
This file contains 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
resource "opentelekomcloud_dns_zone_v2" "dnszone" { | |
name = "${var.dnszone}" | |
email = "info@${var.dnszone}" | |
ttl = 6000 | |
} | |
resource "opentelekomcloud_dns_recordset_v2" "test_a" { | |
zone_id = "${opentelekomcloud_dns_zone_v2.dnszone.id}" | |
name = "${var.dnszone}" | |
ttl = 300 |
This file contains 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
time-format %T | |
date-format %d/%b/%Y | |
log_format "%d:%t +%^" client=%h method=%m request="%r" request_length=%^ status=%s bytes_sent=%b body_bytes_sent=%^ referer=%R user_agent="%^" upstream_addr=%^ upstream_status=%^ request_time=%T upstream_response_time=%^ upstream_connect_time=%^ upstream_header_time=%^ |
This file contains 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 | |
# 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 |
This file contains 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 run nginx --image=nginx --dry-run -o yaml | |
apiVersion: extensions/v1beta1 | |
kind: Deployment | |
metadata: | |
creationTimestamp: null | |
labels: | |
run: nginx | |
name: nginx | |
spec: |
This file contains 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
## 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 |
This file contains 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
// 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 file contains 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
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) + ")"); |
This file contains 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
get_network_mode() { | |
docker inspect --format='{{.HostConfig.NetworkMode}}' "$1" | |
} | |
created_by_kubelet() { | |
[[ $(docker inspect --format='{{.Name}}' "$1") =~ ^/k8s_ ]] | |
} | |
OlderNewer