Code Monkey home page Code Monkey logo

azure-linux's Introduction

P@'s Linux on Azure tutorials

Documentation and examples for how to leverage various linux technologies with Microsoft Azure.

I write tutorials with a bit of automation code about things I didn't see documented elsewhere, or where I want to add context and details to existing docs and blog posts. I also list a set of links to relevant docs or blog posts that I found useful.

Using the Dockerfile

I'm writing these tutorials on a Mac. They make use of many tools that are easy to install on Mac or Linux, but less so on Wndows: docker, python, pip, Azure Python SDK, Azure Cross platform CLI, docker machine,...

If you use these tutorials, there is a good chance that you have at least a Docker client installed on your machine. In order to make your life easier, this project has a Dockerfile that has all these tools and their dependencies installed.

I have built it as chanezon/azure-linux on docker hub.

It may not be up to date, since I haven't setup continuous integration yet.

One way of running the container is to provision an Ubuntu Docker VM from the Azure marketplace in the Azure portal, then ssh to it, and run the container from there.

docker run -ti chanezon/azure-linux

You are then root in /usr/src/app, where this project is checked out. You can follow the tutorial from there.

If you run this container from your personal machine, or have ssh or azure certs on the machine from which you run the container, you can also mount data volumes, and run the container as a command.

chanezon/azure-linux defines 2 volumes: /usr/data where you can mount the host directory where your azure certifcates are, and /root/.docker where you can mount a host directory where docker machine metadata will be persisted among several container runs. These 2 volumes allow you to use chanezon/azure-linux as a command, instead of opening a terminal in the container to do work.

This is an example of running docker machine from the container, mounting your ~/.ssh directory where your azure cert is, as well as mounting a local directory ~/.dockerindocker where machine is going to store your machine meta data, so that you can leverage them in future launches of the container.

docker run -v ~/.ssh:/usr/data -v ~/.dockerindocker:/root/.docker chanezon/azure-linux machine create -d azure --azure-subscription-id="9b5910a1...-8e79d5ea2841" --azure-subscription-cert="/usr/data/azure-cert.pem" pat

docker is installed in the container, so after this you can connect to your newly created docker host with:

MACHINE=$(docker run -v ~/.ssh:/usr/data -v ~/.dockerindocker:/root/.docker chanezon/azure-linux machine config pat)
docker run -v ~/.ssh:/usr/data -v ~/.dockerindocker:/root/.docker chanezon/azure-linux docker $MACHINE ps

One file you will need for a lot of this work is your Azure management certificate. See Azure CoreOS cluster deployment tool for how to generate it. If you generate it on another machine, you can either mount the directory where it is, if running on the same machine, or create it in the container with vi or cat, pasting from your client machine.

CoreOS

Tutorials

Interesting links

The main issue installing Kubernetes on Azure is networking: Kubernetes needs to assign 1 IP address per pod, which works fine on Google Cloud Platform, where advanced routing allows you to configure your VMs so that each get assigned a /24 address space. On Azure today, you need to leverage some kind of overlay network to accomplish that. There are different approaches in how to do this:

Ubuntu Core

Snappy Ubuntu Core is a minimal server image of Ubuntu, coupled with a transactional OS update mechanism, similar to CoreOS, and an application model inspired by mobile app stores called snappy. It was announced 12/9/2014, with initial support for Azure first.

Docker

Tutorials

Interesting links

I assume you already know Docker basics: there are plenty of resources and tutorials out there about it. If you don't, get started with @kartar's excellent book The Docker book - Containerization is the new virtualization, then read the official docs.

Here are resources to understand how Docker works internally, where it is going, and what kind of innovation is happening in different part of the ecosystem as it matures: orchestration, networking, storage, management and monitoring.

azure-linux's People

Contributors

carmstrong avatar chanezon avatar felixrieseberg avatar joernboeger avatar mboersma avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.