Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
* dev:
  v0.3.2
  • Loading branch information
rimusz committed Jun 2, 2015
2 parents 1783c12 + 822d4dd commit 3873b60
Show file tree
Hide file tree
Showing 17 changed files with 335 additions and 95 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ CoreOS-Vagrant Cluster GUI for OS X
============================

CoreOS-Vagrant Cluster GUI for Mac OS X is a Mac Status bar App which works like a wrapper around the [coreos-vagrant](https://github.com/coreos/coreos-vagrant) command line tool and bootstraps CoreOS cluster with one control (etcd) and two worker machines. Flannel network is set too.

Now supports etcd2.

[CoreOS](https://coreos.com) is a Linux distribution made specifically to run [Docker](https://www.docker.io/) containers.
[CoreOS-Vagrant](https://github.com/coreos/coreos-vagrant) is made to run on VirtualBox and VMWare VMs.
Expand All @@ -17,7 +19,7 @@ How to install
----------

Required software
* [VirtualBox for Mac OS X hosts](https://www.virtualbox.org/wiki/Downloads), [Vagrant for Mac OS X](http://www.vagrantup.com/downloads.html) and [iTerm 2](http://www.iterm2.com/#/section/downloads)
* [VirtualBox](https://www.virtualbox.org/wiki/Downloads), [Vagrant](http://www.vagrantup.com/downloads.html) and [iTerm 2](http://www.iterm2.com/#/section/downloads)

* Download `CoreOS Cluster GUI latest.zip` from the [Releases Page](https://github.com/rimusz/coreos-osx-gui-cluster/releases) and unzip it.
* Start the `CoreOS Cluster GUI` and from menu `Setup` choose `Initial setup of CoreOS-Vagrant Cluster`
Expand Down Expand Up @@ -45,9 +47,11 @@ Just start `CoreOS Cluster GUI` application and you will find a small icon with
3) fleetctl endpoint - export FLEETCTL_ENDPOINT=http://172.17.9.101:4001
````

* `Updates/Force CoreOS update` will be run `sudo update_engine_client -update` on each CoreOS VM.
* `Updates/Check for updates` will update etcdclt and fleetctl OS X clients to the same versions as CoreOS VMs run.
* `SSH to control-01 and node-01/02` menu options will open VM shells.
* Updates/Update OS X fleetctl and etcdclt will update fleetctl, etcdclt clients to the same versions as CoreOS VMs run.
* Updates/Force CoreOS update will be run sudo update_engine_client -update on each CoreOS VM.
* Updates/Check updates for CoreOS vbox will update CoreOS VM vagrant box.
* [Fleet-UI](http://fleetui.com) dashboard will show running fleet units and etc


Other links
Expand Down
Binary file modified coreos-vagrant-cluster-gui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion src/CoreOS Cluster GUI.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
01741B63190DB80500BB1F91 /* first-init.command in Resources */ = {isa = PBXBuildFile; fileRef = 01741B62190DB80500BB1F91 /* first-init.command */; };
01741B65190DB81400BB1F91 /* vagrant_up.command in Resources */ = {isa = PBXBuildFile; fileRef = 01741B64190DB81400BB1F91 /* vagrant_up.command */; };
01741B67190DB82100BB1F91 /* update.command in Resources */ = {isa = PBXBuildFile; fileRef = 01741B66190DB82100BB1F91 /* update.command */; };
01A496AC1B1E607C00F12072 /* update_vbox.command in Resources */ = {isa = PBXBuildFile; fileRef = 01A496AB1B1E607C00F12072 /* update_vbox.command */; };
01AD94B81A277708009A400B /* gsed in Resources */ = {isa = PBXBuildFile; fileRef = 01AD94B71A277708009A400B /* gsed */; };
01AD94BF1A278C94009A400B /* force_coreos_update.command in Resources */ = {isa = PBXBuildFile; fileRef = 01AD94BE1A278C94009A400B /* force_coreos_update.command */; };
01D3685918E5C184006510B5 /* icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = 01D3685818E5C184006510B5 /* icon.icns */; };
Expand Down Expand Up @@ -51,6 +52,7 @@
01741B62190DB80500BB1F91 /* first-init.command */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "first-init.command"; sourceTree = SOURCE_ROOT; };
01741B64190DB81400BB1F91 /* vagrant_up.command */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = vagrant_up.command; sourceTree = SOURCE_ROOT; };
01741B66190DB82100BB1F91 /* update.command */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = update.command; sourceTree = SOURCE_ROOT; };
01A496AB1B1E607C00F12072 /* update_vbox.command */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = update_vbox.command; sourceTree = "<group>"; };
01AD94B71A277708009A400B /* gsed */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; path = gsed; sourceTree = SOURCE_ROOT; };
01AD94BE1A278C94009A400B /* force_coreos_update.command */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = force_coreos_update.command; sourceTree = "<group>"; };
01D3685818E5C184006510B5 /* icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = icon.icns; sourceTree = "<group>"; };
Expand Down Expand Up @@ -95,8 +97,8 @@
01F83FF91A803C2F00961E07 /* Vagrantfiles */,
016A37F01A3F96710062386D /* fleet */,
01AD94B71A277708009A400B /* gsed */,
01741B56190DB7B800BB1F91 /* coreos-vagrant-install.command */,
01F83FF51A803BB800961E07 /* wget */,
01741B56190DB7B800BB1F91 /* coreos-vagrant-install.command */,
01741B62190DB80500BB1F91 /* first-init.command */,
);
path = "Installation Files";
Expand Down Expand Up @@ -180,6 +182,7 @@
01741B64190DB81400BB1F91 /* vagrant_up.command */,
011BBA3E1A2A94A100AAB35B /* vagrant_reload.command */,
01AD94BE1A278C94009A400B /* force_coreos_update.command */,
01A496AB1B1E607C00F12072 /* update_vbox.command */,
01741B66190DB82100BB1F91 /* update.command */,
);
name = Scripts;
Expand Down Expand Up @@ -261,6 +264,7 @@
01E2854818A6C4E300BC630D /* InfoPlist.strings in Resources */,
01F83FF31A803BA900961E07 /* vagrant_node1.command in Resources */,
01D3685918E5C184006510B5 /* icon.icns in Resources */,
01A496AC1B1E607C00F12072 /* update_vbox.command in Resources */,
01E285B818A6D7F400BC630D /* icon.png in Resources */,
01AD94BF1A278C94009A400B /* force_coreos_update.command in Resources */,
0145318418FF209D007F9C95 /* coreos-vagrant.command in Resources */,
Expand Down
15 changes: 14 additions & 1 deletion src/CoreOS Cluster GUI/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ - (IBAction)Restart:(id)sender {
- (IBAction)updates:(id)sender {
// send a notification on to the screen
NSUserNotification *notification = [[NSUserNotification alloc] init];
notification.title = @"coreos-vagrant, etcdclt and fleetctl will be updated";
notification.title = @"OS X etcdclt and fleetctl will be updated";
[[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification];

NSString *appName = [[NSString alloc] init];
Expand All @@ -150,6 +150,19 @@ - (IBAction)updates:(id)sender {
// NSLog(@"Apps arguments: '%@'", [_resoucesPathFromApp stringByAppendingPathComponent:@"update.command"]);
}

- (IBAction)updateVbox:(id)sender {
// send a notification on to the screen
NSUserNotification *notification = [[NSUserNotification alloc] init];
notification.title = @"CoreOS vbox";
notification.informativeText = @"will be updated";
[[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification];

NSString *appName = [[NSString alloc] init];
NSString *arguments = [[NSString alloc] init];
[self runApp:appName = @"iTerm" arguments:arguments = [_resoucesPathFromApp stringByAppendingPathComponent:@"update_vbox.command"]];
// NSLog(@"Apps arguments: '%@'", [_resoucesPathFromApp stringByAppendingPathComponent:@"update.command"]);
}

- (IBAction)force_coreos_update:(id)sender {
// send a notification on to the screen
NSUserNotification *notification = [[NSUserNotification alloc] init];
Expand Down
28 changes: 18 additions & 10 deletions src/CoreOS Cluster GUI/Base.lproj/MainMenu.xib
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="6254" systemVersion="14C109" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="7706" systemVersion="14E26a" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="6254"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="7706"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
Expand Down Expand Up @@ -685,12 +685,6 @@
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="jV7-Ne-Ped"/>
<menuItem title="OS Shell" id="dvF-TI-XNx">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="runShell:" target="494" id="2YL-Ek-k33"/>
</connections>
</menuItem>
<menuItem title="SSH to control-01" id="uFv-AR-Egm">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
Expand All @@ -709,6 +703,14 @@
<action selector="runNode2:" target="494" id="UCO-hw-Msg"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="UJa-g7-ThK"/>
<menuItem title="OS Shell" id="dvF-TI-XNx">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="runShell:" target="494" id="2YL-Ek-k33"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="5rX-ih-coH"/>
<menuItem title="Fleet-UI" id="7cD-x6-wub">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
Expand All @@ -720,16 +722,22 @@
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Updates" id="DFA-8C-ne3">
<items>
<menuItem title="Update OS X fleetctl and etcdctl" id="sEE-aC-0Ob" userLabel="Update OS X fleetctl and etcdctl">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="updates:" target="494" id="3Va-Du-QFm"/>
</connections>
</menuItem>
<menuItem title="Force CoreOS Update" id="KYE-xq-LpJ" userLabel="Force CoreOS update">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="force_coreos_update:" target="494" id="0IT-Vl-bUB"/>
</connections>
</menuItem>
<menuItem title="Check for updates" id="sEE-aC-0Ob">
<menuItem title="Check updates for CoreOS vbox" id="dZ3-1h-bmr">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="updates:" target="494" id="3Va-Du-QFm"/>
<action selector="updateVbox:" target="494" id="2zu-0h-NDP"/>
</connections>
</menuItem>
</items>
Expand Down
4 changes: 2 additions & 2 deletions src/CoreOS Cluster GUI/CoreOS Cluster GUI-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.3.1</string>
<string>0.3.2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>106</string>
<string>111</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>LSMinimumSystemVersion</key>
Expand Down
51 changes: 37 additions & 14 deletions src/Vagrantfiles/user-data.control
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,46 @@
coreos:
update:
reboot-strategy: off
etcd:
addr: $public_ipv4:4001
bind-addr: 0.0.0.0
peer-addr: $public_ipv4:7001
cluster-active-size: 1
etcd-http-read-timeout: 86400
snapshot: true
etcd2:
name: control-01
initial-advertise-peer-urls: http://$private_ipv4:2380
initial-cluster-token: etcd01
initial-cluster: control-01=http://$private_ipv4:2380
initial-cluster-state: new
listen-peer-urls: http://$private_ipv4:2380,http://$private_ipv4:7001
listen-client-urls: http://0.0.0.0:2379,http://0.0.0.0:4001
advertise-client-urls: http://$public_ipv4:2379,http://$public_ipv4:4001
fleet:
public-ip: $public_ipv4
metadata: role=control
flannel:
interface: $public_ipv4
units:
- name: flanneld.service
command: start
drop-ins:
- name: 50-network-config.conf
content: |
[Unit]
Requires=etcd2.service
[Service]
ExecStartPre=/usr/bin/etcdctl set /coreos.com/network/config '{ "Network": "10.245.0.0/16" }'
command: start
- name: etcd.service
ExecStartPre=/usr/bin/etcdctl set /coreos.com/network/config '{"Network": "10.245.0.0/16", "Backend": {"Type": "vxlan"}}'
- name: etcd2.service
command: start
- name: fleet.service
command: start
- name: docker.service
command: start
drop-ins:
- name: 50-insecure-registry.conf
content: |
[Unit]
Requires=flanneld.service
After=flanneld.service
[Service]
Environment=DOCKER_OPTS='--insecure-registry="0.0.0.0/0"'

write_files:
- path: /etc/systemd/system/docker.service.d/50-insecure-registry.conf
content: |
[Service]
Environment=DOCKER_OPTS='--insecure-registry="0.0.0.0/0"'
- path: /home/core/.ssh/id_rsa
permissions: '0600'
owner: core:core
Expand Down Expand Up @@ -66,3 +79,13 @@ write_files:
owner: core:core
content: |
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDXxUqHedGkdM4L4ADKD5gHU/RJIhJH/ZOMcbz1ztmE9MYJevk/rQfm9T9g6tXyxBHnjaKcPDF8C+GfzrId7/Dx1f+DiSs0MH7Q0UvV9tD0GS0axqgCmDltYwaMGBVOnxYmUN9bvNiolC7/CNn3SjPoSkvj4OHMCf9bQlRdaIWAJSkoMcnNkhnN5vLAtwn/yOeAyHGlp705IMiRH2LlA2R6otmFHSQHrkGr/wpu0WJt27EBTIarFeei7dAHlUf1zhStry/OEyqwEKiEo+4fk4vPZXiNyKNklju/I1qFcbc8HwbDVzTtdlQCURQO4losDmQgFdI4wz1flOOrsK+1+vPb core@core-01
- path: /opt/bin/wupiao
permissions: '0755'
content: |
#!/bin/bash
# [w]ait [u]ntil [p]ort [i]s [a]ctually [o]pen
[ -n "$1" ] && \
until curl -o /dev/null -sIf http://${1}; do \
sleep 1 && echo .;
done;
exit $?
81 changes: 34 additions & 47 deletions src/Vagrantfiles/user-data.node
Original file line number Diff line number Diff line change
Expand Up @@ -3,59 +3,46 @@
coreos:
update:
reboot-strategy: off
etcd2:
listen-client-urls: http://0.0.0.0:2379,http://0.0.0.0:4001
advertise-client-urls: http://0.0.0.0:2379,http://0.0.0.0:4001
initial-cluster: control-01=http://172.17.9.101:2380
proxy: on
fleet:
etcd_servers: "http://172.17.9.101:4001"
public-ip: $public_ipv4
metadata: role=node
flannel:
interface: $public_ipv4
units:
- name: etcd.service
mask: true
- name: fleet.service
- name: flanneld.service
drop-ins:
- name: 50-network-config.conf
content: |
[Unit]
Requires=etcd2.service
[Service]
ExecStartPre=/usr/bin/etcdctl set /coreos.com/network/config '{"Network":"10.245.0.0/16", "Backend": {"Type": "vxlan"}}'
command: start
- name: flannel.service
- name: fleet.service
command: start
content: |
[Unit]
After=network-online.target
Wants=network-online.target
Description=flannel is an etcd backed overlay network for containers
[Service]
Type=notify
ExecStartPre=/usr/bin/mkdir -p /opt/bin
ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/k8s/flanneld
ExecStartPre=/usr/bin/chmod +x /opt/bin/flanneld
ExecStart=/opt/bin/flanneld --iface=eth1 --etcd-endpoints http://172.17.9.101:4001
- name: docker.service
command: start
content: |
[Unit]
After=flannel.service
Wants=flannel.service
Description=Docker Application Container Engine
Documentation=http://docs.docker.io
[Service]
EnvironmentFile=/run/flannel/subnet.env
ExecStartPre=/bin/mount --make-rprivate /
ExecStart=/usr/bin/docker -d --bip=${FLANNEL_SUBNET} --mtu=${FLANNEL_MTU} -H fd://
[Install]
WantedBy=multi-user.target
- name: setup-network-environment.service
command: start
content: |
[Unit]
Description=Setup Network Environment
Documentation=https://github.com/kelseyhightower/setup-network-environment
Requires=network-online.target
After=network-online.target
[Service]
ExecStartPre=-/usr/bin/mkdir -p /opt/bin
ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/k8s/setup-network-environment
ExecStartPre=/usr/bin/chmod +x /opt/bin/setup-network-environment
ExecStart=/opt/bin/setup-network-environment
RemainAfterExit=yes
Type=oneshot
drop-ins:
- name: 50-insecure-registry.conf
content: |
[Unit]
Requires=flanneld.service
After=flanneld.service
[Service]
Environment=DOCKER_OPTS='--insecure-registry="0.0.0.0/0"'
write_files:
- path: /etc/systemd/system/docker.service.d/50-insecure-registry.conf
content: |
[Service]
Environment=DOCKER_OPTS='--insecure-registry="0.0.0.0/0"'
- path: /opt/bin/wupiao
permissions: '0755'
content: |
#!/bin/bash
# [w]ait [u]ntil [p]ort [i]s [a]ctually [o]pen
[ -n "$1" ] && \
until curl -o /dev/null -sIf http://${1}; do \
sleep 1 && echo .;
done;
exit $?
1 change: 1 addition & 0 deletions src/coreos-vagrant-install.command
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
mkdir ~/coreos-osx-cluster/tmp
mkdir ~/coreos-osx-cluster/bin
mkdir ~/coreos-osx-cluster/fleet
mkdir ~/coreos-osx-cluster/my_fleet
mkdir -p ~/coreos-osx-cluster/control
mkdir -p ~/coreos-osx-cluster/workers

Expand Down
Loading

0 comments on commit 3873b60

Please sign in to comment.