SQLGeordie's Blog

Helping the SQL Server community……where i can!

“Kubernetify” your Containers — February 23, 2020

“Kubernetify” your Containers

Adding the link to github which contain the slides and demo’s from the various events I have delivered this session to:

Github – Kubernetify Your Containers

To see them all I have given the root folder and if you search for “kubernetify” you should see everything needed πŸ‘

Abstract

We have all now had a play around with Docker and Containers or at least heard about them.

This demo heavy session will walk through some of the challenges around managing container environments and how Kubernetes orchestration can help alleviate some of the pain points.

We will be talking about what Kubernetes is and how it works and through the use of demos we will:

  • Highlight some of the issues with getting setup (Specifically Minikube on Ubuntu),
  • Deploying/Updating containers in Kubernetes (on-Prem as well as AKS using Azure DevOps)
  • Persisting data
  • How to avoid making the same mistakes as I have
Speaking — January 22, 2020

Speaking

Upcoming and previous speaking engagements. Links to slides and demo’s can always be found on github or youtube. If you would like me to speak at your event whether in person or remotely then please contact me.

Upcoming Speaking Engagements

September 2nd 2020: SQLBits London 2020
England (London)
Database CI/CD with Docker Containers and Azure DevOps (45mins)

September 26th 2020: SQLSaturday Denmark
Denmark
Database CI/CD with Docker Containers and Azure DevOps

Previous Speaking Engagements

February 29th 2020: Scottish Summit
Scotland (Glasgow)
Kubernetify” your Containers (45mins)

March 7th 2020: DataMinds.be
Belgium
Database CI/CD with Containers and Azure DevOps

February 1st 2020: SQLSaturday #927 Edinburgh 2020
Scotland (Glasgow)
Kubernetify” your Containers

December 14th 2019: SQLSaturday #910 Slovenia 2019 (Ljubljana)
Slovenia (Ljubljana)
Kubernetify” your Containers

October 1st 2019: Techorama.nl
Netherlands (PathΓ© Ede)
Database CI/CD with Containers and Azure DevOps

September 13th 2019: Data Scotland
Scotland (Glasgow)
Kubernetify” your Containers

June 20th 2019: DataGrillen 2019
Germany (Lingen)
Database DevOps with Containers and Azure DevOps

April 27th 2019: Data In Devon 2019
England (Exeter)
Database DevOps with Containers and Azure DevOps

December 8th 2018: SQLSaturday #782 Slovenia 2018 (Ljubljana)
Slovenia (Ljubljana)
Introduction to Containers

October 8th 2018: SQLRelay (Newcastle)
England (Newcastle)
AWS Glue – Let’s get “stuck” in!

October 2nd 2018: Introduction to Containers (One off for those who missed Data n’ Gravy)
England (Leeds)
Introduction to Containers

September 18th 2018: SQLNorthEast UserGroup
England (Newcastle)
AWS Glue – Let’s get “stuck” in!

September 14th 2018: SQLGLA 2018
Scotland (Glasgow)
AWS Glue – Let’s get “stuck” in!

September 6th 2018: Data Platform User Group (Leeds)
England (Leeds)
AWS Glue – Let’s get “stuck” in!

September 5th 2018: PASS Manchester SQL Server User Group
England (Manchester)
AWS Glue – Let’s get “stuck” in!

August 1st 2018: Introduction to Containers (One off for those who missed Data n’ Gravy)
England (Leeds)
Introduction to Containers

June 22nd 2018: SQLGrillen 2018
Germany (Lingen)
Introduction to Containers

June 12th 2018: Edinburgh Data Platform
Scotland (Edinburgh)
Introduction to Containers

April 28th 2018: Data n Gravy
England (Leeds)
Introduction to Containers

April 19th 2018: Glasgow SQL User Group
Scotland (Glasgow)
Introduction to Containers

November 30th 2017: SQLNorthEast User Group
England (Newcastle)
Introduction to Containers

Upgrading AKS to higher than v1.13.10 — September 15, 2019

Upgrading AKS to higher than v1.13.10

I recently received an email from Microsoft Azure regarding some security vulnerabilities in AKS and to upgrade to >= 1.13.10:

Looking in the Azure Portal, there was only an option to upgrade to v1.12.8

and this was confirmed by running:

az aks get-upgrades --resource-group JCL-DevOps --name DevOps-K8s-Test --output table

