mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-09 03:57:41 +00:00
coreos/azure: Simplify etcd, use Weave 0.10.0
This commit is contained in:
parent
2532fe56c3
commit
d8f839bb72
@ -32,14 +32,14 @@ coreos:
|
|||||||
Description=etcd 2
|
Description=etcd 2
|
||||||
Documentation=https://github.com/coreos/etcd/
|
Documentation=https://github.com/coreos/etcd/
|
||||||
[Service]
|
[Service]
|
||||||
Environment=ETCD_NAME=%host%
|
Environment=ETCD_NAME=%H
|
||||||
Environment=ETCD_INITIAL_CLUSTER_TOKEN=etcd-cluster
|
Environment=ETCD_INITIAL_CLUSTER_TOKEN=etcd-cluster
|
||||||
Environment=ETCD_INITIAL_ADVERTISE_PEER_URLS=http://%host%:2380
|
Environment=ETCD_INITIAL_ADVERTISE_PEER_URLS=http://%H:2380
|
||||||
Environment=ETCD_LISTEN_PEER_URLS=http://%host%:2380
|
Environment=ETCD_LISTEN_PEER_URLS=http://%H:2380
|
||||||
Environment=ETCD_LISTEN_CLIENT_URLS=http://0.0.0.0:2379,http://0.0.0.0:4001
|
Environment=ETCD_LISTEN_CLIENT_URLS=http://0.0.0.0:2379,http://0.0.0.0:4001
|
||||||
Environment=ETCD_ADVERTISE_CLIENT_URLS=http://%host%:2379,http://%host%:4001
|
Environment=ETCD_ADVERTISE_CLIENT_URLS=http://%H:2379,http://%H:4001
|
||||||
Environment=ETCD_INITIAL_CLUSTER=%cluster%
|
|
||||||
Environment=ETCD_INITIAL_CLUSTER_STATE=new
|
Environment=ETCD_INITIAL_CLUSTER_STATE=new
|
||||||
|
Environment=ETCD_INITIAL_CLUSTER=etcd-00=http://etcd-00:2380,etcd-01=http://etcd-01:2380,etcd-02=http://etcd-02:2380
|
||||||
ExecStart=/opt/bin/etcd2
|
ExecStart=/opt/bin/etcd2
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=10
|
RestartSec=10
|
||||||
|
@ -120,7 +120,7 @@ coreos:
|
|||||||
Before=weave-helper.service
|
Before=weave-helper.service
|
||||||
Before=docker.service
|
Before=docker.service
|
||||||
Description=Install Weave
|
Description=Install Weave
|
||||||
Documentation=http://zettio.github.io/weave/
|
Documentation=http://weaveworks.github.io/weave/
|
||||||
Requires=network-online.target
|
Requires=network-online.target
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
@ -129,7 +129,7 @@ coreos:
|
|||||||
ExecStartPre=/usr/bin/curl \
|
ExecStartPre=/usr/bin/curl \
|
||||||
--silent \
|
--silent \
|
||||||
--location \
|
--location \
|
||||||
https://github.com/weaveworks/weave/releases/download/v0.9.0/weave \
|
https://github.com/weaveworks/weave/releases/download/latest_release/weave \
|
||||||
--output /opt/bin/weave
|
--output /opt/bin/weave
|
||||||
ExecStartPre=/usr/bin/curl \
|
ExecStartPre=/usr/bin/curl \
|
||||||
--silent \
|
--silent \
|
||||||
@ -150,7 +150,7 @@ coreos:
|
|||||||
After=install-weave.service
|
After=install-weave.service
|
||||||
After=docker.service
|
After=docker.service
|
||||||
Description=Weave Network Router
|
Description=Weave Network Router
|
||||||
Documentation=http://zettio.github.io/weave/
|
Documentation=http://weaveworks.github.io/weave/
|
||||||
Requires=docker.service
|
Requires=docker.service
|
||||||
Requires=install-weave.service
|
Requires=install-weave.service
|
||||||
[Service]
|
[Service]
|
||||||
@ -165,13 +165,12 @@ coreos:
|
|||||||
After=install-weave.service
|
After=install-weave.service
|
||||||
After=docker.service
|
After=docker.service
|
||||||
Description=Weave Network Router
|
Description=Weave Network Router
|
||||||
Documentation=http://zettio.github.io/weave/
|
Documentation=http://weaveworks.github.io/weave/
|
||||||
Requires=docker.service
|
Requires=docker.service
|
||||||
Requires=install-weave.service
|
Requires=install-weave.service
|
||||||
[Service]
|
[Service]
|
||||||
EnvironmentFile=/etc/weave.%H.env
|
EnvironmentFile=/etc/weave.%H.env
|
||||||
ExecStartPre=/usr/bin/docker pull zettio/weave:latest
|
ExecStartPre=/opt/bin/weave setup
|
||||||
ExecStartPre=/usr/bin/docker pull zettio/weavetools:latest
|
|
||||||
ExecStartPre=/opt/bin/weave launch $WEAVE_PEERS
|
ExecStartPre=/opt/bin/weave launch $WEAVE_PEERS
|
||||||
ExecStart=/usr/bin/docker attach weave
|
ExecStart=/usr/bin/docker attach weave
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
|
@ -8,23 +8,10 @@ var cloud_config = require('../cloud_config.js');
|
|||||||
exports.create_etcd_cloud_config = function (node_count, conf) {
|
exports.create_etcd_cloud_config = function (node_count, conf) {
|
||||||
var input_file = './cloud_config_templates/kubernetes-cluster-etcd-node-template.yml';
|
var input_file = './cloud_config_templates/kubernetes-cluster-etcd-node-template.yml';
|
||||||
|
|
||||||
var peers = [ ];
|
|
||||||
for (var i = 0; i < node_count; i++) {
|
|
||||||
peers.push(util.hostname(i, 'etcd') + '=http://' + util.hostname(i, 'etcd') + ':2380');
|
|
||||||
}
|
|
||||||
var cluster = peers.join(',');
|
|
||||||
|
|
||||||
return _(node_count).times(function (n) {
|
return _(node_count).times(function (n) {
|
||||||
var output_file = util.join_output_file_path('kubernetes-cluster-etcd-node-' + n, 'generated.yml');
|
var output_file = util.join_output_file_path('kubernetes-cluster-etcd-node-' + n, 'generated.yml');
|
||||||
|
|
||||||
return cloud_config.process_template(input_file, output_file, function(data) {
|
return cloud_config.process_template(input_file, output_file, function(data) {
|
||||||
for (var i = 0; i < data.coreos.units.length; i++) {
|
|
||||||
var unit = data.coreos.units[i];
|
|
||||||
if (unit.name === 'etcd2.service') {
|
|
||||||
unit.content = _.replaceAll(_.replaceAll(unit.content, '%host%', util.hostname(n, 'etcd')), '%cluster%', cluster);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return data;
|
return data;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user