Skip to content

Instantly share code, notes, and snippets.

PS C:\gd\Documents\dockerswarmarm> $vmss = (Get-AzureRmVmss -ResourceGroupName Swarm-RG -Name swarmhost)
PS C:\gd\Documents\dockerswarmarm> $vmss.Sku.Capacity = 5
PS C:\gd\Documents\dockerswarmarm> Update-AzureRmVmss -ResourceGroupName Swarm-RG -Name swarmhost -VirtualMachineScaleSet $vmss
PS C:\gd\Documents\dockerswarmarm> Get-AzureRmPublicIpAddress -Name swarmhostsoei4cappgwpip -ResourceGroupName swarm-rg | select IPaddress
IpAddress
---------
13.84.214.117
PS C:\gd\Documents\dockerswarmarm> Invoke-webrequest 13.84.214.117
PS C:\Users\cloudadmin> Invoke-WebRequest swarmhost000001
StatusCode : 200
StatusDescription : OK
Content : <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" cont...
RawContent : HTTP/1.1 200 OK
PS C:\Users\cloudadmin> docker service ls
ID NAME MODE REPLICAS IMAGE PORTS
odt8g82356ig iis global 2/2 microsoft/iis:windowsservercore-1709
PS C:\Users\cloudadmin> docker node update --availability drain swarmmanager1
swarmmanager1
PS C:\Users\cloudadmin> docker node ls
ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS
iamctppujla19jing2j1jeyp2 swarmhost000000 Ready Active Leader
tz4kj2utkhra3e9tp3ooa5ks0 swarmhost000001 Ready Active Reachable
y1nrx7qu5mq0x9ydhdmjmpjgw * swarmmanager1 Ready Drain Reachable
PS C:\Users\cloudadmin> docker node ls
ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS
iamctppujla19jing2j1jeyp2 swarmhost000000 Ready Active Leader
tz4kj2utkhra3e9tp3ooa5ks0 swarmhost000001 Ready Active Reachable
y1nrx7qu5mq0x9ydhdmjmpjgw * swarmmanager1 Ready Active Reachable
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"vmssName": {
"value": "swarmhosts"
},
"instanceCount": {
"value": 2
},
#Requires -Version 3.0
Param(
[string] $ResourceGroupLocation = "southcentralus",
[string] $ResourceGroupName = 'Swarm-RG',
[string] $TemplateFile = 'azuredeploy.json',
[string] $TemplateParametersFile = 'azuredeploy.parameters-show.json'
)
If (-not (Get-AzureRmResourceGroup -Name $ResourceGroupName -ErrorAction SilentlyContinue)) {New-AzureRmResourceGroup -Name $ResourceGroupName -Location $ResourceGroupLocation -Verbose }
New-AzureRmResourceGroupDeployment -Name ((Get-ChildItem $TemplateFile).BaseName + '-' + ((Get-Date).ToUniversalTime()).ToString('MMdd-HHmm')) `
@artisticcheese
artisticcheese / a.dockerfile
Last active March 13, 2018 15:27
dockerfile part for appinsights
WORKDIR prep
RUN Invoke-WebRequest "https://go.microsoft.com/fwlink/?linkid=517856" -UseBasicParsing -OutFile appinsights.msi; `
Start-Process -filepath "appinsights.msi" -ArgumentList "/quiet" -PassThru | Wait-Process; `
Remove-Item .\* -recurse -force -Verbose
RUN Import-Module 'C:\Program Files\Microsoft Application Insights\Status Monitor\PowerShell\Microsoft.Diagnostics.Agent.StatusMonitor.PowerShell.dll'; `
Start-ApplicationInsightsMonitoring -Name 'default web site' -InstrumentationKey '3c069cb6-fc1a-4bab-974c-0a4245ae7f1b'
PS C:\Windows\system32> get-wmiobject -ComputerName 172.19.173.92 -Class win32_computersystem
Domain : ad.local
Manufacturer : Microsoft Corporation
Model : Virtual Machine
Name : CONTAINERHOST
PrimaryOwnerName :
TotalPhysicalMemory : 4105752576