Kubernetes on Windows for Production - windows

I just started messing with containers and managing them. Then I came across with Kubernetes. I've already installed Docker and tried out a few examples. But when it came to managing them with Kubernetes, I've kinda stuck.
I've found out that I can run Kubernetes with minikube on Windows on my laptop for development. But I want to know if I can run Kubernetes on my production server or local development environment because as they point out minikube doesn't have all featues that Kubernetes can offer. So in production I guess I can't use minikube, right?
Because of the data that I'm using I can't use Google cloud or Azure for production, laws forbid that. So in short do I have to switch to cloud to use Kubernetes or can I use it in my Windows Server machine without any cloud environment?
I've already read How to do local development with Kubernetes? question but they've also recommended minikube.
Thanks for your answers.

So in production I guess I can't use minikube, right?
Not really advisable, minikube is ment to support learning/local single machine dev tasks.
do I have to switch to cloud to use Kubernetes or can I use it in my Windows Server machine without any cloud environment?
IMHO Windows and kubernetes are not really there yet. If you don't want to install dedicated linux box or switch to cloud there is always option to run it from within virtualized environment (VirtualBox, VMWare...). Maybe not super optimal performance-wise (additional layers of virtualization added on top of windows) but can be sufficiently stable for production (depends on available hardware and resources requirements).

Related

How do I implement Vertical Pod Autoscaling in Windows Server 2019?

I have a Windows Server 2019 (v1809) machine with Kubernetes (bundled with Docker Desktop for Windows). I want to enable Vertical Pod Autoscaling for the cluster I have created.
However, all the documentation I can find is either for a cloud service or a Linux-based system. Is it possible to implement VPA for the Docker Desktop Kubernetes in Windows or Minikube?
While VPA itself is a daemon, the pods it controls are just API objects as far it knows and can be anything on any platform. As for compiling a VPA container for Windows, I wouldn't expect any problems, you'll just need to build it yourself since we don't provide one.

Run Linux containers in an Azure DevOps Windows hosted build agent

I'm using Azure DevOps, and have a Linux build pipeline (ubuntu-16.04) setup that builds the code, starts containers with Docker Compose, then runs integration tests using the containers. This all works great.
Now I want to setup a Windows build pipline that does the same thing. However, with both the windows-2019 and win-1803 images, when I do docker stack up, I get this error message:
image operating system "linux" cannot be used on this platform
So, I guess Docker is installed in Windows mode, and thought to switch it to Linux containers using:
DockerCli.exe" -SwitchLinuxEngine
or
"%ProgramFiles%\Docker\Docker\DockerCli.exe" -SwitchLinuxEngine
However, the DockerCli.exe executable doesn't seem to be installed at all.
The only 2 things I can think of are:
Setup a self-hosted build agent
Somehow start the required containers somewhere else
But both of these will be a lot of work to setup, which I really don't need, neither do I want the running costs, or the job of maintaining it.
Are there any workarounds to run Linux containers on hosted Windows build agents?
Run Linux containers in an Azure DevOps Windows hosted build agent
Firstly, see the images listed which installed on Windows hosted agent: Docker images in Windows hosted agent. Docker EE on Server does not support Linux containers at all. So, it is impossible to build Linux docker image on Hosted Win-1803 agent. It can only build Windows docker image.
Until now, the only two workarounds is using self-hosted agent which based on Windows machine, or run a build which has two separate agent jobs(Pass the build artifacts back and forth between one agent job which run on Hosted Linux agent and the other is running on Hosted Windows agent) .
But since these two workarounds are all not convenient for you, there will not any other work around can achieve what you want.
In addition, there has a such suggestion feature raised on our official forum: Support for Docker with Linux Containers on Windows (LCOW) on hosted agent pool . You could vote and comment there, our Product Group team will review these suggestions regularly and consider taking it as Developer Roadmap. If this feature can be true, I think it will be very convenient to build Linux Container and without considering about which agent can only support.

Can Docker Desktop for Windows Point To Remote Docker Engine?

I am unable to run linux containers as I run Docker in my development vm which has visual studio installed and I have not been ablt to get it working yet as it is an unsupported scenario and many of the google solutions have unfortunately not resolved it for me.
However, I was thinking that maybe I could keep Docker Desktop running on my dev vm (so that VS would be happy it was still "local") but actually have the Docker engine/daemon bit running on a remote host where linux containers actually work - is it possible to repoint Docker Desktop for Windows to a Docker engine on a remote host?
Apologies if my terminology is rubbish, I am new to Docker. Also, I have done some searching and have seen articles and messages talking about docker machine and DOCKER_HOST environment variables, but I cannot see anything yet that applies to Docker Desktop (e.g. I don't have that env variable set on my docker windows vm so maybe it doesn't use that mechanism).
Thanks in advance

Docker ubuntu image with web server installed explicitly vs docker web server image?

What is the difference between Docker os image with web server installed with a web server and Docker webserver image ?
For eg Docker image of Ubuntu-16.04 running as container with NginX installed and other container running Nginx as Nginx Docker image?
Whose Performance will be better and stable ?
Usually a container with nginx runs in alpine os . a very lightweight os. While in the other hand you have ubuntu os and nginx.
So , the difference? ... the OS.
If you have good Docker/Unix/shell-scripting skills, a continuous-integration (CI) system, and the willingness to do ongoing maintenance, you might prefer building your own images. You will be in control of the exact version of the software used, and any build options or extensions required, and you will control when it gets security patches. But, this is a harder path to get started with, and if you don't periodically update your custom images they'll never get any sort of bug fixes or security patches at all.
If you're new to this space, you might prefer standard Docker Hub images. They're pre-packaged, usually have "enough" customization options, and are generally fairly good quality. But, if you need some extra customization, you might wind up needing to build a custom image anyways. I've also run into a situation where I've pinned an image to a specific upstream version image:1.2.3, and noticed several months later that image:1.2.7 is out, and the six-month-old Docker Hub image hasn't gotten a critical security fix because it's not getting built any more.
If none of this especially concerns you (and if you don't have a DevOps team at your disposal), I'd suggest just using the prebuilt nginx image and focusing on building and deploying your actual application.

Create a dev/test cloud on a box or two

So I have a similar question to Recommended setup for a "hom dev cloud"? I want to run VM's on an old desktop basically. Everything I've seen for installing EC2 eucalyptus or openstack has been on bare metal. I tried to install on ISO on a vm, but it wouldn't install to a VM. Is it possible to have test environment on one server where I can programmatically spin up vms as I would with a public cloud?
Thanks!
Since you are interested in deploying your cloud as a VM, you should also consider Apache Cloudstack. Have a look at DevCloud for a VM image.
It appears this will work for openstack http://devstack.org/guides/single-vm.html. Is there anything similar for ec2 eucalyptus?
For eucalyptus you could take a look at eucadev:
http://sigtt.in/articles/2013/11/25/introducing-eucadev/

Resources