Archives for Getting Started

Getting Started with Kubernetes

Posted by Graham Smith on February 1, 2018No Comments (click here to comment)

If you've been following the containers story you'll probably know that 2017 was a big year for Docker. You may also know that 2018 looks set to be a big year for Kubernetes, "an open-source system for automating deployment, scaling, and management of containerized applications". There are several systems competing in the same space as Kubernetes but for many the jury has voted and Kubernetes is the winner.

For many of us ‘containerized applications' means applications that have been containerised using Docker, and if you've been learning and working with Docker then learning Kubernetes is an obvious next step. I've been learning Kubernetes for a couple of months now and in this post I share some of the resource links that I've found most useful and provide pointers to the different ways I've created Kubernetes environments to provide practical hands-on experience.

Learning Resources

Run Kubernetes on your Development Machine Using Minikube

A quick and easy way to get started with Kubernetes is to install Minikube on your development machine. Minikube is a tool that runs a single-node Kubernetes cluster on a virtual machine running on your laptop or workstation. You can find the installation guide here and the getting started guide here. I installed Minikube on my Windows 10 workstation running Hyper-V and the minikube start command just worked. Don't forget you'll need to install kubectl as well as Minikube. As part of the installation process a kubeconfig file is created at %userprofile%\.kube\config (config is the actual file) which ‘connects' kubectl to Minikube. If you are connecting to different Kubernetes installations from your development machine you'll need to manage kubeconfig files—see later for more details.

If you've got Minikube installed and working you might be wondering what next, especially if you are a Windows user as the documentation isn't hugely Windows-friendly. If you are in this situation head over to this Getting Started with Kubernetes on your Windows Laptop with Minikube tutorial. Skip past the installation instructions to Starting our Cluster and follow on from there.

Run Kubernetes in Microsoft Azure

If you have a Microsoft Azure subscription or are prepared to sign up for a free trial it's ridiculously easy to start working with Kubernetes in Azure. There's actually a couple of ways to do it but the easiest is to create an Azure Container Service (AKS) cluster as this service abstracts away much of the complicated cluster stuff leaving you to focus on Kubernetes itself.

The Deploy an Azure Container Service (AKS) cluster walkthrough gets you up-an-running in no time with an actual app that you can run in your browser. Using Azure Cloud Shell is the easier way to use the Azure CLI although it does have an annoying habit of timing out on you. If you do switch to using the local version of the CLI watch out for the az aks get-credentials --resource-group myResourceGroup --name myK8sCluster comand which will merge connection information about the cluster you are creating with any previously created %userprofile%\.kube\config file that might be present (after installing Minikube for example) which may not be what you want.

Run Kubernetes on a Raspberry Pi Cluster

If you want to take your knowledge a step further and learn how to perform a bare-metal installation of Kubernetes then one option is to create a Raspberry Pi cluster and install and run Kubernetes on it. I've gone down this route and have had great fun doing so. There are a couple of key resources that will help you get this project off the ground:

My cluster ended up looking like this:

Some familiarity with Raspberry Pi obviously helps with this sort of project however I wouldn't say it's a definite prerequisite as there is plenty of help out there for anyone getting started with Raspberry Pi. You do really need to start off with at least three Pis so there is a modest cost involved but if you don't want your cluster to be portable then you don't need to hook it up to a switch or a router and WiFi works fine for me. A tip worth mentioning is that the 6-port RAVpower USB charger is slightly smaller than the 6-port Anker USB charger and fitted my enclosure much better.

Dealing with Multiple Kubernetes Instances

If you end up managing more than one instance of Kubernetes with the same instance of kubectl you'll somehow need to manage the issue of multiple kubeconfig files. There is detailed guidance about this here. My needs are very modest and at the moment I simply save different kubeconfig files with different extensions and then remove the extension of the one I want to work with. Not very elegant but it serves my simple needs for the moment.

And There's More...

The three techniques I've described for working with Kubernetes are only the tip of the iceberg. Google has a similar offering to Microsoft Azure with its Google Kubernetes Engine for example as does CodeFresh. I haven't tried these services but the point is that there are lots of options if none of the ones I've covered takes your fancy.