As it is late at night my brain wasn’t working as it should be but thought I’d put a quick blog out there to say that if you are on v1.11.5 and want to upgrade to >= v1.13.10 then you have to do this in a 2 stage process by upgrading to v1.12.8 first:

az aks upgrade --resource-group myResourceGroup --name myAKSCluster --kubernetes-version 1.12.8
 az aks upgrade --resource-group myResourceGroup --name myAKSCluster --kubernetes-version 1.13.10

After upgrading to v1.12.8 you will now have the option to upgrade to v1.13.10 and then above that:

Now that I am up to 1.14.6, there are no further updates available:

az aks get-upgrades --resource-group myResourceGroup --name myAKSCluster --output table

As to why exactly this is I haven’t managed to find out yet but I have to assume it is like a lot of applications, it has to be a staged process – think upgrading SQL Server 2000 to SQL Server 2019, you can’t do this in 1 upgrade step πŸ™‚

However, I’m a little confused and disappointed that this day in age and with the upgrade being minor version upgrades that it can’t be done in one go – perhaps I’m asking too much……………?

Upgrade scripts / path I used were:

az aks upgrade --resource-group myResourceGroup --name myAKSCluster --kubernetes-version 1.12.8
az aks upgrade --resource-group myResourceGroup --name myAKSCluster --kubernetes-version 1.13.10
az aks upgrade --resource-group myResourceGroup --name myAKSCluster --kubernetes-version 1.14.6
Minikube / SQL Server – Issues log… — September 10, 2019

Minikube / SQL Server – Issues log…

Having played around a bit with minikube running SQL Server Containers on both Windows 10 and an Ubuntu Hyper-V VM, I wanted to get “down on paper” some of the issues that I have experienced so hopefully you won’t make the same mistakes and probably more so, as a reference for me who keeps forgetting everytime I hit the same issue :(.

I will add to this post as and when I can.

Minikube Stop / delete…..does not stop or delete

There have been many times when I’ve simply just lost the ability to use the minikube Hyper-V VM that is created with a minikube start. I’m yet to figure out why this is as it seems very sporadic but certainly an issue if you shutdown the host it is running on, in my case a Dell Precision laptop.

There are a host of links on the internet saying to do a “minikube stop” / “minikube start” however I always seem to experience issues when doing so. My issue being, it hangs when doing a shutdown of the VM so it never gets to the point of being able to delete it. Unfortunately there is no errors or warnings, it just hangs at the point of shutting down the VM indicating 0% progress.

Why?

This is because I’m a complete idiot! I work primarily from my home office and have my laptop hardwired to the internet which is great as I don’t have to faff on with WiFi. However, in order for your minikube commands to interact with the minikube VM, it uses SSH and this only works when Wifi is connected. “Why is that Chris?” you may ask. Well, when you create a minikube VM using Hyper-V (I believe it isn’t required with virtualbox but please correct me if I am incorrect) you need to create and attach an “External” NIC. What I mean is, a Virtual Network switch that has access to the outside world so it can pull down images amongst a whole host of other cool stuff. My external virtual switch’s use my wifi adapter on the host laptop as its external network so it kinda makes sense that you need it connected to interact with the VM.

So, if you ever do decide to have a play around with minikube on Windows 10, make sure that even though you are connected to the internet via a wire, you also connect to WiFi πŸ™‚ If you remember this, your life will be a hell of a lot easier.

Example minikube start command

The command below will create a minikube VM using Hyper-V called “minikube” with 10000MB RAM, 4vCPU’s and will attach a virtual switch called “ExternalSwitch” which has to be created separately in Hyper-V manager.

#Start minikube
minikube start –vm-driver=hyperv –memory=10000 –cpus=4 –hyperv-virtual-switch=”ExternalSwitch”

After about 4mins you should have your new shiny minikube VM available. Output from the terminal is below:

$ minikube start –vm-driver=hyperv –memory=10000 –cpus=4 –hyperv-virtual-switch=”External”
minikube v1.3.1 on Microsoft Windows 10 Pro 10.0.18362 Build 18362
Creating hyperv VM (CPUs=4, Memory=10000MB, Disk=20000MB) …
Preparing Kubernetes v1.15.2 on Docker 18.09.8 …
Pulling images …
Launching Kubernetes …
Waiting for: apiserver proxy etcd scheduler controller dns
Done! kubectl is now configured to use “minikube”