Core-os: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Thomas (Diskussion | Beiträge) (→temp) |
Thomas (Diskussion | Beiträge) |
||
| Zeile 3: | Zeile 3: | ||
*user-data | *user-data | ||
<pre> | <pre> | ||
| − | ... | + | coreos: |
| − | ... | + | etcd: |
| − | ... | + | addr: $public_ipv4:4001 |
| − | - name: | + | peer-addr: $public_ipv4:7001 |
| − | + | discovery: https://discovery.etcd.io/82b7fd25d7659e13ca0f479d3c18b1b2 | |
| − | + | etcd2: | |
| − | + | advertise-client-urls: http://$public_ipv4:2379 | |
| − | + | initial-advertise-peer-urls: http://$private_ipv4:2380 | |
| − | + | listen-client-urls: http://0.0.0.0:2379,http://0.0.0.0:4001 | |
| − | + | listen-peer-urls: http://$private_ipv4:2380,http://$private_ipv4:7001 | |
| − | + | discovery: https://discovery.etcd.io/82b7fd25d7659e13ca0f479d3c18b1b2 | |
| + | fleet: | ||
| + | public-ip: $public_ipv4 | ||
| + | flannel: | ||
| + | interface: $public_ipv4 | ||
| + | units: | ||
| + | - name: etcd.service | ||
| + | command: start | ||
| + | - name: fleet.service | ||
| + | command: start | ||
| + | - name: docker-tcp.socket | ||
| + | command: start | ||
| + | enable: true | ||
| + | content: | | ||
| + | [Unit] | ||
| + | Description=Docker Socket for the API | ||
| − | + | [Socket] | |
| − | + | ListenStream=2375 | |
| + | Service=docker.service | ||
| + | BindIPv6Only=both | ||
| − | + | [Install] | |
| − | + | WantedBy=sockets.target | |
| + | - name: httpd.service | ||
| + | command: start | ||
| + | enable: true | ||
| + | content: "[Unit]\nDescription=httpd\nRequires=docker.service\nAfter=docker.service\n\n[Service]\nExecStart=/usr/bin/docker | ||
| + | run -d -p 80:80 --name own-httpd httpd \n\n[Install]\nWantedBy=multi-user.target\n" | ||
</pre> | </pre> | ||
Version vom 23. April 2015, 10:17 Uhr
docker cluster
- user-data
coreos:
etcd:
addr: $public_ipv4:4001
peer-addr: $public_ipv4:7001
discovery: https://discovery.etcd.io/82b7fd25d7659e13ca0f479d3c18b1b2
etcd2:
advertise-client-urls: http://$public_ipv4:2379
initial-advertise-peer-urls: http://$private_ipv4:2380
listen-client-urls: http://0.0.0.0:2379,http://0.0.0.0:4001
listen-peer-urls: http://$private_ipv4:2380,http://$private_ipv4:7001
discovery: https://discovery.etcd.io/82b7fd25d7659e13ca0f479d3c18b1b2
fleet:
public-ip: $public_ipv4
flannel:
interface: $public_ipv4
units:
- name: etcd.service
command: start
- name: fleet.service
command: start
- name: docker-tcp.socket
command: start
enable: true
content: |
[Unit]
Description=Docker Socket for the API
[Socket]
ListenStream=2375
Service=docker.service
BindIPv6Only=both
[Install]
WantedBy=sockets.target
- name: httpd.service
command: start
enable: true
content: "[Unit]\nDescription=httpd\nRequires=docker.service\nAfter=docker.service\n\n[Service]\nExecStart=/usr/bin/docker
run -d -p 80:80 --name own-httpd httpd \n\n[Install]\nWantedBy=multi-user.target\n"
temp
cat user-data
#cloud-config
---
coreos:
etcd:
discovery: https://discovery.etcd.io/d90bc0dcab88d7b5e5e7504ed1df1890
addr: $public_ipv4:4001
peer-addr: $public_ipv4:7001
etcd2:
advertise-client-urls: http://$public_ipv4:2379
initial-advertise-peer-urls: http://$private_ipv4:2380
listen-client-urls: http://0.0.0.0:2379,http://0.0.0.0:4001
listen-peer-urls: http://$private_ipv4:2380,http://$private_ipv4:7001
discovery: https://discovery.etcd.io/d90bc0dcab88d7b5e5e7504ed1df1890
fleet:
public-ip: $public_ipv4
flannel:
interface: $public_ipv4
units:
- name: etcd.service
command: start
- name: fleet.service
command: start
cat confg.rb
$num_instances=3
$new_discovery_url="https://discovery.etcd.io/new?size=#{$num_instances}"
if File.exists?('user-data') && ARGV[0].eql?('up')
require 'open-uri'
require 'yaml'
token = open($new_discovery_url).read
data = YAML.load(IO.readlines('user-data')[1..-1].join)
if data['coreos'].key? 'etcd'
data['coreos']['etcd']['discovery'] = token
end
if data['coreos'].key? 'etcd2'
data['coreos']['etcd2']['discovery'] = token
end
yaml = YAML.dump(data)
File.open('user-data', 'w') { |file| file.write("#cloud-config\n\n#{yaml}") }
end
$update_channel='beta'
$expose_docker_tcp=2375
# Customize VMs
$vm_gui = true
#$vm_memory = 1024
#$vm_cpus = 1
- core@core-01 ~ $ cat CoreGi.service
[Unit]
Description=CoreGI
After=docker.service
Requires=docker.service
[Service]
EnvironmentFile=/etc/environment
User=core
TimeoutStartSec=0
ExecStartPre=-/usr/bin/docker kill coregi
ExecStartPre=-/usr/bin/docker rm coregi
ExecStartPre=/usr/bin/docker pull yodlr/coregi:latest
ExecStart=/usr/bin/docker run --name coregi \
-p 3000:3000 \
-v /usr/bin/fleetctl:/usr/bin/fleetctl \
yodlr/coregi:latest
ExecStop=/usr/bin/docker stop coregi
[X-Fleet]
Global=True
- fleetctl stop CoreGi.service
- fleetctl start CoreGi.service
- fleetctl destroy CoreGi.service
- fleetctl start CoreGi.service
- fleetctl list-units