Skip to content

Instantly share code, notes, and snippets.

Elton Stoneman sixeyed

View GitHub Profile
@sixeyed
sixeyed / windows_on_kube_dceu.md
Created Nov 30, 2018 — forked from wsong/windows_on_kube_dceu.md
Kube on Windows demo for DCEU
View windows_on_kube_dceu.md

Windows on Kube

NOTE: This is based on the gist https://gist.github.com/wsong/34beb37ebd5d22c1bf1266aaeea085d4. That gist was used to set up the Dockercon SF demo; this one is for Dockercon EU 2018.

The below instructions describe how to set up a cluster with one Linux manager and one Windows worker such that you can schedule Kubernetes pods with Windows images on the Windows worker.

These instructions are for a Windows Server 2019 node. You can create these nodes on Azure (as of November 27, 2018).

On Azure, I recommend VMs of size D4s v3 or larger (4 CPUs, 16GB memory)

@sixeyed
sixeyed / profile.ps1
Created Nov 1, 2018
PowerShell profile with a Linux-style prompt and aliases for common Docker commands
View profile.ps1
function Prompt(){
$W = Split-Path -leaf -path (Get-Location)
$prompt = Write-Prompt "$($env:UserName)@$($env:ComputerName):" -ForegroundColor Green
$prompt += Write-Prompt $W -ForegroundColor DarkCyan
$prompt += Write-Prompt '>'
return ' '
}
function Remove-StoppedContainers {
docker container rm $(docker container ls -q)
@sixeyed
sixeyed / install-ide.ps1
Last active Jun 21, 2018
Install .NET & Java IDEs
View install-ide.ps1
choco install -y visualstudio2017enterprise
choco install -y intellijidea-ultimate
choco install -y dotnetcore-sdk
choco install -y jdk8
@sixeyed
sixeyed / simple-windows-stack.yml
Created Mar 14, 2018
The simplest Windows stack to run in a Docker swarm
View simple-windows-stack.yml
version: '3.3'
services:
web:
image: microsoft/iis:nanoserver
networks:
- app-net
ports:
- mode: host
@sixeyed
sixeyed / 01-run-on-azure.ps1
Last active May 31, 2017
Secure Docker engine on Azure VM and copy certs to local
View 01-run-on-azure.ps1
$serverName = 'my.server.region.cloudapp.azure.com'
$externalIP = '1.2.3.4'
$internalIP = '10.0.0.4'
mkdir -p C:\certs\vm\client
docker run --rm `
-e SERVER_NAME= $serverName `
-e IP_ADDRESSES=127.0.0.1,$externalIP,$internalIP `
-v 'C:\ProgramData\docker:C:\ProgramData\docker' `
@sixeyed
sixeyed / overlay-test.ps1
Created May 5, 2017
Overlay test for Windows containers
View overlay-test.ps1
$ip = '127.0.0.1'
docker swarm init --listen-addr $ip --advertise-addr $ip
docker network create --driver overlay test
docker service create `
--network test `
--endpoint-mode dnsrr `
--publish mode=host,target=80,published=80 `
@sixeyed
sixeyed / Set-ProfileForDocker.ps1
Last active Dec 23, 2018
PowerShell aliases for working with Docker on Windows - save to $profile
View Set-ProfileForDocker.ps1
#docker rm $(docker ps -a -q)
function Remove-StoppedContainers {
foreach ($id in & docker ps -a -q) {
& docker rm $id }
}
#docker rmi $(docker images -f "dangling=true" -q)
function Remove-DanglingImages {
foreach ($id in & docker images -q -f 'dangling=true') {
& docker rmi $id }
@sixeyed
sixeyed / update-docker.ps1
Created Sep 28, 2016
Update Docker for Windows Server 2016
View update-docker.ps1
# Upgrades an existing Docker installation on Windows Server 2016
# Assumes you have Docker already installed by following the steps in https://blog.sixeyed.com/1-2-3-iis-running-in-nano-server-in-docker-on-windows-server-2016/
Stop-Service docker
dockerd.exe --unregister-service
Invoke-WebRequest "https://download.docker.com/components/engine/windows-server/cs-1.12/docker.zip" -OutFile "$env:TEMP\docker.zip" -UseBasicParsing
@sixeyed
sixeyed / StubEventHubSpout.cs
Last active Sep 7, 2015
Simple stub for emitting Event Hub-style tuples to Storm context, for testing .NET Storm applications. Usage here: https://blog.sixeyed.com/a-stub-event-hub-spout-for-testing-storm-net/
View StubEventHubSpout.cs
using Microsoft.SCP;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
namespace My.Storm.App.Tests
{
/// <summary>
/// Simple stub for emitting Event Hub-style tuples to Storm context.
/// </summary>
@sixeyed
sixeyed / Program.cs
Created Feb 19, 2015
Submitting HDInsight Storm Applications from Visual Studio - Gotcha!
View Program.cs
TopologyBuilder topologyBuilder = new TopologyBuilder("MyEventProcessorRealTimeStorm");
You can’t perform that action at this time.