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
var setup = function (numDocs) { | |
var batchSize = 1000; | |
function makeDoc(maxSubOrders = 10, minDate = ISODate("2014-01-01T00:00:00Z"), maxDate = ISODate("2016-09-27T00:00:00Z")) { | |
function randomDate(minDate, maxDate) { | |
return new Date(minDate.getTime() + Math.random() * (maxDate.getTime() - minDate.getTime())); | |
} | |
var numSubOrders = Math.floor(Math.random() * (maxSubOrders + 1)); |
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
# Requires Azure Resource Manager and Azure Active Directory Cmdlets | |
# Install-Module AzureRM | |
# Install-Module AzureADPreview | |
Login-AzureRmAccount | |
$TenantId = (Get-AzureRmSubscription).TenantId | |
Connect-AzureAD -TenantId $TenantId | |
$ResourceGroupName = "TestRG" |
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
{ | |
"Outputs": { | |
"PublicSlaveDnsAddress": { | |
"Value": { | |
"Fn::GetAtt": [ | |
"PublicSlaveLoadBalancer", | |
"DNSName" | |
] | |
}, | |
"Description": "Public slaves" |
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
# Copyright 2017 by the contributors | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, |
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
# Note I used 2 t2.micro EC2 instances with 1gb memory each as worker nodes | |
# 1gb in the OP maps to 440Mi (~50%) in the example | |
kubectl run pod1 --image=nginx --requests=memory=440Mi | |
kubectl run pod3 --image=nginx --requests=memory=440Mi | |
kubectl run pod4 --image=nginx --requests=memory=100Mi | |
kubectl run pod2 --image=nginx --requests=memory=100Mi | |
# The scheduler will alternate each deployment's pod to each of the two nodes like in the OP |
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
# Azure Authtentication Token | |
# From https://blogs.technet.microsoft.com/stefan_stranger/2016/10/21/using-the-azure-arm-rest-apin-get-access-token/ | |
#requires -Version 3 | |
#SPN ClientId and Secret | |
$ClientID = "clientid" #ApplicationID | |
$ClientSecret = "ClientSecret" #key from Application | |
$tenantid = "TenantID" | |
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
# Must run on a Windows Server with Azure File Sync Agent and Azure PowerShell module installed | |
function Login-Azure { | |
param ( | |
[string]$username, | |
[string]$password # Use [secureString] outside of secure environments | |
) | |
# Convert password to secure string (required for creating login credential) | |
$securePassword = ConvertTo-SecureString -String $password -AsPlainText -Force |
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
aws logs describe-log-groups --query 'logGroups[*].logGroupName' --output table | awk '{print $2}' | grep -v ^$ | while read x; do aws logs delete-log-group --log-group-name $x; 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
#Provide the subscription Id where managed disk is created | |
# subscriptionId=yourSubscriptionId # omit for use in Azure Cloud Shell | |
# az account set --subscription $subscriptionId | |
#Provide the name of your resource group where managed disk is created | |
resourceGroupName=QACA | |
#Provide the managed disk name | |
diskName=ca-lab-vm_OsDisk_1_b5b39d9313ec4ce3aa8ace3889dcce9b |
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
{ | |
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | |
"contentVersion": "1.0.0.0", | |
"parameters": { | |
"virtualMachineName": { | |
"type": "string", | |
"defaultValue": "ca-lab-vm" | |
}, | |
"virtualMachineSize": { | |
"type": "string", |
OlderNewer