Docker swarm deploy to Azure - azure

I have problem with Azure - i am missing Docker for azure CE in Microsoft Azure Marketplace. By this tutorial
https://docs.docker.com/docker-cloud/cloud-swarm/link-azure-swarm/#enable-your-azure-subscription-for-docker-cloud
it was there.
I followed the tutorial and i have local swarm running on my OS (which is Ubuntu). How can i deploy my local swarm to Azure some other way?
I cannot continue the tutorial.

Docker Cloud is shutting down in a few weeks, so I don't recommend using it or its custom OS builds. It's quite easy to build a Swarm with the "Docker for Azure" template, or by scratch by just creating Azure resources yourself and installing Docker on Ubuntu.

Related

Install Azure DevOps Test Agent in Azure Function App / Azure Container Instances to leverage sliced testing

I have been working on a requirement to run the automated tests (Test Plans/ Test Suites) in a test agent -
Requirements -
Leverage test slicing for Visual Studio automated tests with hosted azure containers
Run them on hosted cloud agents (Serverless/ACI or any) - since our tests access on-prem servers to execute tests, Express route has been configured and successful network has been established.
Options Tried
Tried with Setting up test agent on window container on-prem and locally -it worked fine, when I deploy the windows container test agent to ACI onto an existing VNET - I get the error -
Az Container create --- {{ to Existing Vnet }}
Tried the same above approach on Linux container(locally) - Unfortunately "Visual Studio Test Task is not supported" to run our automated tests. Hence felt no point of deploying Linux container agent image to ACI
Does Azuredevops support running automated tests from test plans on Linux/Ubuntu agent
Tried with function app - with ACR container image (which has test agent running) unfortunately its not supported for Windows containers to deploy on existing VNET
Every step that I took led me nowhere. Since we are planning to migrate all of our infra to Azure, our only solution is to run the tests on Cloud!
Is there a better way to run tests in hosted cloud to reduce time/cost?
Note - The only option I see is to to have a VM in existing Hybrid VNET or AKS in Hybrid VNet and run the test process in it.
Azure ACI does not support Windows Container in VNet, here you can see it:
Currently, only Linux containers are supported in a container group
deployed to a virtual network.
So ACI is not available for you when you want to deploy the image to the VNet. And the options you find are the only two solutions while the containers need to access the on-prem servers. Compare with the single VM, the AKS cluster will cost more, so I recommend you use the single VM.

How to deploy into a Service Fabric cluster using CLI

I want to deploy a container image onto Service Fabric cluster running on Azure. I have already pushed image on Azure Container Registry. Using command line interface, how can I deploy container image into Service Fabric Cluster running on Azure?
I looked at sfctl command but could not find anything helpful.
An easy way to do this is by using sfctl compose create.
With this command you deploy a container to the cluster by using a docker-compose file.
Getting started...

Azure App service with or without docker

I have some experience in using azure app services without docker. I did worked on k8 with docker. Now I am seeing an option to deploy containers in azure app services. As per my understanding app services internally use container and orchestration engine. Now someone can explain why this new docker option in azure app services? How it is going to help? When to use this option? Why I should bundle it as docker(extra effort eventhough it trivial)?
Azure App Service on Linux (Web App with built-in images)
The built-in image option running on Linux is an extension of a current Azure App Service offering, catering to developers who want to use FTP or GIT, deploy .NET Core, Node, PHP or Ruby applications to Azure App Service running on Linux
All of the built-in Docker images are open sourced on GitHub and available on DockerHub
Now someone can explain why this new docker option in the azure app
services?
Web App for Containers is catered more towards developers who want to have more control over, not just the code, but also the different packages, runtime framework, tooling etc. that are installed on their containers.
Customers of this offering prefer to package their code and dependencies into containers using various CI/CD systems like Jenkins, Maven, Travis CI or VSTS, alongside setting up continuous deployment webhooks with App Service.
This way you can easily deploy and run containerized applications that scale with your business.
How it is going to help?
This will make sure that the environment that you use locally, is
exactly the same as the one in the cloud.
Just pull container images from Docker Hub or a private Azure
Container Registry and Web App for Containers will deploy the containerized app with your preferred dependencies to production in seconds.
Automate and simplify your container image deployments through
continuous integration/continuous deployment (CI/CD) capabilities
with Docker Hub, Azure Container Registry, and Visual Studio Team
Services
Automatically scale vertically and horizontally based on application
needs. Granular scaling rules are available to handle peaks in
workload automatically while minimizing costs during off-peak times
When to use this option?
If you are so passionate/familiar with Docker/container then you can
use the Azure App service with the container.
If you are planning to host all your container in ACS(Azure Container
Service)/GitHub Repository then this service might be useful
You can refer to this blog for more details

