40
How to manage Microsoft Azure with open source Taehee Jang Ubuntu Korea Community Adviser Microsoft MVP (Cloud and Datacenter Management) 2017-09-16

How to manage Azure with open source

Embed Size (px)

Citation preview

Page 1: How to manage Azure with open source

How to manage Microsoft Azure with open source

Taehee Jang

Ubuntu Korea Community Adviser

Microsoft MVP (Cloud and Datacenter Management)

2017-09-16

Page 2: How to manage Azure with open source

List

• Bash on Ubuntu on Windows – “grep” command

• Azure CLI 2.0 – Changed installation method & Basic usage

• Juju – What is Juju?

• Run Docker on Bash on Ubuntu on Windows

Page 3: How to manage Azure with open source

1. grep

Page 4: How to manage Azure with open source

Entire grep commands) https://www.gnu.org/software/grep/manual/grep.html

Page 5: How to manage Azure with open source

grep

Find text by using grep

grep 'some text' /etc/ssh/sshd_config

grep 'word' file1 file2 file3

Show texts except lines which contain specific characters

grep -v "#" /etc/apache2/sites-available/default-ssl.conf

Source) https://www.tecmint.com/12-practical-examples-of-linux-grep-command/

Page 6: How to manage Azure with open source

grep

Use with pipe

cat /etc/ssh/sshd_config | grep 'some text'

dpkg -l | grep -i python

Show with sentences before or after searched texts

ifconfig | grep -A 4 eth0

ifconfig | grep -B 2 UP

Source) https://www.tecmint.com/12-practical-examples-of-linux-grep-command/

Page 7: How to manage Azure with open source

grep

Search texts including subdirectories