One particularly exciting development that I haven't tried yet but will soon is Kubernetes running in Docker for Windows. Scott Hanselman has a nice walkthrough here as does Stefan Stranger here. Enjoy!


Getting Started with Containers and Docker for Visual Studio Developers

Posted by Graham Smith on October 18, 2016No Comments (click here to comment)

Docker and containers are one of the hot topics of the development world right now and there's no sign of them going away. With the recent launch of Windows Server 2016 and with it the Windows Server Containers feature the world of containers is one that can't be ignored by developers on the Windows platform who don't want to get left behind. I've spent quite a bit of time over the summer learning Docker and attempting to understand how containers fit in to the Visual Studio developer workflow and the continuous delivery pipeline -- a precursor for my new blog series on Continuous Delivery with Containers. I've found quite a lot of useful resources and in this Getting Started post I've listed the ones which I think are the most useful. I've also added some narrative for anyone who is trying to make sense of all the different tooling as it took me a little while to get this clear in my mind.


Docker is an open-source technology for managing containers -- not to be confused with Docker Inc, the company which is the original author and primary sponsor of the Docker open source project. Since containers have their roots in the Linux world it's not surprising that most of the in-depth resources for learning Docker come from the Linux world. The question for those of us who predominantly use Windows and who don't want to have to install Linux is how to get going? Two possibilities are the Katacoda browser-based labs and Docker for Windows (both covered below). These essentially allow you to learn in a predominantly Linux world (no bad thing) but if this is too much you could go straight to Docker on Windows, although I think you'll be missing out.

Docker on Windows

For the past couple of years Microsoft has been contributing to the Docker open source project to bring the benefits of Docker to Windows Server. For some time now it's been possible to install Docker on Windows Server 2016 and use it to manage Windows Server containers. Here's the thing though: I'm using the term Docker on Windows to specifically differentiate it from Docker for Windows. Whilst clearly related they are two different things and the lack of anyone pointing this out in blog posts and documentation caused confusion for me in my early dealings with Docker on Windows. One more point to note is that there are two types of containers for Windows -- Windows Server Containers and Hyper-V Containers. At the time of writing both types run on Windows Server but only Hyper-V Containers run on Windows 10. Whilst I'm in pointing-things-out mode I might as well mention that there is a PowerShell module for managing containers as an alternative to the Docker command-line interface, as you might see it being used in some blog posts.

Docker for Windows

Docker for Windows -- not to be confused with Docker on Windows -- is a technology that leverages Hyper-V on Windows 10 (certain versions only at time of writing) to host a lightweight Linux VM. Docker commands can then be issued against this VM from the Windows 10 host. It's a great tool for supporting learning about Docker and an essential element of the toolkit required for Visual Studio developers wanting to start working with containers as part of the developer workflow.

Visual Studio Tools for Docker and Developer Workflow

For Visual Studio developers we're now getting to the really good stuff. Visual Studio Tools for Docker enables support for running ASP.NET Core applications on the lightweight Linux VM that is at the heart of Docker for Windows. It even supports debugging. What's even more exciting is that at the time of writing the latest beta version of Docker for Windows supports Windows Containers so as well as running an ASP.NET Core application under development against Linux you can now also run it against Windows Server (Core or Nano Server). Why is this exciting? Well, has it ever bothered you that you might be developing a web application on Windows 10 and hosting it in IIS Express but in production it will be running on Windows Server 2012/16 hosted in full-fat IIS? I know it's bothered me and the excitement is that this toolchain promises to fix all that.

Time to Down Tools

A resource that doesn't really fit in to any of the categories above is the The Containers Channel on Channel 9. It's got a great mix of content and worth keeping an eye on for new additions.

I hope you find these resources useful and if you have any great discoveries worth sharing please let me know in the comments. Do be sure to keep an eye on my new Continuous Delivery with Containers blog series where I'll be documenting my journey to understand how containers can play a part in the continuous delivery pipeline.

Cheers -- Graham

Getting Started with Team Foundation Build 2015

Posted by Graham Smith on February 4, 2016No Comments (click here to comment)

