Skip to content

Instantly share code, notes, and snippets.

PS C:\> get-VM | select -Property Name, State, VMID
Name State VMId
---- ----- ----
2016ServerCore Off 18f3b782-189f-4be7-8d09-254dc64c484d
Win10 Running ab1b03c9-6796-480b-9495-421bdfa43d47
Win2016 Off 469a3585-3fc0-4f72-b4d5-12cc7bbcbca9
@artisticcheese
artisticcheese / replicatesecrets.ps1
Last active September 5, 2018 20:55
replicatesecrets.ps1
param(
[Parameter(Mandatory=$true)]
$sourceKeyVaultName,
[Parameter(Mandatory=$true)]
$destinationKeyvaultName
)
Function ExportAllKeys
{
param ($sourceKeyVaultName, $destinationKeyVaultName)
Write-Output "Exporting from $sourceKeyVaultName to $destinationKeyVaultName"
@artisticcheese
artisticcheese / docker-stack.yml
Last active July 12, 2018 16:58
docker-stack.yml
version: '3.2'
services:
whoami:
image: artisticcheese/whoami:nanolts-2018060908
ports:
- "8080:80"
volumes:
- whoami:c:\inetpub\logs\logfiles\host
deploy:
mode: replicated
@artisticcheese
artisticcheese / ClusterConfig.Windows.MultiMachine.json
Created July 12, 2018 14:43
ClusterConfig.Windows.MultiMachine.json
{
"name": "WindowsContainersCluster",
"clusterConfigurationVersion": "1.0.0",
"apiVersion": "10-2017",
"nodes": [
{
"nodeName": "vm0",
"iPAddress": "containerhost00.sf.local",
"nodeTypeRef": "NodeType0",
"faultDomain": "fd:/dc1/r0",
image: artisticcheese/whoami:latest
manifests:
-
image: artisticcheese/whoami:unix-2018060858
platform:
architecture: amd64
os: linux
-
image: artisticcheese/whoami:nanolts-2018060858
platform:
PS Azure:\> New-AzureRmResourceGroup -Name CI -Location EastUS
ResourceGroupName : CI
Location : eastus
ProvisioningState : Succeeded
Tags :
ResourceId : /subscriptions/b55607ab-c703-4044-a526-72bd701b0d48/resourceGroups/CI
PS Azure:\> New-AzureRmContainerGroup -ResourceGroupName CI -Name whoamiwin -Image artisticcheese/whoami -OsType Windows -DnsNameLabel whoamiwin
ARG buildimagetag="2.1-sdk"
ARG runtimeimagetag="2.1-aspnetcore-runtime"
FROM microsoft/dotnet:${buildimagetag} AS build
COPY /code /code
WORKDIR /code
RUN dotnet build -c Release -o output
FROM microsoft/dotnet:${runtimeimagetag}
COPY --from=build /code/output .
EXPOSE 80
ENTRYPOINT ["dotnet","code.dll"]
PS C:\Users\cloudadmin> docker node ls
ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS
iamctppujla19jing2j1jeyp2 swarmhost000000 Ready Active Leader
lhalb40ui3y8hguy41zhjwxtn swarmhost000008 Ready Active
tz4kj2utkhra3e9tp3ooa5ks0 swarmhost000001 Ready Active Reachable
vb2e2d3ax1mepjmnbdixv67m2 swarmhost000003 Ready Active
y1nrx7qu5mq0x9ydhdmjmpjgw * swarmmanager1 Ready Drain Reachable
zb0vx5hpmkni8qj98v4xspg10 swarmhost000002 Ready Active
PS C:\Users\cloudadmin> docker service ls
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