grep –r “function” ./*

Count matched texts

ifconfig | grep –c inet6

Source) https://www.tecmint.com/12-practical-examples-of-linux-grep-command/

Page 8: How to manage Azure with open source

grep

Search words inside gzip file

zgrep –i error /var/log/syslog.2.gz

grep with regular expressions

grep –E → egrep

grep with simple strings

grep –F → fgrep

Source) https://www.tecmint.com/12-practical-examples-of-linux-grep-command/

Page 9: How to manage Azure with open source

2. Azure CLI 2.0

Page 10: How to manage Azure with open source

Azure CLI 2.0

▪ Written in JavaScript with Node.js -> Python

• Support : Ubuntu, Debian, CentOS, Redhat, OpenSUSE, and Mac

• Required : python libssl-dev libffi-dev python-dev build-essential

• Remove 1.0 before install 2.0

• curl -L https://aka.ms/InstallAzureCli | bash -> exec -l $SHELL

Page 11: How to manage Azure with open source

Install Azure CLI 2.0(Linux / WSL)

echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ wheezy main" | sudo tee /etc/apt/sources.list.d/azure-cli.list

sudo apt-key adv --keyserver packages.microsoft.com --recv-keys 417A0893

sudo apt-get install apt-transport-https

sudo apt-get update && sudo apt-get install azure-cli

Source) https://docs.microsoft.com/ko-kr/cli/azure/install-azure-cli?view=azure-cli-latest#install-on-windowsSource) https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest#install-on-windows

Page 12: How to manage Azure with open source

Start Azure CLI 2.0

Page 13: How to manage Azure with open source

Start Azure CLI 2.0

az group create –name <group name> --location <region>

az network vnet create –resource-group <group name> --name <network name> --address-prefix <IP class> --subnet-name <subnet name> --subnet-prefix <IP class>

az vm create –n <vm name> –g <group name> --image “<OS>” –size <vm size>

Page 14: How to manage Azure with open source

Source) https://docs.microsoft.com/en-us/cli/azure/?view=azure-cli-latest#az_configure

Page 15: How to manage Azure with open source

3. What is Juju?

Page 16: How to manage Azure with open source
Page 17: How to manage Azure with open source
Page 18: How to manage Azure with open source
Page 19: How to manage Azure with open source
Page 20: How to manage Azure with open source
Page 21: How to manage Azure with open source

Support Clouds

Page 22: How to manage Azure with open source

Model, Charm, Bundle

Charm Model

Page 23: How to manage Azure with open source

Select My Cloud and Region

See public clouds list

juju clouds

Show clouds with regions

juju regions azure or juju show-cloud azure

Set my default cloud region

juju set-default-region azure koreacentral

Page 24: How to manage Azure with open source

Add Credentials to My Device

Add my juju credential to Bash on Ubuntu on Windows

juju add-credential azure

Enter credential name: <Name as I want>

Select auth-type: <Automatically set to interactive type if vacant>

Enter subscription-id: <My subscription id when “az login”>

Page 25: How to manage Azure with open source
Page 26: How to manage Azure with open source

Add Controllers to My Cloud

Create juju state server(controller) on Azure

juju bootstrap azure <My controller name>

You can make multiple controllers and add other companies’ cloud.

Remove controller

destroy-controller <Controller name I created>

Page 27: How to manage Azure with open source
Page 28: How to manage Azure with open source

Execute Juju GUI and Login

Connect Juju GUI URL

juju gui

Check my username and password for Juju GUI login

juju show-controller --show-password

Page 29: How to manage Azure with open source

Deploy Charm(Service) and Relate Charms

Type CLI command or search the charm on charm store

juju deploy <service as you want>

Connect between charms(services)

juju add-relation <charm 1> <charm 2>

Expose public IP for external access

juju expose <charm name to expose>

Page 30: How to manage Azure with open source

Configure Charms

Page 31: How to manage Azure with open source

SSH

How to access a specific unit

juju ssh <application name/unit number>

User command, Relation debugging

juju debug-hooks

Page 32: How to manage Azure with open source

For more information, please visit https://cloudbase.it/juju/

Page 33: How to manage Azure with open source

Juju Charms for Windows (12 Services)

Storage Spaces Direct

Nova – Hyper-VSQL Server Express

Cinder

Active Directory SharePoint Exchange Server

SQL Server AlwaysOn

Windows File ServerScale-Out File Server

Virtual DesktopInfrastructure (VDI)

Windows Server Failover Clustering

Windows Server Update Services

For more information, please visit https://cloudbase.it/juju/

Page 34: How to manage Azure with open source

Others

Check log for Juju charms

juju debug-log

Check deployed machine and charm status

juju status

Update cloud region changes

update-clouds

Page 35: How to manage Azure with open source

4. Docker & Bash on Ubuntu on Windows

Page 36: How to manage Azure with open source

Run Docker on Bash on Ubuntu on Windows

Install Docker for Windows

Source) https://blog.jayway.com/2017/04/19/running-docker-on-bash-on-windows/

Page 37: How to manage Azure with open source

Run Docker on Bash on Ubuntu on Windows

vim ~/.bashrc and add 2 lines

PATH="$HOME/bin:$HOME/.local/bin:$PATH"

PATH="$PATH:/mnt/c/Program\ Files/Docker/Docker/resources/bin“

Install packages to add https repository

# apt install apt-transport-https ca-certificates curl \

software-properties-common

Source) https://blog.jayway.com/2017/04/19/running-docker-on-bash-on-windows/

Page 38: How to manage Azure with open source

Run Docker on Bash on Ubuntu on Windows

Add Docker’s official GPG key

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudoapt-key add –

Add repository

# add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable“

Install Docker

sudo apt update && sudo apt install docker-ce

Source) https://blog.jayway.com/2017/04/19/running-docker-on-bash-on-windows/

Page 39: How to manage Azure with open source

Run Docker on Bash on Ubuntu on Windows

Enable “Expose daemon on tcp://localhost:2375 without TLS” on Docker

Source) https://blog.jayway.com/2017/04/19/running-docker-on-bash-on-windows/

Page 40: How to manage Azure with open source

Run Docker on Bash on Ubuntu on Windows

Connect Docker on WSL to Docker on Windows

echo "export DOCKER_HOST='tcp://0.0.0.0:2375'" >> ~/.bashrc

source ~/.bashrc

Check Docker works

Source) https://blog.jayway.com/2017/04/19/running-docker-on-bash-on-windows/