Hopefully by now everyone who works with TFS and / or VSTS knows that there is a new build system. There's no immediate panic as the XAML builds we've all been working with are still supported but for any new implementations using TFS 2015 or VSTS then TFBuild 2015 is the way forward. If you haven't yet had chance to investigate the new build system then I encourage you to check out my pick of the best links for getting started:

If you are interested in buying a book which covers TFBuild 2015 then I can recommend Continuous Delivery with Visual Studio ALM 2015. I've read it and it's excellent.

Cheers -- Graham

Getting Started with PowerShell Tools for Visual Studio

Posted by Graham Smith on January 5, 2016No Comments (click here to comment)

If you are still using the PowerShell ISE to edit your PowerShell scripts than there may be a better way, particularly if you are already a Visual Studio user. Adam Driscoll's PowerShell Tools for Visual Studio extension has been around for some time now and is even better in Visual Studio 2015. Here is my pick of the best links to help you get started with this great tool:

Don't forget, if you don't already have access to Visual Studio you can download the community edition from here.

Cheers -- Graham

Getting Started with Azure Resource Manager

Posted by Graham Smith on November 11, 2015No Comments (click here to comment)

Whether you have been working with Microsoft Azure for some time or are new to it there is one BIG thing you need to know about: there are now both ‘classic' and new ways of doing Azure. Classic is referred to as Azure Service Management (ASM) and new is known as Azure Resource Manager (ARM). Going forward ARM is definitely the way of the known future so it makes sense to understand what it's all about and what it can offer. The link collection below is my pick of the best resources to help you get up to speed. If your time is limited then don't miss Trevor Sullivan's MTUG Norway video -- it's a gem.

One thing to keep firmly in mind as you work your way through the resources above is that just recently a new set of Azure PowerShell cmdlets for ARM was released in preview. These cmdlets represent a breaking change from the old cmdlets so any code in the above resources is effectively soon going to be out-of-date. Having said that on the surface the differences are not huge (mostly naming differences) however under the covers I think things have changed as I have come across an odd bug or two. If you are just starting out with ARM it's probably worth using the new cmdlets -- just beware they are in preview for a reason.

Cheers -- Graham

Getting Started with Git for Visual Studio Developers

Posted by Graham Smith on September 8, 2015No Comments (click here to comment)

If you are just getting started with learning Git it's important to distinguish between Git the actual version control technology and services that use Git such as GitHub and TFS / VSO / Visual Studio. The resources below are the ones I think will provide a good starting point for the Visual Studio developer wishing to use Git in conjunction with repositories hosted in GitHub, TFS or VSO.

The integration of Git with TFS / Visual Studio dates back to early 2013 and in mid 2015 now feels particularly mature. Additionally there is the fairly recent announcement of the GitHub extension for Visual Studio 2015. Despite all the great integration with Visual Studio it's worth remembering that sometimes you may need to drop down to the command line to perform some Git operations. This is where having spent some time learning the Git basics will pay off. The MVA jump start course above covers Git basics and a web search will provide numerous other sources.

Cheers -- Graham

Getting Started with Application Insights

Posted by Graham Smith on May 4, 2015No Comments (click here to comment)

If the latest release of your application has a problem chances are you would prefer to know before your users flood your inbox or start complaining on social media channels. Additionally it is probably a good idea to monitor what your users get up to in your application to help you prioritise future development activities. And so to the world of diagnostics and analytics software. There are offerings from several vendors to consider in this area but as good a place to start as any is Microsoft's Application Insights. Here is a list of resources to help you understand what is can do for you:

At the time of writing this post Application Insights is in public preview -- see here for details. Do bear in mind that it's a chargeable service with full pricing due to take effect in June 2015.

Cheers -- Graham

Getting Started with PowerShell DSC

Posted by Graham Smith on March 17, 2015No Comments (click here to comment)