Run docker container on azure

I have a simple docker container which runs just fine on my local machine. I was hoping to find an easy checklist how I could publish and run my docker container on Azure, but couldn't find one. I only found https://docs.docker.com/docker-for-azure/, but this document kind of leaves me alone when it comes to actually copy my local docker container to Azure. Isn't that supposed to be very easy? Can anybody point me in the right direction how to do this?
But it is really easy.. once you know where to find the docs :-). I would take the azure docs as a starting point as there are multiple options when it comes to hosting containers in Azure:
If you're looking for this...
Simplify the deployment, management, and operations of Kubernetes -> Azure Container Service (AKS)
Easily run containers on Azure with a single command -> Container Instances
Store and manage container images across all types of Azure deployments
-> Container Registry
Develop microservices and orchestrate containers on Windows or Linux
-> Service Fabric
Deploy web applications on Linux using containers
-> App Service
Based on your info I would suggest storing the image using the Azure Container Registry and host the container using Azure Container Instances. No need for a VM to manage this way.
There is an excellent tutorial you could follow (I skipped the first 1 step since it involves creating a docker image, you already have one)
Another complete guide of pushing your image to azure and create a running container can be found here.
The good thing about Azure Container Instances is that you only pay for what you actually use. The Azure Container Registry is a private image repository hosted in Azure, if course you could also use Docker Hub but using ACR makes it all really simple.
In order to run an image, you simply need to configure a new VM with the Docker Daemon. I personally found Azure's documentation to be pretty complex. Assuming you are not trying to scale your service across instances, I would recommend using docker-machine rather than the Azure guide.
docker-machine is a CLI tool published by the Docker team which automatically installs the Docker Daemon (and all the dependencies) on a host. So all you would need to do is input your Azure subscription and it will automatically create a VM configured appropriately.
In terms of publishing the image, Azure is probably not the right solution. I would recommend one of two things:
Use Docker Hub, which serves as a free hosted Docker image repository. You can simply push images to Docker Hub (or even have them built directly from your Git repository).
Configure a CD tool, such as TravisCI or CircleCI, and use these to build your image and push directly to your deployment.
To run your docker image inside ACI, You can use of Azure Container Registry.
Step0: Create Azure Container Registry
Step1: Include a Dockerfile in your application code
Step2: Build the code along with the Dockerfile with a tag and create a
Docker image ( docker build -t imagename:tag .)
Step3: Push the Docker image to Azure container Registry with a image name and tag.
Step4: Now create a ACI, while creating, choose the image type as private, provide the image name, tag, image registry login server, image registry username, image registry password ( these details can be found under access keys tab inside Azure Container Registry)
Step5: choose running os as linux, in network step you can give an dns name for your ACI, then click on review & create
Step6: once ACI gets created you can go to overview and you can see fqdn, using fqdn you can access your application running inside Azure Container Instance.

AKS: CI/CD pipeline using AKS

I'm trying to figure out the steps to setup CI/CD for an Asp.Net Core web application using AKS with VSTS. Are the steps described in https://learn.microsoft.com/en-us/vsts/build-release/apps/cd/azure/deploy-container-kubernetes valid for what I'm trying to do? Are windows container supported in AKS?
If your application is in ASP.Net Core, then you can host it in Linux as your code is platform independent. I have done this using Docker-file where your container is a self hosted app running on AKS.
VSTS provides a Inbuilt task to deploy to your AKS cluster in your build pipeline.
Windows support on k8s is better with Windows Server version 1709 which needs Kubernetes v1.9 (bleeding edge stable). See https://kubernetes.io/docs/getting-started-guides/windows/
Unfortunately, at this time, AKS preview only supports up to 1.8.2.
Frosty, if you can create a docker image out of your Windows machine, it can be pushed to the container registry and then deployed to Kubernetes cluster. Here are some links for reference:
Building and Pushing Windows container images: https://blog.docker.com/2016/09/build-your-first-docker-windows-server-container/
Install Azure CLI: https://learn.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest
Create Kubernetes cluster in AKS: https://coderise.io/kubernetes-cluster-on-azure-container-service/
Windows containers are in private preview in AKS (reference); you can sign up using this form.. You can run hybrid clusters (Linux+Windows, up to 1803) using acs-engine today.
The VSTS walkthrough you linked is valid; check also this one and this one.
Update: Windows support for AKS is still a work in progress.
Currently Windows container are only in private preview, and you need to enable it using Azure CLI do some steps, please refer this official docs: https://learn.microsoft.com/en-us/azure/aks/windows-container-cli. After you enable it, then you can check the 'Windows Container' option when you create node pool in your azure kubernete service account.

Resources