Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: azure w/ subscription and coreos option as env #20482

Merged
merged 1 commit into from
Feb 7, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/getting-started-guides/coreos/azure/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ Now, all you need to do is:
```

This script will provision a cluster suitable for production use, where there is a ring of 3 dedicated etcd nodes: 1 kubernetes master and 2 kubernetes nodes. The `kube-00` VM will be the master, your work loads are only to be deployed on the nodes, `kube-01` and `kube-02`. Initially, all VMs are single-core, to ensure a user of the free tier can reproduce it without paying extra. I will show how to add more bigger VMs later.
If you need to pass Azure specific options for the creation script you can do this via additional environment variables e.g.

```
AZ_SUBSCRIPTION=<id> AZ_LOCATION="East US" ./create-kubernetes-cluster.js
# or
AZ_VM_COREOS_CHANNEL=beta ./create-kubernetes-cluster.js
```

![VMs in Azure](initial_cluster.png)

Expand Down
24 changes: 18 additions & 6 deletions docs/getting-started-guides/coreos/azure/lib/azure_wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ var inspect = require('util').inspect;
var util = require('./util.js');

var coreos_image_ids = {
'stable': '2b171e93f07c4903bcad35bda10acf22__CoreOS-Stable-766.4.0',
'beta': '2b171e93f07c4903bcad35bda10acf22__CoreOS-Beta-766.4.0', // untested
'alpha': '2b171e93f07c4903bcad35bda10acf22__CoreOS-Alpha-815.0.0' // untested
'stable': '2b171e93f07c4903bcad35bda10acf22__CoreOS-Stable-835.12.0', // untested
'beta': '2b171e93f07c4903bcad35bda10acf22__CoreOS-Beta-899.6.0',
'alpha': '2b171e93f07c4903bcad35bda10acf22__CoreOS-Alpha-942.0.0' // untested
};

var conf = {};
Expand Down Expand Up @@ -159,11 +159,18 @@ var get_vm_size = function () {
}
}

var get_subscription= function () {
if (process.env['AZ_SUBSCRIPTION']) {
return '--subscription=' + process.env['AZ_SUBSCRIPTION'];
}
}

exports.queue_default_network = function () {
task_queue.push([
'network', 'vnet', 'create',
get_location(),
'--address-space=172.16.0.0',
get_subscription(),
conf.resources['vnet'],
]);
}
Expand All @@ -175,6 +182,7 @@ exports.queue_storage_if_needed = function() {
'storage', 'account', 'create',
'--type=LRS',
get_location(),
get_subscription(),
conf.resources['storage_account'],
]);
process.env['AZURE_STORAGE_ACCOUNT'] = conf.resources['storage_account'];
Expand All @@ -195,6 +203,7 @@ exports.queue_machines = function (name_prefix, coreos_update_channel, cloud_con
'--virtual-network-name=' + conf.resources['vnet'],
'--no-ssh-password',
'--ssh-cert=' + conf.resources['ssh_key']['pem'],
get_subscription(),
];

var cloud_config = cloud_config_creator(x, conf);
Expand All @@ -219,6 +228,9 @@ exports.queue_machines = function (name_prefix, coreos_update_channel, cloud_con
if (conf.resizing && n < conf.old_size) {
return [];
} else {
if (process.env['AZ_VM_COREOS_CHANNEL']) {
coreos_update_channel = process.env['AZ_VM_COREOS_CHANNEL']
}
return vm_create_base_args.concat(next_host(n), [
coreos_image_ids[coreos_update_channel], 'core',
]);
Expand Down Expand Up @@ -249,11 +261,11 @@ exports.destroy_cluster = function (state_file) {

conf.destroying = true;
task_queue = _.map(conf.hosts, function (host) {
return ['vm', 'delete', '--quiet', '--blob-delete', host.name];
return ['vm', 'delete', '--quiet', '--blob-delete', host.name, get_subscription()];
});

task_queue.push(['network', 'vnet', 'delete', '--quiet', conf.resources['vnet']]);
task_queue.push(['storage', 'account', 'delete', '--quiet', conf.resources['storage_account']]);
task_queue.push(['network', 'vnet', 'delete', '--quiet', conf.resources['vnet'], get_subscription()]);
task_queue.push(['storage', 'account', 'delete', '--quiet', conf.resources['storage_account'], get_subscription()]);

exports.run_task_queue();
};
Expand Down