Whenever I explain to people the common failure points for the deployment of an application I'll often draw a triangle. One point is for application code, another for application configuration and the other for server configuration. (Of course there are plenty of other ways for a deployment to fail but if it's because the power to your server room has failed you have a different class of problem.) Minimising the chances of application code being the culprit starts with good coding practices such as appropriate use of design patterns, test driven development or similar -- the list goes on and everyone will have their view. This continues with practising continuous integration and deploying code to a delivery pipeline using a tool such as Release Management for Visual Studio that can manage an application's configuration between environments. But how to manage server configuration? In many organisations initial sever configuration is typically done by hand -- possibly using a build list. Over time tweaks are made by different technicians until eventually the server becomes a work of art: a one-off that nobody could reliably reproduce.

The answer to all this is tooling that implements configuration as code. Typically this means declaring in a code file what you want a server's configuration to look like and then leaving some other component to figure out how to achieve that -- and to correct any deviations that might occur. This is in contrast to an imperative code build script where you would prescribe what would happen but where you would have to take care of error handling and other factors that could cause issues.

In the non-Windows world tools such as Puppet and Chef are commonly used to automate the configuration of servers. And whilst they do have something to offer the Windows folks it's not a completely happy story because both tools require a Linux machine as the master server. For a while there wasn't a ‘native' solution to the configuration as code problem for the Windows platform however all that changed with PowerShell 4 and the release of PowerShell DSC (Desired State Configuration). If you don't already have a configuration as code solution and you are a Windows shop then PowerShell DSC is almost certainly the route of choice. There is now a wealth of options for learning PowerShell DSC and my pick of some of the best places to start is as follows:

Although I haven't had chance to watch much of then yet Getting Started with PowerShell Desired State Configuration (DSC) and Advanced PowerShell Desired State Configuration (DSC) and Custom Resources are undoubtedly going to turn out to be unmissable. As I mention in my Getting Started with Windows PowerShell blog post the double act that is Jason Helmick and PowerShell inventor Jeffrey Snover is an enormously informative but but at the same time hugely entertaining combination. I chuckled and chortled all the way through their two PowerShell JumpStart series of videos and I'm expecting more of the same with these latest ones. Having fun whilst learning? What could be better?

Cheers -- Graham

Getting Started with Visual Studio Online

Posted by Graham Smith on March 7, 2015No Comments (click here to comment)

Not everyone wants or needs the full-blown power of an on-premises TFS installation and if that's you then Visual Studio Online (TFS in the cloud) is a great way to integrate Visual Studio with version control, backlog management, agile planning tools and many of the other great features that are available with TFS. Some things in VSO work in a similar way to TFS so some of the learning resources can do double duty -- my Getting Started with Team Foundation Server and ALM guide is here. There are also dedicated VSO learning resources and this is my recommend list:

One of the really great things about VSO is that you can get started for free (and it can stay free within very generous limits). Combined with the free Visual Studio Community 2013 it makes for a fantastic learning opportunity for anyone without an MSDN account.

Cheers -- Graham

Getting Started with Windows PowerShell

Posted by Graham Smith on February 8, 2015No Comments (click here to comment)

If you are just getting started with Windows PowerShell or haven't done much with it yet you may be thinking that it is just another scripting language. Nothing could be further from the truth because although PowerShell is a scripting language it's also a huge amount more than that. A Wikipedia page here has a nice overview of the history of PowerShell and of the different features that became available with each version, and gives the reader a good idea about the breadth of functionality. A key concept to understand is that PowerShell is involved in almost every area of automation on the Windows and Azure platforms and knowing, learning and using PowerShell is increasingly going to be essential for anyone working with Windows or Azure. Here are my top learning resources for getting started with PowerShell:

PowerShell is huge and in terms of resources this is just the tip of the iceberg. In my view the two Jump Start series of videos on the Microsoft Virtual Academy are unmissable. What's great about them is that Jason Helmick is a superb presenter and extremely funny guy and Jeffrey Snover is also an excellent presenter and also the inventor of PowerShell. This all adds up to an immensely enjoyable series of videos where you learn about the history of PowerShell as well as how to use it. Also well worth watching are the two videos from TechEd North America 2014 -- lots of value for the time it takes to watch them. I've listed two courses from Pluralsight that are useful if you are just getting going with PowerShell but there are plenty more for anyone wanting to dig deeper.

Cheers -- Graham