├── .gitignore ├── LICENSE ├── README.md ├── coreos-vagrant-k8s-cluster-gui.png ├── k8s-multinode.png └── src ├── CoreOS k8s Cluster.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── CoreOS k8s Cluster ├── AppDelegate.h ├── AppDelegate.m ├── Base.lproj │ └── MainMenu.xib ├── CoreOS k8s Cluster-Info.plist ├── CoreOS k8s Cluster-Prefix.pch ├── CoreOS k8s Cluster.entitlements ├── Images.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── en.lproj │ ├── Credits.rtf │ └── InfoPlist.strings └── main.m ├── Vagrantfiles ├── user-data.control └── user-data.node ├── change_release_channel.command ├── coreos-vagrant-install.command ├── coreos-vagrant.command ├── first-init.command ├── fleet ├── fleet-ui.service ├── kube-apiserver.service ├── kube-controller-manager.service ├── kube-kubelet.service ├── kube-proxy.service └── kube-scheduler.service ├── force_coreos_update.command ├── gen_kubeconfig ├── gsed ├── icon.icns ├── icon.png ├── icon2.png ├── k8s ├── dashboard-controller.yaml ├── dashboard-service.yaml ├── download_k8s.command ├── kube-system-ns.yaml ├── kubectl ├── master.tgz ├── nodes.tgz ├── skydns-rc.yaml └── skydns-svc.yaml ├── kubectl ├── os_shell.command ├── update.command ├── update_k8s.command ├── update_vbox.command ├── vagrant_control1.command ├── vagrant_destroy.command ├── vagrant_node1.command ├── vagrant_node2.command ├── vagrant_reload.command ├── vagrant_up.command └── wget /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | xcuserdata 13 | *.xccheckout 14 | *.moved-aside 15 | DerivedData 16 | *.hmap 17 | *.ipa 18 | *.xcuserstate 19 | .DS_Store 20 | 21 | # CocoaPods 22 | # 23 | # We recommend against adding the Pods directory to your .gitignore. However 24 | # you should judge for yourself, the pros and cons are mentioned at: 25 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 26 | # 27 | # Pods/ 28 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | 203 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | CoreOS-Vagrant Kubernetes Cluster for OS X 2 | ============================ 3 | 4 | **Note:** This App is not much maintained anymore, please use it's alternative [Kube-Cluster for macOS](https://github.com/TheNewNormal/kube-cluster-osx) which is quicker to boot and does not need VirtualBox/Vagrant. 5 | 6 | ![k8s-multinode](k8s-multinode.png) 7 | 8 | `CoreOS-Vagrant Kubernetes Cluster GUI for Mac OS X` is a Mac Status bar App which works like a wrapper around [coreos-vagrant](https://github.com/coreos/coreos-vagrant) command line tool and bootstraps Kubernetes cluster with one master and two minions machines. 9 | 10 | **NEW:** Includes [Helm](https://helm.sh) - The Kubernetes Package Manager 11 | 12 | 13 | [CoreOS](https://coreos.com) is a Linux distribution made specifically to run [Docker](https://www.docker.io/) containers. 14 | [CoreOS-Vagrant](https://github.com/coreos/coreos-vagrant) is made to run on VirtualBox and VMWare VMs. 15 | 16 | ![CoreOS-Vagrant-Kubernetes-Cluster-GUI](coreos-vagrant-k8s-cluster-gui.png "CoreOS-Vagrant-Kubernetes-Cluster-GUI") 17 | 18 | Download 19 | -------- 20 | Head over to the [Releases Page](https://github.com/rimusz/coreos-osx-gui-kubernetes-cluster/releases) to grab the latest release. 21 | 22 | 23 | How to install 24 | ---------- 25 | 26 | Required software: 27 | * [VirtualBox](https://www.virtualbox.org/wiki/Downloads), [Vagrant](http://www.vagrantup.com/downloads.html) and [iTerm 2](http://www.iterm2.com/#/section/downloads) 28 | * Open downloaded dmg file and drag the App e.g. to your Desktop. 29 | * Start the `CoreOS k8s Cluster` App and from menu `Setup` and choose: `Initial setup of CoreOS-Vagrant k8s Cluster` 30 | 31 | The install will do the following: 32 | 33 | * All dependent files/folders will be put under `coreos-k8s-cluster` folder in the user's 34 | home folder 35 | * It will clone latest coreos-vagrant from git 36 | * user-data files will have fleet, etcd and flannel set 37 | * master machine will be set with IP `172.17.15.101` and two cluster nodes with IPs: `172.17.15.102 and 172.17.15.103` 38 | * It will download latest vagrant VBox and run `vagrant up` to initialise VM 39 | * When you first time install or do 'Up' after destroying k8s cluster, k8s binary files (with the version which was available when the App was built) get copied to CoreOS VMs, this speeds up k8s cluster setup. To update K8s cluster just run from menu 'Updates' - Update Kubernetes cluster and OS X kubectl. 40 | * It will install `fleetctl, etcdctl and kubectl` to `~/coreos-k8s-cluster/bin/` 41 | * Kubernetes services will be installed with fleet units which are placed in `~/coreos-k8s-cluster/fleet`, this allows very easy updates to fleet units if needed. 42 | * Also [DNS Add On](https://github.com/GoogleCloudPlatform/kubernetes/tree/master/cluster/addons/dns) will be installed 43 | 44 | How it works 45 | ------------ 46 | 47 | Just start `CoreOS k8s Cluster` application and you will find a small icon with the CoreOS logo with (K) which means for k8s cluster in the Status Bar. 48 | 49 | * There you can `Up`, `Suspend`, `Halt`, `Reload` CoreOS vagrant VMs 50 | * Under `Up` (first does 'vagrant up') and `OS Shell` OS Shell (terminal) will have such environment set: 51 | ```` 52 | 1) kubernetes master - export KUBERNETES_MASTER=http://172.17.15.101:8080 53 | 2) etcd endpoint - export ETCDCTL_PEERS=http://172.17.15.101:4001 54 | 3) fleetctl endpoint - export FLEETCTL_ENDPOINT=http://172.17.15.101:4001 55 | 4) fleetctl driver - export FLEETCTL_DRIVER=etcd 56 | 5) Path to ~/coreos-osx-cluster/bin where etcdctl, fleetctl and kubernetes binaries are stored 57 | ```` 58 | 59 | * `Updates/Update Kubernetes cluster and OS X kubectl` will update to latest version of Kubernetes. 60 | * `Updates/Update OS X fleetctl, etcdclt and fleet units` will update fleetctl, etcdclt clients to the same versions as CoreOS VMs run and to latest fleet units if the new version of App is used. 61 | * `Updates/Force CoreOS update` will be run `sudo update_engine_client -update` on each CoreOS VM. 62 | * `Updates/Check updates for CoreOS vbox` will update CoreOS VM vagrant box. 63 | * 64 | * `SSH to k8smaster01 and k8snode-01/02` menu options will open VM shells 65 | * `node1/2 cAdvisor` will open cAdvisor URL in default browser 66 | * [Fleet-UI](http://fleetui.com) dashboard will show running fleet units and etc 67 | * [Kubernetes-UI](https://github.com/GoogleCloudPlatform/kubernetes/tree/master/www) (contributed by [Kismatic.io](http://kismatic.io/)) will show nice Kubernetes Dashboard, where you can check Nodes, Pods, Replication Controllers and etc. 68 | 69 | 70 | 71 | Example ouput of succesfull CoreOS + Kubernetes cluster install: 72 | 73 | ```` 74 | $ 75 | etcd cluster: 76 | /registry 77 | /coreos.com 78 | 79 | fleetctl list-machines: 80 | MACHINE IP METADATA 81 | 9b88a46c... 172.17.15.103 role=node 82 | d0c68677... 172.17.15.102 role=node 83 | f93b555e... 172.17.15.101 role=control 84 | 85 | fleetctl list-units: 86 | UNIT MACHINE ACTIVE SUB 87 | fleet-ui.service f93b555e.../172.17.15.101 active running 88 | kube-apiserver.service f93b555e.../172.17.15.101 active running 89 | kube-controller-manager.service f93b555e.../172.17.15.101 active running 90 | kube-kubelet.service 9b88a46c.../172.17.15.103 active running 91 | kube-kubelet.service d0c68677.../172.17.15.102 active running 92 | kube-proxy.service 9b88a46c.../172.17.15.103 active running 93 | kube-proxy.service d0c68677.../172.17.15.102 active running 94 | kube-scheduler.service f93b555e.../172.17.15.101 active running 95 | 96 | k8s nodes list: 97 | NAME LABELS STATUS 98 | 172.17.15.102 node=worker1 Ready 99 | 172.17.15.103 node=worker2 Ready 100 | 101 | ```` 102 | 103 | 104 | 105 | 106 | Usage 107 | ------------ 108 | 109 | You're now ready to use Kubernetes cluster. 110 | 111 | Some examples to start with [Kubernetes examples](https://github.com/GoogleCloudPlatform/kubernetes/blob/master/examples/). 112 | 113 | Other links 114 | ----------- 115 | * A solo Kubernetes Cluster VM App can be found here [Kube-Solo for OS X](https://github.com/rimusz/kube-solo-osx). 116 | 117 | * A standalone one CoreOS VM App (good for docker images building and testing) can be found here [CoreOS VM for OS X](https://github.com/rimusz/coreos-osx). 118 | 119 | * Cluster one without Kubernetes CoreOS VM App can be found here [CoreOS-Vagrant Cluster for OS X](https://github.com/rimusz/coreos-osx-cluster). 120 | -------------------------------------------------------------------------------- /coreos-vagrant-k8s-cluster-gui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rimusz/coreos-kubernetes-cluster-osx/6fa4a44846f8df02ab0d2f24737179c0a5a8924d/coreos-vagrant-k8s-cluster-gui.png -------------------------------------------------------------------------------- /k8s-multinode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rimusz/coreos-kubernetes-cluster-osx/6fa4a44846f8df02ab0d2f24737179c0a5a8924d/k8s-multinode.png -------------------------------------------------------------------------------- /src/CoreOS k8s Cluster.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 47; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 011146541A7D848C008E0FB2 /* icon2.png in Resources */ = {isa = PBXBuildFile; fileRef = 011146531A7D848C008E0FB2 /* icon2.png */; }; 11 | 011146561A7D9AF7008E0FB2 /* wget in Resources */ = {isa = PBXBuildFile; fileRef = 011146551A7D9AF7008E0FB2 /* wget */; }; 12 | 011BBA341A2A7B0600AAB35B /* vagrant_node1.command in Resources */ = {isa = PBXBuildFile; fileRef = 011BBA321A2A7B0600AAB35B /* vagrant_node1.command */; }; 13 | 011BBA351A2A7B0600AAB35B /* vagrant_node2.command in Resources */ = {isa = PBXBuildFile; fileRef = 011BBA331A2A7B0600AAB35B /* vagrant_node2.command */; }; 14 | 011BBA391A2A829F00AAB35B /* vagrant_destroy.command in Resources */ = {isa = PBXBuildFile; fileRef = 011BBA381A2A829F00AAB35B /* vagrant_destroy.command */; }; 15 | 011BBA3B1A2A842A00AAB35B /* change_release_channel.command in Resources */ = {isa = PBXBuildFile; fileRef = 011BBA3A1A2A842A00AAB35B /* change_release_channel.command */; }; 16 | 011BBA3F1A2A94A100AAB35B /* vagrant_reload.command in Resources */ = {isa = PBXBuildFile; fileRef = 011BBA3E1A2A94A100AAB35B /* vagrant_reload.command */; }; 17 | 0145318418FF209D007F9C95 /* coreos-vagrant.command in Resources */ = {isa = PBXBuildFile; fileRef = 0145318318FF209D007F9C95 /* coreos-vagrant.command */; }; 18 | 01689B731A2D1A260099CB78 /* fleet in Resources */ = {isa = PBXBuildFile; fileRef = 01689B721A2D1A260099CB78 /* fleet */; }; 19 | 01689B771A2D1CA80099CB78 /* Vagrantfiles in Resources */ = {isa = PBXBuildFile; fileRef = 01689B761A2D1CA80099CB78 /* Vagrantfiles */; }; 20 | 01741B57190DB7B800BB1F91 /* coreos-vagrant-install.command in Resources */ = {isa = PBXBuildFile; fileRef = 01741B56190DB7B800BB1F91 /* coreos-vagrant-install.command */; }; 21 | 01741B5F190DB7E300BB1F91 /* vagrant_control1.command in Resources */ = {isa = PBXBuildFile; fileRef = 01741B5E190DB7E300BB1F91 /* vagrant_control1.command */; }; 22 | 01741B63190DB80500BB1F91 /* first-init.command in Resources */ = {isa = PBXBuildFile; fileRef = 01741B62190DB80500BB1F91 /* first-init.command */; }; 23 | 01741B65190DB81400BB1F91 /* vagrant_up.command in Resources */ = {isa = PBXBuildFile; fileRef = 01741B64190DB81400BB1F91 /* vagrant_up.command */; }; 24 | 01741B67190DB82100BB1F91 /* update.command in Resources */ = {isa = PBXBuildFile; fileRef = 01741B66190DB82100BB1F91 /* update.command */; }; 25 | 01AD94B81A277708009A400B /* gsed in Resources */ = {isa = PBXBuildFile; fileRef = 01AD94B71A277708009A400B /* gsed */; }; 26 | 01AD94BF1A278C94009A400B /* force_coreos_update.command in Resources */ = {isa = PBXBuildFile; fileRef = 01AD94BE1A278C94009A400B /* force_coreos_update.command */; }; 27 | 01BB60D11AB74A680069BF30 /* update_k8s.command in Resources */ = {isa = PBXBuildFile; fileRef = 01BB60D01AB74A680069BF30 /* update_k8s.command */; }; 28 | 01BB60D31AB74AE60069BF30 /* k8s in Resources */ = {isa = PBXBuildFile; fileRef = 01BB60D21AB74AE60069BF30 /* k8s */; }; 29 | 01D3685918E5C184006510B5 /* icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = 01D3685818E5C184006510B5 /* icon.icns */; }; 30 | 01D415791AB6EDD000738471 /* update_vbox.command in Resources */ = {isa = PBXBuildFile; fileRef = 01D415781AB6EDD000738471 /* update_vbox.command */; }; 31 | 01E2853E18A6C4E300BC630D /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 01E2853D18A6C4E300BC630D /* Cocoa.framework */; }; 32 | 01E2854818A6C4E300BC630D /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 01E2854618A6C4E300BC630D /* InfoPlist.strings */; }; 33 | 01E2854A18A6C4E300BC630D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 01E2854918A6C4E300BC630D /* main.m */; }; 34 | 01E2854E18A6C4E300BC630D /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 01E2854C18A6C4E300BC630D /* Credits.rtf */; }; 35 | 01E2855118A6C4E300BC630D /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 01E2855018A6C4E300BC630D /* AppDelegate.m */; }; 36 | 01E2855418A6C4E300BC630D /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 01E2855218A6C4E300BC630D /* MainMenu.xib */; }; 37 | 01E2855618A6C4E300BC630D /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 01E2855518A6C4E300BC630D /* Images.xcassets */; }; 38 | 01E285B818A6D7F400BC630D /* icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 01E285B718A6D7F400BC630D /* icon.png */; }; 39 | 01F0282C1A7C54C8008C37AA /* os_shell.command in Resources */ = {isa = PBXBuildFile; fileRef = 01F0282B1A7C54C8008C37AA /* os_shell.command */; }; 40 | 13325B721BE4CFA400D19C75 /* kubectl in Resources */ = {isa = PBXBuildFile; fileRef = 13325B711BE4CFA400D19C75 /* kubectl */; }; 41 | 13325B741BE4CFEE00D19C75 /* gen_kubeconfig in Resources */ = {isa = PBXBuildFile; fileRef = 13325B731BE4CFEE00D19C75 /* gen_kubeconfig */; }; 42 | /* End PBXBuildFile section */ 43 | 44 | /* Begin PBXFileReference section */ 45 | 011146531A7D848C008E0FB2 /* icon2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon2.png; sourceTree = ""; }; 46 | 011146551A7D9AF7008E0FB2 /* wget */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; path = wget; sourceTree = SOURCE_ROOT; }; 47 | 011BBA321A2A7B0600AAB35B /* vagrant_node1.command */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = vagrant_node1.command; sourceTree = ""; }; 48 | 011BBA331A2A7B0600AAB35B /* vagrant_node2.command */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = vagrant_node2.command; sourceTree = ""; }; 49 | 011BBA381A2A829F00AAB35B /* vagrant_destroy.command */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = vagrant_destroy.command; sourceTree = ""; }; 50 | 011BBA3A1A2A842A00AAB35B /* change_release_channel.command */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = change_release_channel.command; sourceTree = ""; }; 51 | 011BBA3E1A2A94A100AAB35B /* vagrant_reload.command */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = vagrant_reload.command; sourceTree = ""; }; 52 | 0133608F18A70E0C0024B1CB /* CoreOS k8s Cluster.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = "CoreOS k8s Cluster.entitlements"; sourceTree = ""; }; 53 | 0145318318FF209D007F9C95 /* coreos-vagrant.command */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "coreos-vagrant.command"; sourceTree = ""; }; 54 | 01689B721A2D1A260099CB78 /* fleet */ = {isa = PBXFileReference; lastKnownFileType = folder; path = fleet; sourceTree = SOURCE_ROOT; }; 55 | 01689B761A2D1CA80099CB78 /* Vagrantfiles */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Vagrantfiles; sourceTree = SOURCE_ROOT; }; 56 | 01741B56190DB7B800BB1F91 /* coreos-vagrant-install.command */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "coreos-vagrant-install.command"; sourceTree = SOURCE_ROOT; }; 57 | 01741B5E190DB7E300BB1F91 /* vagrant_control1.command */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = vagrant_control1.command; sourceTree = SOURCE_ROOT; }; 58 | 01741B62190DB80500BB1F91 /* first-init.command */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "first-init.command"; sourceTree = SOURCE_ROOT; }; 59 | 01741B64190DB81400BB1F91 /* vagrant_up.command */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = vagrant_up.command; sourceTree = SOURCE_ROOT; }; 60 | 01741B66190DB82100BB1F91 /* update.command */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = update.command; sourceTree = SOURCE_ROOT; }; 61 | 01AD94B71A277708009A400B /* gsed */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; path = gsed; sourceTree = SOURCE_ROOT; }; 62 | 01AD94BE1A278C94009A400B /* force_coreos_update.command */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = force_coreos_update.command; sourceTree = ""; }; 63 | 01BB60D01AB74A680069BF30 /* update_k8s.command */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = update_k8s.command; sourceTree = ""; }; 64 | 01BB60D21AB74AE60069BF30 /* k8s */ = {isa = PBXFileReference; lastKnownFileType = folder; path = k8s; sourceTree = SOURCE_ROOT; }; 65 | 01D3685818E5C184006510B5 /* icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = icon.icns; sourceTree = ""; }; 66 | 01D415781AB6EDD000738471 /* update_vbox.command */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = update_vbox.command; sourceTree = ""; }; 67 | 01E2853A18A6C4E300BC630D /* CoreOS k8s Cluster.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "CoreOS k8s Cluster.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 68 | 01E2853D18A6C4E300BC630D /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; 69 | 01E2854018A6C4E300BC630D /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; 70 | 01E2854118A6C4E300BC630D /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; 71 | 01E2854218A6C4E300BC630D /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 72 | 01E2854518A6C4E300BC630D /* CoreOS k8s Cluster-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "CoreOS k8s Cluster-Info.plist"; sourceTree = ""; }; 73 | 01E2854718A6C4E300BC630D /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 74 | 01E2854918A6C4E300BC630D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 75 | 01E2854B18A6C4E300BC630D /* CoreOS k8s Cluster-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "CoreOS k8s Cluster-Prefix.pch"; sourceTree = ""; }; 76 | 01E2854D18A6C4E300BC630D /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = en.lproj/Credits.rtf; sourceTree = ""; }; 77 | 01E2854F18A6C4E300BC630D /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 78 | 01E2855018A6C4E300BC630D /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 79 | 01E2855318A6C4E300BC630D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; 80 | 01E2855518A6C4E300BC630D /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 81 | 01E2855C18A6C4E300BC630D /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 82 | 01E285B718A6D7F400BC630D /* icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon.png; sourceTree = ""; }; 83 | 01F0282B1A7C54C8008C37AA /* os_shell.command */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = os_shell.command; sourceTree = ""; }; 84 | 13325B711BE4CFA400D19C75 /* kubectl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = kubectl; sourceTree = SOURCE_ROOT; }; 85 | 13325B731BE4CFEE00D19C75 /* gen_kubeconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = gen_kubeconfig; sourceTree = SOURCE_ROOT; }; 86 | /* End PBXFileReference section */ 87 | 88 | /* Begin PBXFrameworksBuildPhase section */ 89 | 01E2853718A6C4E300BC630D /* Frameworks */ = { 90 | isa = PBXFrameworksBuildPhase; 91 | buildActionMask = 2147483647; 92 | files = ( 93 | 01E2853E18A6C4E300BC630D /* Cocoa.framework in Frameworks */, 94 | ); 95 | runOnlyForDeploymentPostprocessing = 0; 96 | }; 97 | /* End PBXFrameworksBuildPhase section */ 98 | 99 | /* Begin PBXGroup section */ 100 | 014E6F8B18B63AF700E697C0 /* Installation Files */ = { 101 | isa = PBXGroup; 102 | children = ( 103 | 01BB60D21AB74AE60069BF30 /* k8s */, 104 | 01689B761A2D1CA80099CB78 /* Vagrantfiles */, 105 | 01689B721A2D1A260099CB78 /* fleet */, 106 | 01AD94B71A277708009A400B /* gsed */, 107 | 011146551A7D9AF7008E0FB2 /* wget */, 108 | 13325B711BE4CFA400D19C75 /* kubectl */, 109 | 13325B731BE4CFEE00D19C75 /* gen_kubeconfig */, 110 | 01741B56190DB7B800BB1F91 /* coreos-vagrant-install.command */, 111 | 01741B62190DB80500BB1F91 /* first-init.command */, 112 | ); 113 | path = "Installation Files"; 114 | sourceTree = ""; 115 | }; 116 | 01E2853118A6C4E300BC630D = { 117 | isa = PBXGroup; 118 | children = ( 119 | 01E285D018A6F79800BC630D /* Images */, 120 | 01E2854318A6C4E300BC630D /* CoreOS k8s Cluster */, 121 | 014E6F8B18B63AF700E697C0 /* Installation Files */, 122 | 01E285B918A6E23C00BC630D /* Scripts */, 123 | 01E2853C18A6C4E300BC630D /* Frameworks */, 124 | 01E2853B18A6C4E300BC630D /* Products */, 125 | ); 126 | sourceTree = ""; 127 | }; 128 | 01E2853B18A6C4E300BC630D /* Products */ = { 129 | isa = PBXGroup; 130 | children = ( 131 | 01E2853A18A6C4E300BC630D /* CoreOS k8s Cluster.app */, 132 | ); 133 | name = Products; 134 | sourceTree = ""; 135 | }; 136 | 01E2853C18A6C4E300BC630D /* Frameworks */ = { 137 | isa = PBXGroup; 138 | children = ( 139 | 01E2853D18A6C4E300BC630D /* Cocoa.framework */, 140 | 01E2855C18A6C4E300BC630D /* XCTest.framework */, 141 | 01E2853F18A6C4E300BC630D /* Other Frameworks */, 142 | ); 143 | name = Frameworks; 144 | sourceTree = ""; 145 | }; 146 | 01E2853F18A6C4E300BC630D /* Other Frameworks */ = { 147 | isa = PBXGroup; 148 | children = ( 149 | 01E2854018A6C4E300BC630D /* AppKit.framework */, 150 | 01E2854118A6C4E300BC630D /* CoreData.framework */, 151 | 01E2854218A6C4E300BC630D /* Foundation.framework */, 152 | ); 153 | name = "Other Frameworks"; 154 | sourceTree = ""; 155 | }; 156 | 01E2854318A6C4E300BC630D /* CoreOS k8s Cluster */ = { 157 | isa = PBXGroup; 158 | children = ( 159 | 0133608F18A70E0C0024B1CB /* CoreOS k8s Cluster.entitlements */, 160 | 01E2854F18A6C4E300BC630D /* AppDelegate.h */, 161 | 01E2855018A6C4E300BC630D /* AppDelegate.m */, 162 | 01E2855218A6C4E300BC630D /* MainMenu.xib */, 163 | 01E2855518A6C4E300BC630D /* Images.xcassets */, 164 | 01E2854418A6C4E300BC630D /* Supporting Files */, 165 | ); 166 | path = "CoreOS k8s Cluster"; 167 | sourceTree = ""; 168 | }; 169 | 01E2854418A6C4E300BC630D /* Supporting Files */ = { 170 | isa = PBXGroup; 171 | children = ( 172 | 01E2854518A6C4E300BC630D /* CoreOS k8s Cluster-Info.plist */, 173 | 01E2854618A6C4E300BC630D /* InfoPlist.strings */, 174 | 01E2854918A6C4E300BC630D /* main.m */, 175 | 01E2854B18A6C4E300BC630D /* CoreOS k8s Cluster-Prefix.pch */, 176 | 01E2854C18A6C4E300BC630D /* Credits.rtf */, 177 | ); 178 | name = "Supporting Files"; 179 | sourceTree = ""; 180 | }; 181 | 01E285B918A6E23C00BC630D /* Scripts */ = { 182 | isa = PBXGroup; 183 | children = ( 184 | 01F0282B1A7C54C8008C37AA /* os_shell.command */, 185 | 0145318318FF209D007F9C95 /* coreos-vagrant.command */, 186 | 011BBA3A1A2A842A00AAB35B /* change_release_channel.command */, 187 | 011BBA381A2A829F00AAB35B /* vagrant_destroy.command */, 188 | 01741B5E190DB7E300BB1F91 /* vagrant_control1.command */, 189 | 011BBA321A2A7B0600AAB35B /* vagrant_node1.command */, 190 | 011BBA331A2A7B0600AAB35B /* vagrant_node2.command */, 191 | 01741B64190DB81400BB1F91 /* vagrant_up.command */, 192 | 011BBA3E1A2A94A100AAB35B /* vagrant_reload.command */, 193 | 01AD94BE1A278C94009A400B /* force_coreos_update.command */, 194 | 01D415781AB6EDD000738471 /* update_vbox.command */, 195 | 01BB60D01AB74A680069BF30 /* update_k8s.command */, 196 | 01741B66190DB82100BB1F91 /* update.command */, 197 | ); 198 | name = Scripts; 199 | sourceTree = ""; 200 | }; 201 | 01E285D018A6F79800BC630D /* Images */ = { 202 | isa = PBXGroup; 203 | children = ( 204 | 01E285B718A6D7F400BC630D /* icon.png */, 205 | 01D3685818E5C184006510B5 /* icon.icns */, 206 | 011146531A7D848C008E0FB2 /* icon2.png */, 207 | ); 208 | name = Images; 209 | sourceTree = ""; 210 | }; 211 | /* End PBXGroup section */ 212 | 213 | /* Begin PBXNativeTarget section */ 214 | 01E2853918A6C4E300BC630D /* CoreOS k8s Cluster */ = { 215 | isa = PBXNativeTarget; 216 | buildConfigurationList = 01E2856B18A6C4E300BC630D /* Build configuration list for PBXNativeTarget "CoreOS k8s Cluster" */; 217 | buildPhases = ( 218 | 01E2853618A6C4E300BC630D /* Sources */, 219 | 01E2853718A6C4E300BC630D /* Frameworks */, 220 | 01E2853818A6C4E300BC630D /* Resources */, 221 | ); 222 | buildRules = ( 223 | ); 224 | dependencies = ( 225 | ); 226 | name = "CoreOS k8s Cluster"; 227 | productName = "CoreOS k8s Cluster"; 228 | productReference = 01E2853A18A6C4E300BC630D /* CoreOS k8s Cluster.app */; 229 | productType = "com.apple.product-type.application"; 230 | }; 231 | /* End PBXNativeTarget section */ 232 | 233 | /* Begin PBXProject section */ 234 | 01E2853218A6C4E300BC630D /* Project object */ = { 235 | isa = PBXProject; 236 | attributes = { 237 | LastUpgradeCheck = 0710; 238 | ORGANIZATIONNAME = "Rimantas Mocevicius"; 239 | TargetAttributes = { 240 | 01E2853918A6C4E300BC630D = { 241 | DevelopmentTeam = 5LVLAZJPH7; 242 | SystemCapabilities = { 243 | com.apple.Sandbox = { 244 | enabled = 0; 245 | }; 246 | }; 247 | }; 248 | }; 249 | }; 250 | buildConfigurationList = 01E2853518A6C4E300BC630D /* Build configuration list for PBXProject "CoreOS k8s Cluster" */; 251 | compatibilityVersion = "Xcode 6.3"; 252 | developmentRegion = English; 253 | hasScannedForEncodings = 0; 254 | knownRegions = ( 255 | en, 256 | Base, 257 | ); 258 | mainGroup = 01E2853118A6C4E300BC630D; 259 | productRefGroup = 01E2853B18A6C4E300BC630D /* Products */; 260 | projectDirPath = ""; 261 | projectRoot = ""; 262 | targets = ( 263 | 01E2853918A6C4E300BC630D /* CoreOS k8s Cluster */, 264 | ); 265 | }; 266 | /* End PBXProject section */ 267 | 268 | /* Begin PBXResourcesBuildPhase section */ 269 | 01E2853818A6C4E300BC630D /* Resources */ = { 270 | isa = PBXResourcesBuildPhase; 271 | buildActionMask = 2147483647; 272 | files = ( 273 | 01E2854818A6C4E300BC630D /* InfoPlist.strings in Resources */, 274 | 011146541A7D848C008E0FB2 /* icon2.png in Resources */, 275 | 01D3685918E5C184006510B5 /* icon.icns in Resources */, 276 | 01689B771A2D1CA80099CB78 /* Vagrantfiles in Resources */, 277 | 01E285B818A6D7F400BC630D /* icon.png in Resources */, 278 | 01AD94BF1A278C94009A400B /* force_coreos_update.command in Resources */, 279 | 13325B741BE4CFEE00D19C75 /* gen_kubeconfig in Resources */, 280 | 0145318418FF209D007F9C95 /* coreos-vagrant.command in Resources */, 281 | 01741B65190DB81400BB1F91 /* vagrant_up.command in Resources */, 282 | 13325B721BE4CFA400D19C75 /* kubectl in Resources */, 283 | 011146561A7D9AF7008E0FB2 /* wget in Resources */, 284 | 011BBA391A2A829F00AAB35B /* vagrant_destroy.command in Resources */, 285 | 01BB60D11AB74A680069BF30 /* update_k8s.command in Resources */, 286 | 01E2855618A6C4E300BC630D /* Images.xcassets in Resources */, 287 | 011BBA341A2A7B0600AAB35B /* vagrant_node1.command in Resources */, 288 | 011BBA3F1A2A94A100AAB35B /* vagrant_reload.command in Resources */, 289 | 01AD94B81A277708009A400B /* gsed in Resources */, 290 | 01741B5F190DB7E300BB1F91 /* vagrant_control1.command in Resources */, 291 | 01741B63190DB80500BB1F91 /* first-init.command in Resources */, 292 | 01741B57190DB7B800BB1F91 /* coreos-vagrant-install.command in Resources */, 293 | 011BBA3B1A2A842A00AAB35B /* change_release_channel.command in Resources */, 294 | 01689B731A2D1A260099CB78 /* fleet in Resources */, 295 | 01BB60D31AB74AE60069BF30 /* k8s in Resources */, 296 | 01E2854E18A6C4E300BC630D /* Credits.rtf in Resources */, 297 | 01E2855418A6C4E300BC630D /* MainMenu.xib in Resources */, 298 | 01741B67190DB82100BB1F91 /* update.command in Resources */, 299 | 01D415791AB6EDD000738471 /* update_vbox.command in Resources */, 300 | 011BBA351A2A7B0600AAB35B /* vagrant_node2.command in Resources */, 301 | 01F0282C1A7C54C8008C37AA /* os_shell.command in Resources */, 302 | ); 303 | runOnlyForDeploymentPostprocessing = 0; 304 | }; 305 | /* End PBXResourcesBuildPhase section */ 306 | 307 | /* Begin PBXSourcesBuildPhase section */ 308 | 01E2853618A6C4E300BC630D /* Sources */ = { 309 | isa = PBXSourcesBuildPhase; 310 | buildActionMask = 2147483647; 311 | files = ( 312 | 01E2855118A6C4E300BC630D /* AppDelegate.m in Sources */, 313 | 01E2854A18A6C4E300BC630D /* main.m in Sources */, 314 | ); 315 | runOnlyForDeploymentPostprocessing = 0; 316 | }; 317 | /* End PBXSourcesBuildPhase section */ 318 | 319 | /* Begin PBXVariantGroup section */ 320 | 01E2854618A6C4E300BC630D /* InfoPlist.strings */ = { 321 | isa = PBXVariantGroup; 322 | children = ( 323 | 01E2854718A6C4E300BC630D /* en */, 324 | ); 325 | name = InfoPlist.strings; 326 | sourceTree = ""; 327 | }; 328 | 01E2854C18A6C4E300BC630D /* Credits.rtf */ = { 329 | isa = PBXVariantGroup; 330 | children = ( 331 | 01E2854D18A6C4E300BC630D /* en */, 332 | ); 333 | name = Credits.rtf; 334 | sourceTree = ""; 335 | }; 336 | 01E2855218A6C4E300BC630D /* MainMenu.xib */ = { 337 | isa = PBXVariantGroup; 338 | children = ( 339 | 01E2855318A6C4E300BC630D /* Base */, 340 | ); 341 | name = MainMenu.xib; 342 | sourceTree = ""; 343 | }; 344 | /* End PBXVariantGroup section */ 345 | 346 | /* Begin XCBuildConfiguration section */ 347 | 01E2856918A6C4E300BC630D /* Debug */ = { 348 | isa = XCBuildConfiguration; 349 | buildSettings = { 350 | ALWAYS_SEARCH_USER_PATHS = NO; 351 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 352 | CLANG_CXX_LIBRARY = "libc++"; 353 | CLANG_ENABLE_OBJC_ARC = YES; 354 | CLANG_WARN_BOOL_CONVERSION = YES; 355 | CLANG_WARN_CONSTANT_CONVERSION = YES; 356 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 357 | CLANG_WARN_EMPTY_BODY = YES; 358 | CLANG_WARN_ENUM_CONVERSION = YES; 359 | CLANG_WARN_INT_CONVERSION = YES; 360 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 361 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 362 | COPY_PHASE_STRIP = NO; 363 | ENABLE_TESTABILITY = YES; 364 | GCC_C_LANGUAGE_STANDARD = gnu99; 365 | GCC_DYNAMIC_NO_PIC = NO; 366 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 367 | GCC_OPTIMIZATION_LEVEL = 0; 368 | GCC_PREPROCESSOR_DEFINITIONS = ( 369 | "DEBUG=1", 370 | "$(inherited)", 371 | ); 372 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 373 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 374 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 375 | GCC_WARN_UNDECLARED_SELECTOR = YES; 376 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 377 | GCC_WARN_UNUSED_FUNCTION = YES; 378 | GCC_WARN_UNUSED_VARIABLE = YES; 379 | MACOSX_DEPLOYMENT_TARGET = 10.10; 380 | ONLY_ACTIVE_ARCH = YES; 381 | SDKROOT = macosx; 382 | }; 383 | name = Debug; 384 | }; 385 | 01E2856A18A6C4E300BC630D /* Release */ = { 386 | isa = XCBuildConfiguration; 387 | buildSettings = { 388 | ALWAYS_SEARCH_USER_PATHS = NO; 389 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 390 | CLANG_CXX_LIBRARY = "libc++"; 391 | CLANG_ENABLE_OBJC_ARC = YES; 392 | CLANG_WARN_BOOL_CONVERSION = YES; 393 | CLANG_WARN_CONSTANT_CONVERSION = YES; 394 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 395 | CLANG_WARN_EMPTY_BODY = YES; 396 | CLANG_WARN_ENUM_CONVERSION = YES; 397 | CLANG_WARN_INT_CONVERSION = YES; 398 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 399 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 400 | COPY_PHASE_STRIP = YES; 401 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 402 | ENABLE_NS_ASSERTIONS = NO; 403 | GCC_C_LANGUAGE_STANDARD = gnu99; 404 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 405 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 406 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 407 | GCC_WARN_UNDECLARED_SELECTOR = YES; 408 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 409 | GCC_WARN_UNUSED_FUNCTION = YES; 410 | GCC_WARN_UNUSED_VARIABLE = YES; 411 | MACOSX_DEPLOYMENT_TARGET = 10.10; 412 | SDKROOT = macosx; 413 | }; 414 | name = Release; 415 | }; 416 | 01E2856C18A6C4E300BC630D /* Debug */ = { 417 | isa = XCBuildConfiguration; 418 | buildSettings = { 419 | CLANG_ENABLE_OBJC_ARC = YES; 420 | CODE_SIGN_IDENTITY = "Developer ID Application"; 421 | "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Mac Developer"; 422 | COMBINE_HIDPI_IMAGES = YES; 423 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 424 | GCC_PREFIX_HEADER = "CoreOS k8s Cluster/CoreOS k8s Cluster-Prefix.pch"; 425 | INFOPLIST_FILE = "CoreOS k8s Cluster/CoreOS k8s Cluster-Info.plist"; 426 | LIBRARY_SEARCH_PATHS = ( 427 | "$(inherited)", 428 | "$(PROJECT_DIR)", 429 | ); 430 | MACOSX_DEPLOYMENT_TARGET = 10.9; 431 | PRODUCT_BUNDLE_IDENTIFIER = "net.linxos.${PRODUCT_NAME:rfc1034identifier}"; 432 | PRODUCT_NAME = "CoreOS k8s Cluster"; 433 | PROVISIONING_PROFILE = ""; 434 | WRAPPER_EXTENSION = app; 435 | }; 436 | name = Debug; 437 | }; 438 | 01E2856D18A6C4E300BC630D /* Release */ = { 439 | isa = XCBuildConfiguration; 440 | buildSettings = { 441 | CLANG_ENABLE_OBJC_ARC = YES; 442 | CODE_SIGN_IDENTITY = "Developer ID Application"; 443 | "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Mac Developer"; 444 | COMBINE_HIDPI_IMAGES = YES; 445 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 446 | GCC_PREFIX_HEADER = "CoreOS k8s Cluster/CoreOS k8s Cluster-Prefix.pch"; 447 | INFOPLIST_FILE = "CoreOS k8s Cluster/CoreOS k8s Cluster-Info.plist"; 448 | LIBRARY_SEARCH_PATHS = ( 449 | "$(inherited)", 450 | "$(PROJECT_DIR)", 451 | ); 452 | MACOSX_DEPLOYMENT_TARGET = 10.9; 453 | PRODUCT_BUNDLE_IDENTIFIER = "net.linxos.${PRODUCT_NAME:rfc1034identifier}"; 454 | PRODUCT_NAME = "CoreOS k8s Cluster"; 455 | PROVISIONING_PROFILE = ""; 456 | WRAPPER_EXTENSION = app; 457 | }; 458 | name = Release; 459 | }; 460 | /* End XCBuildConfiguration section */ 461 | 462 | /* Begin XCConfigurationList section */ 463 | 01E2853518A6C4E300BC630D /* Build configuration list for PBXProject "CoreOS k8s Cluster" */ = { 464 | isa = XCConfigurationList; 465 | buildConfigurations = ( 466 | 01E2856918A6C4E300BC630D /* Debug */, 467 | 01E2856A18A6C4E300BC630D /* Release */, 468 | ); 469 | defaultConfigurationIsVisible = 0; 470 | defaultConfigurationName = Release; 471 | }; 472 | 01E2856B18A6C4E300BC630D /* Build configuration list for PBXNativeTarget "CoreOS k8s Cluster" */ = { 473 | isa = XCConfigurationList; 474 | buildConfigurations = ( 475 | 01E2856C18A6C4E300BC630D /* Debug */, 476 | 01E2856D18A6C4E300BC630D /* Release */, 477 | ); 478 | defaultConfigurationIsVisible = 0; 479 | defaultConfigurationName = Release; 480 | }; 481 | /* End XCConfigurationList section */ 482 | }; 483 | rootObject = 01E2853218A6C4E300BC630D /* Project object */; 484 | } 485 | -------------------------------------------------------------------------------- /src/CoreOS k8s Cluster.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/CoreOS k8s Cluster/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // CoreOS Kubernetes Cluster for OS X 4 | // 5 | // Created by Rimantas on 01/12/2014. 6 | // Copyright (c) 2014 Rimantas Mocevicius. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface AppDelegate : NSObject 13 | 14 | @property (strong, nonatomic) IBOutlet NSMenu *statusMenu; 15 | @property (strong, nonatomic) NSStatusItem *statusItem; 16 | 17 | @property(strong) NSWindowController *myWindowController; 18 | 19 | @property(strong) NSString *resoucesPathFromApp; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /src/CoreOS k8s Cluster/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // CoreOS Kubernetes Cluster for OS X 4 | // 5 | // Created by Rimantas on 01/12/2014. 6 | // Copyright (c) 2014 Rimantas Mocevicius. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @implementation AppDelegate 12 | 13 | 14 | - (void)applicationDidFinishLaunching:(NSNotification *)aNotification 15 | { 16 | [[NSUserNotificationCenter defaultUserNotificationCenter] setDelegate:self]; 17 | 18 | self.statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSVariableStatusItemLength]; 19 | [self.statusItem setMenu:self.statusMenu]; 20 | [self.statusItem setImage: [NSImage imageNamed:@"icon"]]; 21 | [self.statusItem setHighlightMode:YES]; 22 | 23 | // get the App's main bundle path 24 | _resoucesPathFromApp = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@""]; 25 | NSLog(@"applicationDirectory: '%@'", _resoucesPathFromApp); 26 | 27 | NSString *home_folder = [NSHomeDirectory() stringByAppendingPathComponent:@"coreos-k8s-cluster"]; 28 | 29 | BOOL isDir; 30 | if([[NSFileManager defaultManager] fileExistsAtPath:home_folder isDirectory:&isDir] && isDir) 31 | // if coreos-k8s-cluster folder exists 32 | { 33 | // set resouces_path 34 | NSString *resources_content = _resoucesPathFromApp; 35 | NSData *fileContents1 = [resources_content dataUsingEncoding:NSUTF8StringEncoding]; 36 | [[NSFileManager defaultManager] createFileAtPath:[NSHomeDirectory() stringByAppendingPathComponent:@"coreos-k8s-cluster/.env/resouces_path"] 37 | contents:fileContents1 38 | attributes:nil]; 39 | 40 | // write to file App version 41 | NSString *version = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"]; 42 | NSData *app_version = [version dataUsingEncoding:NSUTF8StringEncoding]; 43 | [[NSFileManager defaultManager] createFileAtPath:[NSHomeDirectory() stringByAppendingPathComponent:@"coreos-k8s-cluster/.env/version"] 44 | contents:app_version 45 | attributes:nil]; 46 | [self checkVMStatus]; 47 | 48 | /* 49 | if([[NSFileManager defaultManager] fileExistsAtPath:[NSHomeDirectory() stringByAppendingPathComponent:@"coreos-k8s-cluster/.env/version"]] ) 50 | // if coreos-k8s-cluster/.env/version file exists 51 | { 52 | 53 | // check and set App verion 54 | // read version from file 55 | NSString *path = [NSHomeDirectory() stringByAppendingPathComponent:@"coreos-k8s-cluster/.env/version"]; 56 | NSString *content = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil]; 57 | NSLog(@"version file: '%@'", content); 58 | 59 | // get App version 60 | NSString *version = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"]; 61 | 62 | // compare versions 63 | if([content isEqualToString:version]) 64 | { 65 | // the same version 66 | NSLog(@"the same App version"); 67 | } 68 | else 69 | { 70 | // different version 71 | NSLog(@"not the same App version"); 72 | 73 | } 74 | 75 | // write to file 76 | // NSString *version = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"]; 77 | // NSString *app_version = [NSString stringWithFormat:@"%@", version]; 78 | // [self runScript:scriptName = @"set_version" arguments:arguments = app_version ]; 79 | 80 | // App was updated 81 | NSString *update_content = @"yes"; 82 | NSData *fileContents = [update_content dataUsingEncoding:NSUTF8StringEncoding]; 83 | [[NSFileManager defaultManager] createFileAtPath:[NSHomeDirectory() stringByAppendingPathComponent:@"coreos-k8s-cluster/.env/update"] 84 | contents:fileContents 85 | attributes:nil]; 86 | 87 | [self checkVMStatus]; 88 | } 89 | else 90 | { 91 | // write to file 92 | NSString *version = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"]; 93 | NSData *app_version = [version dataUsingEncoding:NSUTF8StringEncoding]; 94 | [[NSFileManager defaultManager] createFileAtPath:[NSHomeDirectory() stringByAppendingPathComponent:@"coreos-k8s-cluster/.env/version"] 95 | contents:app_version 96 | attributes:nil]; 97 | [self checkVMStatus]; 98 | } 99 | */ 100 | 101 | 102 | } 103 | else 104 | { 105 | NSAlert *alert = [[NSAlert alloc] init]; 106 | [alert addButtonWithTitle:@"OK"]; 107 | [alert addButtonWithTitle:@"Cancel"]; 108 | [alert setMessageText:@"CoreOS+Kubernetes Cluster was not set."]; 109 | [alert setInformativeText:@"Do you want to set it up?"]; 110 | [alert setAlertStyle:NSWarningAlertStyle]; 111 | 112 | if ([alert runModal] == NSAlertFirstButtonReturn) { 113 | // OK clicked 114 | [self initialInstall:self]; 115 | } 116 | else 117 | { 118 | // Cancel clicked 119 | NSString *msg = [NSString stringWithFormat:@"%@ ", @" 'Initial setup of CoreOS+Kubernetes Cluster' at any time later one !!! "]; 120 | [self displayWithMessage:@"You can set Kubernetes Cluster from menu 'Setup':" infoText:msg]; 121 | } 122 | } 123 | } 124 | 125 | 126 | - (IBAction)Start:(id)sender { 127 | 128 | NSString *home_folder = [NSHomeDirectory() stringByAppendingPathComponent:@"coreos-k8s-cluster"]; 129 | 130 | BOOL isDir; 131 | if([[NSFileManager defaultManager] 132 | fileExistsAtPath:home_folder isDirectory:&isDir] && isDir) 133 | { 134 | // send a notification on to the screen 135 | NSUserNotification *notification = [[NSUserNotification alloc] init]; 136 | notification.title = @"CoreOS+Kubernetes Cluster will be up shortly"; 137 | notification.informativeText = @"and OS shell will be opened"; 138 | [[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification]; 139 | 140 | NSString *appName = [[NSString alloc] init]; 141 | NSString *arguments = [[NSString alloc] init]; 142 | [self runApp:appName = @"iTerm" arguments:arguments = [_resoucesPathFromApp stringByAppendingPathComponent:@"vagrant_up.command"]]; 143 | } 144 | else 145 | { 146 | NSAlert *alert = [[NSAlert alloc] init]; 147 | [alert addButtonWithTitle:@"OK"]; 148 | [alert addButtonWithTitle:@"Cancel"]; 149 | [alert setMessageText:@"CoreOS+Kubernetes Cluster was not set."]; 150 | [alert setInformativeText:@"Do you want to set it up?"]; 151 | [alert setAlertStyle:NSWarningAlertStyle]; 152 | 153 | if ([alert runModal] == NSAlertFirstButtonReturn) { 154 | // OK clicked 155 | [self initialInstall:self]; 156 | } 157 | else 158 | { 159 | // Cancel clicked 160 | NSString *msg = [NSString stringWithFormat:@"%@ ", @" 'Initial setup of CoreOS+Kubernetes Cluster' at any time later one !!! "]; 161 | [self displayWithMessage:@"You can set Kubernetes Cluster from menu 'Setup':" infoText:msg]; 162 | } 163 | } 164 | } 165 | 166 | - (IBAction)Pause:(id)sender { 167 | // send a notification on to the screen 168 | NSUserNotification *notification = [[NSUserNotification alloc] init]; 169 | notification.informativeText = @"CoreOS+Kubernetes Cluster will be suspended"; 170 | [[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification]; 171 | 172 | NSString *scriptName = [[NSString alloc] init]; 173 | NSString *arguments = [[NSString alloc] init]; 174 | [self runScript:scriptName = @"coreos-vagrant" arguments:arguments = @"suspend"]; 175 | 176 | [self checkVMStatus]; 177 | } 178 | 179 | - (IBAction)Stop:(id)sender { 180 | // send a notification on to the screen 181 | NSUserNotification *notification = [[NSUserNotification alloc] init]; 182 | notification.informativeText = @"CoreOS+Kubernetes Cluster will be stopped"; 183 | [[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification]; 184 | 185 | NSString *scriptName = [[NSString alloc] init]; 186 | NSString *arguments = [[NSString alloc] init]; 187 | [self runScript:scriptName = @"coreos-vagrant" arguments:arguments = @"halt"]; 188 | 189 | [self checkVMStatus]; 190 | } 191 | 192 | - (IBAction)Restart:(id)sender { 193 | // send a notification on to the screen 194 | NSUserNotification *notification = [[NSUserNotification alloc] init]; 195 | notification.informativeText = @"CoreOS+Kubernetes Cluster will be reloaded"; 196 | [[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification]; 197 | 198 | NSString *appName = [[NSString alloc] init]; 199 | NSString *arguments = [[NSString alloc] init]; 200 | [self runApp:appName = @"iTerm" arguments:arguments = [_resoucesPathFromApp stringByAppendingPathComponent:@"vagrant_reload.command"]]; 201 | 202 | [self checkVMStatus]; 203 | } 204 | 205 | 206 | // Updates menu 207 | - (IBAction)update_k8s:(id)sender { 208 | // send a notification on to the screen 209 | NSUserNotification *notification = [[NSUserNotification alloc] init]; 210 | notification.title = @"Kubernetes Cluster and"; 211 | notification.informativeText = @"OS X kubectl will be updated"; 212 | [[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification]; 213 | 214 | NSString *appName = [[NSString alloc] init]; 215 | NSString *arguments = [[NSString alloc] init]; 216 | [self runApp:appName = @"iTerm" arguments:arguments = [_resoucesPathFromApp stringByAppendingPathComponent:@"update_k8s.command"]]; 217 | // NSLog(@"Apps arguments: '%@'", [_resoucesPathFromApp stringByAppendingPathComponent:@"update.command"]); 218 | } 219 | 220 | - (IBAction)updates:(id)sender { 221 | // send a notification on to the screen 222 | NSUserNotification *notification = [[NSUserNotification alloc] init]; 223 | notification.title = @"OS X etcdclt, fleetctl and"; 224 | notification.informativeText = @"fleet units will be updated"; 225 | [[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification]; 226 | 227 | NSString *appName = [[NSString alloc] init]; 228 | NSString *arguments = [[NSString alloc] init]; 229 | [self runApp:appName = @"iTerm" arguments:arguments = [_resoucesPathFromApp stringByAppendingPathComponent:@"update.command"]]; 230 | // NSLog(@"Apps arguments: '%@'", [_resoucesPathFromApp stringByAppendingPathComponent:@"update.command"]); 231 | } 232 | 233 | - (IBAction)updateVbox:(id)sender { 234 | // send a notification on to the screen 235 | NSUserNotification *notification = [[NSUserNotification alloc] init]; 236 | notification.title = @"CoreOS vbox"; 237 | notification.informativeText = @"will be updated"; 238 | [[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification]; 239 | 240 | NSString *appName = [[NSString alloc] init]; 241 | NSString *arguments = [[NSString alloc] init]; 242 | [self runApp:appName = @"iTerm" arguments:arguments = [_resoucesPathFromApp stringByAppendingPathComponent:@"update_vbox.command"]]; 243 | // NSLog(@"Apps arguments: '%@'", [_resoucesPathFromApp stringByAppendingPathComponent:@"update.command"]); 244 | } 245 | 246 | 247 | - (IBAction)force_coreos_update:(id)sender { 248 | // send a notification on to the screen 249 | NSUserNotification *notification = [[NSUserNotification alloc] init]; 250 | notification.title = @"CoreOS VMs will be forced to be updated !!!"; 251 | [[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification]; 252 | 253 | NSString *appName = [[NSString alloc] init]; 254 | NSString *arguments = [[NSString alloc] init]; 255 | [self runApp:appName = @"iTerm" arguments:arguments = [_resoucesPathFromApp stringByAppendingPathComponent:@"force_coreos_update.command"]]; 256 | } 257 | // Updates menu 258 | 259 | 260 | // Setup menu 261 | - (IBAction)changeReleaseChannel:(id)sender { 262 | // send a notification on to the screen 263 | NSUserNotification *notification = [[NSUserNotification alloc] init]; 264 | notification.informativeText = @"CoreOS release channel change"; 265 | [[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification]; 266 | 267 | NSString *appName = [[NSString alloc] init]; 268 | NSString *arguments = [[NSString alloc] init]; 269 | [self runApp:appName = @"iTerm" arguments:arguments = [_resoucesPathFromApp stringByAppendingPathComponent:@"change_release_channel.command"]]; 270 | 271 | [self checkVMStatus]; 272 | } 273 | 274 | - (IBAction)destroy:(id)sender { 275 | // send a notification on to the screen 276 | NSUserNotification *notification = [[NSUserNotification alloc] init]; 277 | notification.informativeText = @"CoreOS+Kubernetes Cluster will be destroyed"; 278 | [[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification]; 279 | 280 | NSString *appName = [[NSString alloc] init]; 281 | NSString *arguments = [[NSString alloc] init]; 282 | [self runApp:appName = @"iTerm" arguments:arguments = [_resoucesPathFromApp stringByAppendingPathComponent:@"vagrant_destroy.command"]]; 283 | 284 | [self checkVMStatus]; 285 | } 286 | 287 | - (IBAction)initialInstall:(id)sender 288 | { 289 | NSString *home_folder = [NSHomeDirectory() stringByAppendingPathComponent:@"coreos-k8s-cluster"]; 290 | 291 | BOOL isDir; 292 | if([[NSFileManager defaultManager] 293 | fileExistsAtPath:home_folder isDirectory:&isDir] && isDir){ 294 | NSString *msg = [NSString stringWithFormat:@"%@ %@ %@", @"Folder", home_folder, @"exists, please delete or rename that folder !!!"]; 295 | [self displayWithMessage:@"CoreOS+Kubernetes Cluster" infoText:msg]; 296 | } 297 | else 298 | { 299 | NSLog(@"Folder does not exist: '%@'", home_folder); 300 | // create home folder and .env subfolder 301 | NSString *env_folder = [home_folder stringByAppendingPathComponent:@".env"]; 302 | NSError * error = nil; 303 | [[NSFileManager defaultManager] createDirectoryAtPath:env_folder 304 | withIntermediateDirectories:YES 305 | attributes:nil 306 | error:&error]; 307 | // write to file App version 308 | NSString *version = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"]; 309 | NSData *app_version = [version dataUsingEncoding:NSUTF8StringEncoding]; 310 | [[NSFileManager defaultManager] createFileAtPath:[NSHomeDirectory() stringByAppendingPathComponent:@"coreos-k8s-cluster/.env/version"] 311 | contents:app_version 312 | attributes:nil]; 313 | // set resouces_path 314 | NSString *resources_content = _resoucesPathFromApp; 315 | NSData *fileContents1 = [resources_content dataUsingEncoding:NSUTF8StringEncoding]; 316 | [[NSFileManager defaultManager] createFileAtPath:[NSHomeDirectory() stringByAppendingPathComponent:@"coreos-k8s-cluster/.env/resouces_path"] 317 | contents:fileContents1 318 | attributes:nil]; 319 | 320 | // run install script 321 | NSString *scriptName = [[NSString alloc] init]; 322 | NSString *arguments = [[NSString alloc] init]; 323 | [self runScript:scriptName = @"coreos-vagrant-install" arguments:arguments = _resoucesPathFromApp ]; 324 | } 325 | } 326 | // Setup menu 327 | 328 | - (IBAction)About:(id)sender { 329 | 330 | NSString *version = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"]; 331 | // NSString *build = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]; 332 | // NSString *app_version = [NSString stringWithFormat:@"%@.%@", version, build]; 333 | NSString *app_version = [NSString stringWithFormat:@"%@", version]; 334 | 335 | NSString *mText = [NSString stringWithFormat:@"%@ %@", @"CoreOS+Kubernetes Cluster for OS X", app_version]; 336 | NSString *infoText = @"It is a simple wrapper around the CoreOS-Vagrant, which allows to control CoreOS+Kubernetes Cluster via Status Bar !!!"; 337 | [self displayWithMessage:mText infoText:infoText]; 338 | } 339 | 340 | 341 | // OS shell 342 | - (IBAction)open_shell:(id)sender{ 343 | // send a notification on to the screen 344 | NSUserNotification *notification = [[NSUserNotification alloc] init]; 345 | notification.informativeText = @"OS X shell will be opened"; 346 | [[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification]; 347 | 348 | NSString *appName = [[NSString alloc] init]; 349 | NSString *arguments = [[NSString alloc] init]; 350 | [self runApp:appName = @"iTerm" arguments:arguments = [_resoucesPathFromApp stringByAppendingPathComponent:@"os_shell.command"]]; 351 | } 352 | 353 | // ssh to hosts 354 | - (IBAction)runSsh1:(id)sender { 355 | // send a notification on to the screen 356 | NSUserNotification *notification = [[NSUserNotification alloc] init]; 357 | notification.informativeText = @"vagrant ssh shell to k8smaster-01 will be opened"; 358 | [[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification]; 359 | 360 | NSString *appName = [[NSString alloc] init]; 361 | NSString *arguments = [[NSString alloc] init]; 362 | [self runApp:appName = @"iTerm" arguments:arguments = [_resoucesPathFromApp stringByAppendingPathComponent:@"vagrant_control1.command"]]; 363 | } 364 | 365 | - (IBAction)runSsh2:(id)sender { 366 | // send a notification on to the screen 367 | NSUserNotification *notification = [[NSUserNotification alloc] init]; 368 | notification.informativeText = @"vagrant ssh shell to k8snode-01 will be opened"; 369 | [[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification]; 370 | 371 | NSString *appName = [[NSString alloc] init]; 372 | NSString *arguments = [[NSString alloc] init]; 373 | [self runApp:appName = @"iTerm" arguments:arguments = [_resoucesPathFromApp stringByAppendingPathComponent:@"vagrant_node1.command"]]; 374 | } 375 | 376 | - (IBAction)runSsh3:(id)sender { 377 | // send a notification on to the screen 378 | NSUserNotification *notification = [[NSUserNotification alloc] init]; 379 | notification.informativeText = @"vagrant ssh shell to k8snode-02 will be opened"; 380 | [[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification]; 381 | 382 | NSString *appName = [[NSString alloc] init]; 383 | NSString *arguments = [[NSString alloc] init]; 384 | [self runApp:appName = @"iTerm" arguments:arguments = [_resoucesPathFromApp stringByAppendingPathComponent:@"vagrant_node2.command"]]; 385 | } 386 | // ssh to hosts 387 | 388 | // UI 389 | - (IBAction)fleetUI:(id)sender { 390 | [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://172.17.15.101:3000"]]; 391 | } 392 | 393 | 394 | - (IBAction)KubernetesUI:(id)sender { 395 | [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://172.17.15.101:8080/ui"]]; 396 | } 397 | 398 | - (IBAction)node1_cAdvisor:(id)sender { 399 | [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://172.17.15.102:4194"]]; 400 | } 401 | 402 | - (IBAction)node2_cAdvisor:(id)sender { 403 | [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://172.17.15.103:4194"]]; 404 | } 405 | 406 | // UI 407 | 408 | 409 | - (void)runScript:(NSString*)scriptName arguments:(NSString*)arguments 410 | { 411 | NSTask *task = [[NSTask alloc] init]; 412 | task.launchPath = [NSString stringWithFormat:@"%@", [[NSBundle mainBundle] pathForResource:scriptName ofType:@"command"]]; 413 | task.arguments = @[arguments]; 414 | [task launch]; 415 | [task waitUntilExit]; 416 | } 417 | 418 | 419 | - (void)runApp:(NSString*)appName arguments:(NSString*)arguments 420 | { 421 | // lunch an external App from the mainBundle 422 | [[NSWorkspace sharedWorkspace] openFile:arguments withApplication:appName]; 423 | } 424 | 425 | 426 | - (void)checkVMStatus { 427 | // check vm status and and return the shell script output 428 | NSTask *task = [[NSTask alloc] init]; 429 | task.launchPath = [NSString stringWithFormat:@"%@", [[NSBundle mainBundle] pathForResource:@"coreos-vagrant" ofType:@"command"]]; 430 | task.arguments = @[@"status"]; 431 | // task.arguments = @[@"status | grep virtualbox | sed -e 's/ */ /g' -e 's/^ *\(.*\) *$/\1/' "]; 432 | 433 | NSPipe *pipe; 434 | pipe = [NSPipe pipe]; 435 | [task setStandardOutput: pipe]; 436 | 437 | NSFileHandle *file; 438 | file = [pipe fileHandleForReading]; 439 | 440 | [task launch]; 441 | [task waitUntilExit]; 442 | 443 | NSData *data; 444 | data = [file readDataToEndOfFile]; 445 | 446 | NSString *string; 447 | string = [[NSString alloc] initWithData: data encoding: NSUTF8StringEncoding]; 448 | // NSLog (@"Returned:\n%@", string); 449 | 450 | // send a notification on to the screen 451 | NSUserNotification *notification = [[NSUserNotification alloc] init]; 452 | // notification.contentImage = [NSImage imageNamed:@"icon2"]; 453 | notification.informativeText = string; 454 | [[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification]; 455 | } 456 | 457 | 458 | - (BOOL)userNotificationCenter:(NSUserNotificationCenter *)center 459 | shouldPresentNotification:(NSUserNotification *)notification 460 | { 461 | return YES; 462 | } 463 | 464 | 465 | -(void) displayWithMessage:(NSString *)mText infoText:(NSString*)infoText 466 | { 467 | NSAlert *alert = [[NSAlert alloc] init]; 468 | [alert setAlertStyle:NSInformationalAlertStyle]; 469 | // [alert setIcon:[NSImage imageNamed:@"icon2"]]; 470 | [alert setMessageText:mText]; 471 | [alert setInformativeText:infoText]; 472 | [alert runModal]; 473 | } 474 | 475 | 476 | @end 477 | -------------------------------------------------------------------------------- /src/CoreOS k8s Cluster/Base.lproj/MainMenu.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | Default 522 | 523 | 524 | 525 | 526 | 527 | 528 | Left to Right 529 | 530 | 531 | 532 | 533 | 534 | 535 | Right to Left 536 | 537 | 538 | 539 | 540 | 541 | 542 | 543 | 544 | 545 | 546 | Default 547 | 548 | 549 | 550 | 551 | 552 | 553 | Left to Right 554 | 555 | 556 | 557 | 558 | 559 | 560 | Right to Left 561 | 562 | 563 | 564 | 565 | 566 | 567 | 568 | 569 | 570 | 571 | 572 | 573 | 574 | 575 | 576 | 577 | 578 | 579 | 580 | 581 | 582 | 583 | 584 | 585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 606 | 607 | 608 | 609 | 610 | 611 | 612 | 613 | 614 | 615 | 616 | 617 | 618 | 619 | 620 | 621 | 622 | 623 | 624 | 625 | 626 | 627 | 628 | 629 | 630 | 631 | 632 | 633 | 634 | 635 | 636 | 637 | 638 | 639 | 640 | 641 | 642 | 643 | 644 | 645 | 646 | 647 | 648 | 649 | 650 | 651 | 652 | 653 | 654 | 655 | 656 | 657 | 658 | 659 | 660 | 661 | 662 | 663 | 664 | 665 | 666 | 667 | 668 | 669 | 670 | 671 | 672 | 673 | 674 | 675 | 676 | 677 | 678 | 679 | 680 | 681 | 682 | 683 | 684 | 685 | 686 | 687 | 688 | 689 | 690 | 691 | 692 | 693 | 694 | 695 | 696 | 697 | 698 | 699 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 723 | 724 | 725 | 726 | 727 | 728 | 729 | 730 | 731 | 732 | 733 | 734 | 735 | 736 | 737 | 738 | 739 | 740 | 741 | 742 | 743 | 744 | 745 | 746 | 747 | 748 | 749 | 750 | 751 | 752 | 753 | 754 | 755 | 756 | 757 | 758 | 759 | 760 | 761 | 762 | 763 | 764 | 765 | 766 | 767 | 768 | 769 | 770 | 771 | 772 | 773 | 774 | 775 | 776 | 777 | 778 | 779 | 780 | 781 | 782 | 783 | 784 | 785 | 786 | 787 | 788 | 789 | 790 | 791 | 792 | 793 | 794 | 795 | 796 | 797 | 798 | 799 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | -------------------------------------------------------------------------------- /src/CoreOS k8s Cluster/CoreOS k8s Cluster-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | CoreOS k8s Cluster 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | icon 13 | CFBundleIdentifier 14 | $(PRODUCT_BUNDLE_IDENTIFIER) 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 0.6.3 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 183 27 | LSApplicationCategoryType 28 | public.app-category.utilities 29 | LSMinimumSystemVersion 30 | ${MACOSX_DEPLOYMENT_TARGET} 31 | LSUIElement 32 | 33 | NSHumanReadableCopyright 34 | Copyright © 2014 Rimantas Mocevicius. All rights reserved. 35 | NSMainNibFile 36 | MainMenu 37 | NSPrincipalClass 38 | NSApplication 39 | 40 | 41 | -------------------------------------------------------------------------------- /src/CoreOS k8s Cluster/CoreOS k8s Cluster-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #ifdef __OBJC__ 8 | #import 9 | #endif 10 | -------------------------------------------------------------------------------- /src/CoreOS k8s Cluster/CoreOS k8s Cluster.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/CoreOS k8s Cluster/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "size" : "16x16", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "size" : "16x16", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "mac", 15 | "size" : "32x32", 16 | "scale" : "1x" 17 | }, 18 | { 19 | "idiom" : "mac", 20 | "size" : "32x32", 21 | "scale" : "2x" 22 | }, 23 | { 24 | "idiom" : "mac", 25 | "size" : "128x128", 26 | "scale" : "1x" 27 | }, 28 | { 29 | "idiom" : "mac", 30 | "size" : "128x128", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "idiom" : "mac", 35 | "size" : "256x256", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "mac", 40 | "size" : "256x256", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "mac", 45 | "size" : "512x512", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "mac", 50 | "size" : "512x512", 51 | "scale" : "2x" 52 | } 53 | ], 54 | "info" : { 55 | "version" : 1, 56 | "author" : "xcode" 57 | } 58 | } -------------------------------------------------------------------------------- /src/CoreOS k8s Cluster/en.lproj/Credits.rtf: -------------------------------------------------------------------------------- 1 | {\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;} 2 | {\colortbl;\red255\green255\blue255;} 3 | \paperw9840\paperh8400 4 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural 5 | 6 | \f0\b\fs24 \cf0 Engineering: 7 | \b0 \ 8 | Some people\ 9 | \ 10 | 11 | \b Human Interface Design: 12 | \b0 \ 13 | Some other people\ 14 | \ 15 | 16 | \b Testing: 17 | \b0 \ 18 | Hopefully not nobody\ 19 | \ 20 | 21 | \b Documentation: 22 | \b0 \ 23 | Whoever\ 24 | \ 25 | 26 | \b With special thanks to: 27 | \b0 \ 28 | Mom\ 29 | } 30 | -------------------------------------------------------------------------------- /src/CoreOS k8s Cluster/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /src/CoreOS k8s Cluster/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // CoreOS Kubernetes Cluster OSX GUI 4 | // 5 | // Created by Rimantas on 08/02/2014. 6 | // Copyright (c) 2014 Rimantas Mocevicius. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, const char * argv[]) 12 | { 13 | return NSApplicationMain(argc, argv); 14 | } 15 | -------------------------------------------------------------------------------- /src/Vagrantfiles/user-data.control: -------------------------------------------------------------------------------- 1 | #cloud-config 2 | 3 | coreos: 4 | update: 5 | reboot-strategy: off 6 | etcd2: 7 | name: k8master-01 8 | initial-advertise-peer-urls: http://$private_ipv4:2380 9 | initial-cluster-token: k8s_etcd 10 | initial-cluster: k8master-01=http://$private_ipv4:2380 11 | initial-cluster-state: new 12 | listen-peer-urls: http://$private_ipv4:2380,http://$private_ipv4:7001 13 | listen-client-urls: http://0.0.0.0:2379,http://0.0.0.0:4001 14 | advertise-client-urls: http://$public_ipv4:2379,http://$public_ipv4:4001 15 | fleet: 16 | public-ip: $public_ipv4 17 | metadata: role=control 18 | flannel: 19 | interface: $public_ipv4 20 | units: 21 | - name: flanneld.service 22 | command: start 23 | drop-ins: 24 | - name: 50-network-config.conf 25 | content: | 26 | [Unit] 27 | Requires=etcd2.service 28 | [Service] 29 | ExecStartPre=/usr/bin/etcdctl set /coreos.com/network/config '{"Network": "10.244.0.0/16", "Backend": {"Type": "vxlan"}}' 30 | - name: etcd2.service 31 | command: start 32 | - name: fleet.service 33 | command: start 34 | - name: docker.service 35 | command: start 36 | drop-ins: 37 | - name: 50-insecure-registry.conf 38 | content: | 39 | [Unit] 40 | Requires=flanneld.service 41 | After=flanneld.service 42 | [Service] 43 | Environment=DOCKER_OPTS='--insecure-registry="0.0.0.0/0"' 44 | - name: kube-certs.service 45 | command: start 46 | content: | 47 | [Unit] 48 | Description=Generate Kubernetes API Server certificates 49 | ConditionPathExists=/opt/bin/make-certs.sh 50 | Requires=network-online.target 51 | After=network-online.target 52 | [Service] 53 | EnvironmentFile=/etc/environment 54 | ExecStartPre=-/usr/sbin/groupadd -r kube-cert 55 | ExecStartPre=/usr/bin/chmod 755 /opt/bin/make-certs.sh 56 | ExecStart=/opt/bin/make-certs.sh $public_ipv4 IP:$public_ipv4,IP:10.100.0.1,DNS:kubernetes,DNS:kubernetes.default,DNS:kubernetes.default.svc,DNS:kubernetes.default.svc.cluster.local 57 | Type=oneshot 58 | RemainAfterExit=true 59 | write_files: 60 | - path: /home/core/.ssh/id_rsa 61 | permissions: '0600' 62 | owner: core:core 63 | content: | 64 | -----BEGIN RSA PRIVATE KEY----- 65 | MIIEowIBAAKCAQEA18VKh3nRpHTOC+AAyg+YB1P0SSISR/2TjHG89c7ZhPTGCXr5 66 | P60H5vU/YOrV8sQR542inDwxfAvhn86yHe/w8dX/g4krNDB+0NFL1fbQ9BktGsao 67 | Apg5bWMGjBgVTp8WJlDfW7zYqJQu/wjZ90oz6EpL4+DhzAn/W0JUXWiFgCUpKDHJ 68 | zZIZzebywLcJ/8jngMhxpae9OSDIkR9i5QNkeqLZhR0kB65Bq/8KbtFibduxAUyG 69 | qxXnou3QB5VH9c4Ura8vzhMqsBCohKPuH5OLz2V4jcijZJY7vyNahXG3PB8Gw1c0 70 | 7XZUAlEUDuJaLA5kIBXSOMM9X5Tjq7Cvtfrz2wIDAQABAoIBAC3R0pLUVqWCvGKf 71 | Leu6xgEAXgbNum4ZNiUD3imgxGZMiGVo/Nb9yojMGapeFBLaeibe1+Ivkh6Sc1Y5 72 | UW+0DUl9tSXckhUiGzwCxgToxdSgKAjgmLr8Um2dMr27O4MXm1+FmvjjMGsUFKrJ 73 | 2Wd/FWjFpjn8/lYS5WweuMWhNYBRf8lwA4VdjU/pnlPDro8PqMysf4h+tRw26nJb 74 | NXzqzJ5zQGfBJ0wIYuZSa25SF9l9gRWEUM/KxL36S/SpwuXSdBv/GtqKB21ogyOn 75 | S3UZZjfTlkX0KvaLG0eVXptSRjqSJbZkzBbDX1WsBEJIvV1XqeJcptNtO6Ez7Kou 76 | NqE4cfkCgYEA/IX2AZCLBmCfYsQm1M6WaQ/hgaWFrcimr/huNbASuc3fE4e5vFSR 77 | Dh6jFikDg5t6Q8nUTySpRXovCHEfnvYFrS5s4tPOe/2JqBwK63KqjpeC/JPNGC1E 78 | sXPEttiFo49kkTOOh1ImCbqHJT2EIPEIuXE3RUXlTk/+MwOwYL2HaHUCgYEA2r3K 79 | 5O1gf7Cfws3lRxOdS+eK+m4z8oF92tcX7sEVphJTG6wqRR0z2Llj8SsyGbFWSYfK 80 | zalFkk66zr55MzTrOhJ35+LyJUx+IBAcYkQLTtTsp54JlJ8CMD1EcRPASYTg3L8R 81 | Rf8+cgfcSslBiL/nyhnTN0hmyjVJp7ucvbep4Q8CgYEAhFn99xH4G86WmyBtrcnd 82 | QZGGQvorF0t8Oey+brsrBWFmkwjnC1NTd5ANMDcs1VSu/0qQUS7I3VZNwmHwDdOq 83 | Y/taLISQy6G1/Xs9Kew+gl/c0l7w9sP7JfqkVqUjXfdw4T2hbUFcGGtAG/+i+dT7 84 | Gp7BNjiNF7+LXteHIR0VFGUCgYAaMorfOhLJmDS6FwCzr4SyN4vsjFBKZfnVwNcL 85 | 8DIQjrdHZCo31tSDy0hN9PduHlAQRGQkl3ZOnIFBC4zmdhsJ/HZB3mtTzkJ4wpUz 86 | q6STD2s8c+//zb9sWZod1Ni9tV1c8sE12ej3rTtT9aCUqS8whEFIqLIu24zzusN9 87 | 8UY2PwKBgHWyekUzaQRcteEYsCWsl9KeX777EdtbK6bGh5JlD9rK5YVK3Ogq24Ts 88 | 9+yKbdYPv6KjXbAnb3ywDeifIx9vna+4jtXZ8cUuZQcj4nmBtKfeaxZeN7OlHv0d 89 | LwDeOM4DDptEENhfzc0sPYHyGqUsfH6c4kq5KwtDAoY9MCS5/dGN 90 | -----END RSA PRIVATE KEY----- 91 | - path: /home/core/.ssh/id_rsa.pub 92 | permissions: '0600' 93 | owner: core:core 94 | content: | 95 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDXxUqHedGkdM4L4ADKD5gHU/RJIhJH/ZOMcbz1ztmE9MYJevk/rQfm9T9g6tXyxBHnjaKcPDF8C+GfzrId7/Dx1f+DiSs0MH7Q0UvV9tD0GS0axqgCmDltYwaMGBVOnxYmUN9bvNiolC7/CNn3SjPoSkvj4OHMCf9bQlRdaIWAJSkoMcnNkhnN5vLAtwn/yOeAyHGlp705IMiRH2LlA2R6otmFHSQHrkGr/wpu0WJt27EBTIarFeei7dAHlUf1zhStry/OEyqwEKiEo+4fk4vPZXiNyKNklju/I1qFcbc8HwbDVzTtdlQCURQO4losDmQgFdI4wz1flOOrsK+1+vPb core@core-01 96 | - path: /opt/bin/wupiao 97 | permissions: '0755' 98 | content: | 99 | #!/bin/bash 100 | # [w]ait [u]ntil [p]ort [i]s [a]ctually [o]pen 101 | [ -n "$1" ] && \ 102 | until curl -o /dev/null -sIf http://${1}; do \ 103 | sleep 1 && echo .; 104 | done; 105 | exit $? 106 | - path: /opt/bin/make-certs.sh 107 | permissions: '0755' 108 | content: | 109 | #!/bin/sh - 110 | 111 | # Copyright 2014 The Kubernetes Authors All rights reserved. 112 | # 113 | 114 | set -o errexit 115 | set -o nounset 116 | set -o pipefail 117 | 118 | cert_ip=$1 119 | extra_sans=${2:-} 120 | cert_dir=/srv/kubernetes 121 | cert_group=kube-cert 122 | 123 | mkdir -p "$cert_dir" 124 | 125 | use_cn=false 126 | 127 | sans="IP:${cert_ip}" 128 | if [[ -n "${extra_sans}" ]]; then 129 | sans="${sans},${extra_sans}" 130 | fi 131 | 132 | tmpdir=$(mktemp -d --tmpdir kubernetes_cacert.XXXXXX) 133 | trap 'rm -rf "${tmpdir}"' EXIT 134 | # 135 | curl -L -O https://storage.googleapis.com/kubernetes-release/easy-rsa/easy-rsa.tar.gz > /dev/null 2>&1 136 | tar xzf easy-rsa.tar.gz > /dev/null 2>&1 137 | 138 | cd easy-rsa-master/easyrsa3 139 | ./easyrsa init-pki > /dev/null 2>&1 140 | ./easyrsa --batch "--req-cn=$cert_ip@`date +%s`" build-ca nopass > /dev/null 2>&1 141 | if [ $use_cn = "true" ]; then 142 | ./easyrsa build-server-full $cert_ip nopass > /dev/null 2>&1 143 | cp -p pki/issued/$cert_ip.crt "${cert_dir}/server.cert" > /dev/null 2>&1 144 | cp -p pki/private/$cert_ip.key "${cert_dir}/server.key" > /dev/null 2>&1 145 | else 146 | ./easyrsa --subject-alt-name="${sans}" build-server-full kubernetes-master nopass > /dev/null 2>&1 147 | cp -p pki/issued/kubernetes-master.crt "${cert_dir}/server.cert" > /dev/null 2>&1 148 | cp -p pki/private/kubernetes-master.key "${cert_dir}/server.key" > /dev/null 2>&1 149 | fi 150 | ./easyrsa build-client-full kubecfg nopass > /dev/null 2>&1 151 | cp -p pki/ca.crt "${cert_dir}/ca.crt" 152 | cp -p pki/issued/kubecfg.crt "${cert_dir}/kubecfg.crt" 153 | cp -p pki/private/kubecfg.key "${cert_dir}/kubecfg.key" 154 | # Make server certs accessible to apiserver. 155 | echo 3 156 | chgrp $cert_group "${cert_dir}/server.key" "${cert_dir}/server.cert" "${cert_dir}/ca.crt" 157 | chmod 660 "${cert_dir}/server.key" "${cert_dir}/server.cert" "${cert_dir}/ca.crt" 158 | echo 4 159 | -------------------------------------------------------------------------------- /src/Vagrantfiles/user-data.node: -------------------------------------------------------------------------------- 1 | #cloud-config 2 | 3 | coreos: 4 | update: 5 | reboot-strategy: off 6 | etcd2: 7 | listen-client-urls: http://0.0.0.0:2379,http://0.0.0.0:4001 8 | advertise-client-urls: http://0.0.0.0:2379,http://0.0.0.0:4001 9 | initial-cluster: k8master-01=http://172.17.15.101:2380 10 | proxy: on 11 | fleet: 12 | public-ip: $public_ipv4 13 | metadata: role=node 14 | flannel: 15 | interface: $public_ipv4 16 | units: 17 | - name: flanneld.service 18 | drop-ins: 19 | - name: 50-network-config.conf 20 | content: | 21 | [Unit] 22 | Requires=etcd2.service 23 | [Service] 24 | ExecStartPre=/usr/bin/etcdctl set /coreos.com/network/config '{"Network":"10.244.0.0/16", "Backend": {"Type": "vxlan"}}' 25 | command: start 26 | - name: fleet.service 27 | command: start 28 | - name: docker.service 29 | command: start 30 | drop-ins: 31 | - name: 50-insecure-registry.conf 32 | content: | 33 | [Unit] 34 | Requires=flanneld.service 35 | After=flanneld.service 36 | [Service] 37 | Environment=DOCKER_OPTS='--insecure-registry="0.0.0.0/0"' 38 | write_files: 39 | - path: /opt/bin/wupiao 40 | permissions: '0755' 41 | content: | 42 | #!/bin/bash 43 | # [w]ait [u]ntil [p]ort [i]s [a]ctually [o]pen 44 | [ -n "$1" ] && \ 45 | until curl -o /dev/null -sIf http://${1}; do \ 46 | sleep 1 && echo .; 47 | done; 48 | exit $? 49 | -------------------------------------------------------------------------------- /src/change_release_channel.command: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # change_release_channel.command 4 | # CoreOS Kubernetes Cluster for OS X 5 | # 6 | # Created by Rimantas on 01/04/2014. 7 | # Copyright (c) 2014 Rimantas Mocevicius. All rights reserved. 8 | 9 | # get App's Resources folder 10 | res_folder=$(cat ~/coreos-k8s-cluster/.env/resouces_path) 11 | 12 | ### Set release channel 13 | LOOP=1 14 | while [ $LOOP -gt 0 ] 15 | do 16 | VALID_MAIN=0 17 | echo " " 18 | echo "Set CoreOS Release Channel:" 19 | echo " 1) Alpha " 20 | echo " 2) Beta " 21 | echo " 3) Stable " 22 | echo " " 23 | echo "Select an option:" 24 | 25 | read RESPONSE 26 | XX=${RESPONSE:=Y} 27 | 28 | if [ $RESPONSE = 1 ] 29 | then 30 | VALID_MAIN=1 31 | sed -i "" 's/#$update_channel/$update_channel/' ~/coreos-k8s-cluster/control/config.rb 32 | sed -i "" "s/channel='stable'/channel='alpha'/" ~/coreos-k8s-cluster/control/config.rb 33 | sed -i "" "s/channel='beta'/channel='alpha'/" ~/coreos-k8s-cluster/control/config.rb 34 | # overwriting user-data file for the older version Apps 35 | cp -fr "$res_folder"/Vagrantfiles/user-data.control ~/coreos-k8s-cluster/control/user-data 36 | # 37 | sed -i "" 's/#$update_channel/$update_channel/' ~/coreos-k8s-cluster/workers/config.rb 38 | sed -i "" "s/channel='stable'/channel='alpha'/" ~/coreos-k8s-cluster/workers/config.rb 39 | sed -i "" "s/channel='beta'/channel='alpha'/" ~/coreos-k8s-cluster/workers/config.rb 40 | # overwriting user-data file for the older version Apps 41 | cp -fr "$res_folder"/Vagrantfiles/user-data.node ~/coreos-k8s-cluster/workers/user-data 42 | channel="Alpha" 43 | LOOP=0 44 | fi 45 | 46 | if [ $RESPONSE = 2 ] 47 | then 48 | VALID_MAIN=1 49 | sed -i "" 's/#$update_channel/$update_channel/' ~/coreos-k8s-cluster/control/config.rb 50 | sed -i "" "s/channel='alpha'/channel='beta'/" ~/coreos-k8s-cluster/control/config.rb 51 | sed -i "" "s/channel='stable'/channel='beta'/" ~/coreos-k8s-cluster/control/config.rb 52 | # overwriting user-data file for the older version Apps 53 | cp -fr "$res_folder"/Vagrantfiles/user-data.control ~/coreos-k8s-cluster/control/user-data 54 | # 55 | sed -i "" 's/#$update_channel/$update_channel/' ~/coreos-k8s-cluster/workers/config.rb 56 | sed -i "" "s/channel='alpha'/channel='beta'/" ~/coreos-k8s-cluster/workers/config.rb 57 | sed -i "" "s/channel='stable'/channel='beta'/" ~/coreos-k8s-cluster/workers/config.rb 58 | # overwriting user-data file for the older version Apps 59 | cp -fr "$res_folder"/Vagrantfiles/user-data.node ~/coreos-k8s-cluster/workers/user-data 60 | channel="Beta" 61 | LOOP=0 62 | fi 63 | 64 | if [ $RESPONSE = 3 ] 65 | then 66 | VALID_MAIN=1 67 | sed -i "" 's/#$update_channel/$update_channel/' ~/coreos-k8s-cluster/control/config.rb 68 | sed -i "" "s/channel='alpha'/channel='stable'/" ~/coreos-k8s-cluster/control/config.rb 69 | sed -i "" "s/channel='beta'/channel='stable'/" ~/coreos-k8s-cluster/control/config.rb 70 | # overwriting user-data file for the older version Apps 71 | cp -fr "$res_folder"/Vagrantfiles/user-data.control ~/coreos-k8s-cluster/control/user-data 72 | # 73 | sed -i "" 's/#$update_channel/$update_channel/' ~/coreos-k8s-cluster/workers/config.rb 74 | sed -i "" "s/channel='alpha'/channel='stable'/" ~/coreos-k8s-cluster/workers/config.rb 75 | sed -i "" "s/channel='beta'/channel='stable'/" ~/coreos-k8s-cluster/workers/config.rb 76 | # overwriting user-data file for the older version Apps 77 | cp -fr "$res_folder"/Vagrantfiles/user-data.node ~/coreos-k8s-cluster/workers/user-data 78 | channel="Stable" 79 | LOOP=0 80 | fi 81 | 82 | if [ $VALID_MAIN != 1 ] 83 | then 84 | continue 85 | fi 86 | done 87 | ### Set release channel 88 | 89 | function pause(){ 90 | read -p "$*" 91 | } 92 | 93 | # 94 | echo "The 'config.rb' file was updated to $channel channel !!!" 95 | echo "and the 'user-data' file was copied with necessary etcd/etcd2 settings !!! " 96 | echo "You need to run 'Destroy Cluster (vagrant destroy)' and then" 97 | echo "on next 'Up' new cluster will be created !!!" 98 | pause 'Press [Enter] key to continue...' 99 | 100 | -------------------------------------------------------------------------------- /src/coreos-vagrant-install.command: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # coreos-vagrant-install.command 4 | # CoreOS Kubernetes Cluster for OS X 5 | # 6 | # Created by Rimantas on 01/04/2014. 7 | # Copyright (c) 2014 Rimantas Mocevicius. All rights reserved. 8 | 9 | # create in "coreos-k8s-cluster" all required folders and files at user's home folder where all the data will be stored 10 | mkdir ~/coreos-k8s-cluster/tmp 11 | mkdir ~/coreos-k8s-cluster/bin 12 | mkdir ~/coreos-k8s-cluster/fleet 13 | mkdir ~/coreos-k8s-cluster/kubernetes 14 | mkdir -p ~/coreos-k8s-cluster/control 15 | mkdir -p ~/coreos-k8s-cluster/workers 16 | 17 | # cd to App's Resources folder 18 | cd "$1" 19 | 20 | # copy gsed to ~/coreos-k8s-cluster/bin 21 | cp "$1"/gsed ~/coreos-k8s-cluster/bin 22 | 23 | # copy wget with https support to ~/coreos-k8s-cluster/bin 24 | cp "$1"/wget ~/coreos-k8s-cluster/bin 25 | 26 | # copy kubectl to ~/coreos-k8s-cluster/bin 27 | cp "$1"/kubectl ~/coreos-k8s-cluster/bin 28 | 29 | # copy gen_kubeconfig to ~/coreos-k8s-cluster/bin 30 | cp "$1"/gen_kubeconfig ~/coreos-k8s-cluster/bin 31 | # 32 | chmod 755 ~/coreos-k8s-cluster/bin/* 33 | 34 | # copy other files 35 | # user-data files 36 | cp "$1"/Vagrantfiles/user-data.control ~/coreos-k8s-cluster/control/user-data 37 | cp "$1"/Vagrantfiles/user-data.node ~/coreos-k8s-cluster/workers/user-data 38 | 39 | # copy k8s files 40 | cp "$1"/k8s/kubectl ~/coreos-k8s-cluster/control 41 | chmod 755 ~/coreos-k8s-cluster/control/kubectl 42 | cp "$1"/k8s/*.yaml ~/coreos-k8s-cluster/kubernetes 43 | # linux binaries 44 | cp "$1"/k8s/master.tgz ~/coreos-k8s-cluster/control 45 | cp "$1"/k8s/nodes.tgz ~/coreos-k8s-cluster/workers 46 | 47 | # copy fleet units 48 | cp -R "$1"/fleet/ ~/coreos-k8s-cluster/fleet 49 | 50 | # initial init 51 | open -a iTerm.app "$1"/first-init.command 52 | -------------------------------------------------------------------------------- /src/coreos-vagrant.command: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # coreos-vagrant.command 4 | # CoreOS Kubernetes Cluster for OS X 5 | # 6 | # Created by Rimantas on 01/04/2014. 7 | # Copyright (c) 2014 Rimantas Mocevicius. All rights reserved. 8 | 9 | export PATH=/usr/local/bin 10 | 11 | # pass first argument - up, halt ... 12 | cd ~/coreos-k8s-cluster/control 13 | vagrant $1 14 | 15 | cd ~/coreos-k8s-cluster/workers 16 | vagrant $1 17 | -------------------------------------------------------------------------------- /src/first-init.command: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # first-init.command 4 | # CoreOS Kubernetes Cluster for OS X 5 | # 6 | # Created by Rimantas on 01/04/2014. 7 | # Copyright (c) 2014 Rimantas Mocevicius. All rights reserved. 8 | 9 | # get App's Resources folder 10 | res_folder=$(cat ~/coreos-k8s-cluster/.env/resouces_path) 11 | 12 | echo " " 13 | echo Installing Kubernetes cluster... 14 | echo " " 15 | # install vagrant scp plugin 16 | vagrant plugin install vagrant-scp 17 | 18 | ### getting files from github and setting them up 19 | echo "" 20 | echo "Downloading latest coreos-vagrant files from github to tmp folder: " 21 | git clone https://github.com/coreos/coreos-vagrant.git ~/coreos-k8s-cluster/tmp 22 | echo "Done downloading from github !!!" 23 | echo "" 24 | 25 | # copy Vagrantfile 26 | cp ~/coreos-k8s-cluster/tmp/Vagrantfile ~/coreos-k8s-cluster/control/Vagrantfile 27 | cp ~/coreos-k8s-cluster/tmp/Vagrantfile ~/coreos-k8s-cluster/workers/Vagrantfile 28 | 29 | # change control IP to static 30 | sed -i "" 's/172.17.8.#{i+100}/172.17.15.101/g' ~/coreos-k8s-cluster/control/Vagrantfile 31 | # change nodes network subnet and IP to start from 32 | sed -i "" 's/172.17.8.#{i+100}/172.17.15.#{i+101}/g' ~/coreos-k8s-cluster/workers/Vagrantfile 33 | 34 | # config.rb files 35 | # control 36 | cp ~/coreos-k8s-cluster/tmp/config.rb.sample ~/coreos-k8s-cluster/control/config.rb 37 | sed -i "" 's/#$instance_name_prefix="core"/$instance_name_prefix="k8smaster"/' ~/coreos-k8s-cluster/control/config.rb 38 | sed -i "" 's/#$vm_memory = 1024/$vm_memory = 512/' ~/coreos-k8s-cluster/control/config.rb 39 | sed -i "" 's/File.open/#File.open/' ~/coreos-k8s-cluster/control/config.rb 40 | # nodes 41 | cp ~/coreos-k8s-cluster/tmp/config.rb.sample ~/coreos-k8s-cluster/workers/config.rb 42 | sed -i "" 's/#$instance_name_prefix="core"/$instance_name_prefix="k8snode"/' ~/coreos-k8s-cluster/workers/config.rb 43 | sed -i "" 's/File.open/#File.open/' ~/coreos-k8s-cluster/workers/config.rb 44 | # set nodes to 2 45 | sed -i "" 's/[#]*$num_instances=1/$num_instances=2/' ~/coreos-k8s-cluster/workers/config.rb 46 | 47 | 48 | ### 49 | 50 | ### Set release channel 51 | LOOP=1 52 | while [ $LOOP -gt 0 ] 53 | do 54 | VALID_MAIN=0 55 | echo "Set CoreOS Release Channel:" 56 | echo " 1) Alpha " 57 | echo " 2) Beta " 58 | echo " 3) Stable " 59 | echo "Select an option:" 60 | 61 | read RESPONSE 62 | XX=${RESPONSE:=Y} 63 | 64 | if [ $RESPONSE = 1 ] 65 | then 66 | VALID_MAIN=1 67 | sed -i "" 's/#$update_channel/$update_channel/' ~/coreos-k8s-cluster/control/config.rb 68 | sed -i "" "s/channel='stable'/channel='alpha'/" ~/coreos-k8s-cluster/control/config.rb 69 | sed -i "" "s/channel='beta'/channel='alpha'/" ~/coreos-k8s-cluster/control/config.rb 70 | # 71 | sed -i "" 's/#$update_channel/$update_channel/' ~/coreos-k8s-cluster/workers/config.rb 72 | sed -i "" "s/channel='stable'/channel='alpha'/" ~/coreos-k8s-cluster/workers/config.rb 73 | sed -i "" "s/channel='beta'/channel='alpha'/" ~/coreos-k8s-cluster/workers/config.rb 74 | channel="Alpha" 75 | LOOP=0 76 | fi 77 | 78 | if [ $RESPONSE = 2 ] 79 | then 80 | VALID_MAIN=1 81 | sed -i "" 's/#$update_channel/$update_channel/' ~/coreos-k8s-cluster/control/config.rb 82 | sed -i "" "s/channel='alpha'/channel='beta'/" ~/coreos-k8s-cluster/control/config.rb 83 | sed -i "" "s/channel='stable'/channel='beta'/" ~/coreos-k8s-cluster/control/config.rb 84 | # 85 | sed -i "" 's/#$update_channel/$update_channel/' ~/coreos-k8s-cluster/workers/config.rb 86 | sed -i "" "s/channel='alpha'/channel='beta'/" ~/coreos-k8s-cluster/workers/config.rb 87 | sed -i "" "s/channel='stable'/channel='beta'/" ~/coreos-k8s-cluster/workers/config.rb 88 | channel="Beta" 89 | LOOP=0 90 | fi 91 | 92 | if [ $RESPONSE = 3 ] 93 | then 94 | VALID_MAIN=1 95 | sed -i "" 's/#$update_channel/$update_channel/' ~/coreos-k8s-cluster/control/config.rb 96 | sed -i "" "s/channel='alpha'/channel='stable'/" ~/coreos-k8s-cluster/control/config.rb 97 | sed -i "" "s/channel='beta'/channel='stable'/" ~/coreos-k8s-cluster/control/config.rb 98 | # 99 | sed -i "" 's/#$update_channel/$update_channel/' ~/coreos-k8s-cluster/workers/config.rb 100 | sed -i "" "s/channel='alpha'/channel='stable'/" ~/coreos-k8s-cluster/workers/config.rb 101 | sed -i "" "s/channel='beta'/channel='stable'/" ~/coreos-k8s-cluster/workers/config.rb 102 | channel="Stable" 103 | LOOP=0 104 | fi 105 | 106 | if [ $VALID_MAIN != 1 ] 107 | then 108 | continue 109 | fi 110 | done 111 | ### Set release channel 112 | 113 | # 114 | function pause(){ 115 | read -p "$*" 116 | } 117 | 118 | # first up to initialise VMs 119 | echo " " 120 | echo "Setting up Vagrant VMs for CoreOS + Kubernetes Cluster on OS X" 121 | cd ~/coreos-k8s-cluster/control 122 | vagrant box update 123 | vagrant up --provider virtualbox 124 | # 125 | cd ~/coreos-k8s-cluster/workers 126 | vagrant up --provider virtualbox 127 | 128 | # Add vagrant ssh key to ssh-agent 129 | ssh-add ~/.vagrant.d/insecure_private_key >/dev/null 2>&1 130 | 131 | echo " " 132 | echo "Installing k8s files to master and nodes:" 133 | cd ~/coreos-k8s-cluster/control 134 | vagrant scp master.tgz k8smaster-01:/home/core/ 135 | vagrant ssh k8smaster-01 -c "sudo /usr/bin/mkdir -p /opt/bin && sudo tar xzf /home/core/master.tgz -C /opt/bin && sudo chmod 755 /opt/bin/* " >/dev/null 2>&1 136 | # 137 | cd ~/coreos-k8s-cluster/workers 138 | vagrant scp nodes.tgz k8snode-01:/home/core/ 139 | vagrant scp nodes.tgz k8snode-02:/home/core/ 140 | # 141 | vagrant ssh k8snode-01 -c "sudo /usr/bin/mkdir -p /opt/bin && sudo tar xzf /home/core/nodes.tgz -C /opt/bin && sudo chmod 755 /opt/bin/* " >/dev/null 2>&1 142 | vagrant ssh k8snode-02 -c "sudo /usr/bin/mkdir -p /opt/bin && sudo tar xzf /home/core/nodes.tgz -C /opt/bin && sudo chmod 755 /opt/bin/* " >/dev/null 2>&1 143 | echo "Done installing ... " 144 | echo " " 145 | 146 | # download etcdctl and fleetctl 147 | # 148 | cd ~/coreos-k8s-cluster/control 149 | LATEST_RELEASE=$(vagrant ssh k8smaster-01 -c "etcdctl --version" | cut -d " " -f 3- | tr -d '\r' ) 150 | cd ~/coreos-k8s-cluster/bin 151 | echo "Downloading etcdctl $LATEST_RELEASE for OS X" 152 | curl -k -L -o etcd.zip "https://github.com/coreos/etcd/releases/download/v$LATEST_RELEASE/etcd-v$LATEST_RELEASE-darwin-amd64.zip" 153 | unzip -j -o "etcd.zip" "etcd-v$LATEST_RELEASE-darwin-amd64/etcdctl" >/dev/null 2>&1 154 | rm -f etcd.zip 155 | echo " " 156 | 157 | # 158 | cd ~/coreos-k8s-cluster/control 159 | LATEST_RELEASE=$(vagrant ssh k8smaster-01 -c 'fleetctl version' | cut -d " " -f 3- | tr -d '\r') 160 | cd ~/coreos-k8s-cluster/bin 161 | echo "Downloading fleetctl v$LATEST_RELEASE for OS X" 162 | curl -k -L -o fleet.zip "https://github.com/coreos/fleet/releases/download/v$LATEST_RELEASE/fleet-v$LATEST_RELEASE-darwin-amd64.zip" 163 | unzip -j -o "fleet.zip" "fleet-v$LATEST_RELEASE-darwin-amd64/fleetctl" >/dev/null 2>&1 164 | rm -f fleet.zip 165 | echo " " 166 | 167 | # set etcd endpoint 168 | export ETCDCTL_PEERS=http://172.17.15.101:2379 169 | echo "etcd cluster:" 170 | ~/coreos-k8s-cluster/bin/etcdctl ls / 171 | echo " " 172 | 173 | # set fleetctl tunnel 174 | export FLEETCTL_TUNNEL= 175 | export FLEETCTL_ENDPOINT=http://172.17.15.101:2379 176 | export FLEETCTL_DRIVER=etcd 177 | export FLEETCTL_STRICT_HOST_KEY_CHECKING=false 178 | echo "fleetctl list-machines:" 179 | ~/coreos-k8s-cluster/bin/fleetctl list-machines 180 | echo " " 181 | # 182 | echo "Installing fleet units from '~/coreos-k8s-cluster/fleet' folder:" 183 | cd ~/coreos-k8s-cluster/fleet 184 | ~/coreos-k8s-cluster/bin/fleetctl submit *.service 185 | ~/coreos-k8s-cluster/bin/fleetctl start *.service 186 | echo "Finished installing fleet units" 187 | ~/coreos-k8s-cluster/bin/fleetctl list-units 188 | echo " " 189 | 190 | # generate kubeconfig file 191 | ~/coreos-k8s-cluster/bin/gen_kubeconfig 172.17.15.101 192 | # 193 | 194 | # set kubernetes master 195 | export KUBERNETES_MASTER=http://172.17.15.101:8080 196 | echo Waiting for Kubernetes cluster to be ready. This can take a few minutes... 197 | spin='-\|/' 198 | i=0 199 | until ~/coreos-k8s-cluster/bin/kubectl version 2>/dev/null | grep 'Server Version' >/dev/null 2>&1; do i=$(( (i+1) %4 )); printf "\r${spin:$i:1}"; sleep .1; done 200 | i=0 201 | until ~/coreos-k8s-cluster/bin/kubectl get nodes 2>/dev/null | grep '172.17.15.102' | grep 'Ready' >/dev/null 2>&1; do i=$(( (i+1) %4 )); printf "\r${spin:$i:1}"; sleep .1; done 202 | i=0 203 | until ~/coreos-k8s-cluster/bin/kubectl get nodes 2>/dev/null | grep '172.17.15.103' | grep 'Ready' >/dev/null 2>&1; do i=$(( (i+1) %4 )); printf "\r${spin:$i:1}"; sleep .1; done 204 | 205 | # attach label to the nodes 206 | echo " " 207 | ~/coreos-k8s-cluster/bin/kubectl label nodes 172.17.15.102 node=worker1 208 | ~/coreos-k8s-cluster/bin/kubectl label nodes 172.17.15.103 node=worker2 209 | # 210 | echo " " 211 | echo "Creating kube-system namespace ..." 212 | ~/coreos-k8s-cluster/bin/kubectl create -f ~/coreos-k8s-cluster/kubernetes/kube-system-ns.yaml 213 | # 214 | echo " " 215 | echo "Installing SkyDNS ..." 216 | ~/coreos-k8s-cluster/bin/kubectl create -f ~/coreos-k8s-cluster/kubernetes/skydns-rc.yaml 217 | ~/coreos-k8s-cluster/bin/kubectl create -f ~/coreos-k8s-cluster/kubernetes/skydns-svc.yaml 218 | # 219 | echo " " 220 | echo "Installing Kubernetes UI ..." 221 | ~/coreos-k8s-cluster/bin/kubectl create -f ~/coreos-k8s-cluster/kubernetes/dashboard-controller.yaml 222 | ~/coreos-k8s-cluster/bin/kubectl create -f ~/coreos-k8s-cluster/kubernetes/dashboard-service.yaml 223 | # clean up kubernetes folder 224 | rm -f ~/coreos-k8s-cluster/kubernetes/kube-system-ns.yaml 225 | rm -f ~/coreos-k8s-cluster/kubernetes/skydns-rc.yaml 226 | rm -f ~/coreos-k8s-cluster/kubernetes/skydns-svc.yaml 227 | rm -f ~/coreos-k8s-cluster/kubernetes/dashboard-controller.yaml 228 | rm -f ~/coreos-k8s-cluster/kubernetes/dashboard-service.yaml 229 | 230 | # 231 | echo " " 232 | echo "kubectl get nodes:" 233 | ~/coreos-k8s-cluster/bin/kubectl get nodes 234 | echo " " 235 | 236 | # 237 | echo " " 238 | echo "Installation has finished, CoreOS VMs are up and running !!!" 239 | echo "Enjoy CoreOS+Kubernetes Cluster on your Mac !!!" 240 | echo " " 241 | echo "Run from menu 'OS Shell' to open a terninal window with fleetctl, etcdctl and kubectl preset to master's IP!!!" 242 | echo " " 243 | pause 'Press [Enter] key to continue...' 244 | -------------------------------------------------------------------------------- /src/fleet/fleet-ui.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=fleet-ui 3 | After=docker.service 4 | Requires=docker.service 5 | 6 | [Service] 7 | User=core 8 | TimeoutStartSec=0 9 | EnvironmentFile=/etc/environment 10 | ExecStartPre=/usr/bin/docker pull purpleworks/fleet-ui:latest 11 | ExecStartPre=-/usr/bin/docker rm fleet_ui 12 | ExecStart=/usr/bin/docker run --rm --name fleet_ui --memory="128m" \ 13 | -p 3000:3000 -e ETCD_PEER=http://172.17.15.101:2379 \ 14 | -v /home/core/.ssh/id_rsa:/root/id_rsa \ 15 | purpleworks/fleet-ui 16 | # 17 | ExecStop=/usr/bin/docker kill fleet_ui 18 | ExecStopPost=-/usr/bin/docker rm fleet_ui 19 | 20 | TimeoutStartSec=900s 21 | Restart=always 22 | RestartSec=10s 23 | 24 | [X-Fleet] 25 | MachineMetadata=role=control 26 | -------------------------------------------------------------------------------- /src/fleet/kube-apiserver.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Kubernetes API Server 3 | Documentation=https://github.com/GoogleCloudPlatform/kubernetes 4 | 5 | [Service] 6 | EnvironmentFile=/etc/environment 7 | ExecStart=/opt/bin/kube-apiserver \ 8 | --client-ca-file=/srv/kubernetes/ca.crt \ 9 | --tls-cert-file=/srv/kubernetes/server.cert \ 10 | --tls-private-key-file=/srv/kubernetes/server.key \ 11 | --admission_control=NamespaceLifecycle,NamespaceExists,LimitRanger,SecurityContextDeny,ServiceAccount,ResourceQuota \ 12 | --service_account_key_file=/srv/kubernetes/server.key \ 13 | --service_account_lookup=false \ 14 | --allow_privileged=true \ 15 | --insecure_bind_address=0.0.0.0 \ 16 | --insecure_port=8080 \ 17 | --kubelet_https=true \ 18 | --secure_port=6443 \ 19 | --service-cluster-ip-range=10.100.0.0/16 \ 20 | --etcd_servers=http://127.0.0.1:2379 \ 21 | --public_address_override=127.0.0.1 \ 22 | --logtostderr=true 23 | 24 | Restart=always 25 | RestartSec=10 26 | 27 | [X-Fleet] 28 | MachineMetadata=role=control 29 | -------------------------------------------------------------------------------- /src/fleet/kube-controller-manager.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Kubernetes Controller Manager 3 | Documentation=https://github.com/GoogleCloudPlatform/kubernetes 4 | 5 | [Service] 6 | EnvironmentFile=/etc/environment 7 | ExecStart=/opt/bin/kube-controller-manager \ 8 | --root-ca-file=/srv/kubernetes/ca.crt \ 9 | --service-account-private-key-file=/srv/kubernetes/server.key \ 10 | --master=127.0.0.1:8080 \ 11 | --pod_eviction_timeout=30s \ 12 | --logtostderr=true 13 | 14 | Restart=always 15 | RestartSec=10 16 | 17 | [X-Fleet] 18 | MachineOf=kube-apiserver.service 19 | -------------------------------------------------------------------------------- /src/fleet/kube-kubelet.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Kubernetes Kubelet 3 | Documentation=https://github.com/GoogleCloudPlatform/kubernetes 4 | 5 | [Service] 6 | EnvironmentFile=/etc/environment 7 | ExecStartPre=/opt/bin/wupiao 172.17.15.101:8080 8 | ExecStart=/opt/bin/kubelet \ 9 | --address=0.0.0.0 \ 10 | --port=10250 \ 11 | --hostname_override=${COREOS_PRIVATE_IPV4} \ 12 | --api_servers=http://172.17.15.101:8080 \ 13 | --register-node=true \ 14 | --container_runtime=docker \ 15 | --allow_privileged=true \ 16 | --cluster_dns=10.100.0.10 \ 17 | --cluster_domain=cluster.local \ 18 | --logtostderr=true \ 19 | --cadvisor_port=4194 \ 20 | --healthz_bind_address=0.0.0.0 \ 21 | --healthz_port=10248 22 | 23 | Restart=always 24 | RestartSec=10 25 | 26 | [X-Fleet] 27 | Global=true 28 | MachineMetadata=role=node 29 | -------------------------------------------------------------------------------- /src/fleet/kube-proxy.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Kubernetes Proxy 3 | Documentation=https://github.com/GoogleCloudPlatform/kubernetes 4 | 5 | [Service] 6 | EnvironmentFile=/etc/environment 7 | ExecStartPre=/opt/bin/wupiao 172.17.15.101:8080 8 | ExecStart=/opt/bin/kube-proxy \ 9 | --master=http://172.17.15.101:8080 \ 10 | --logtostderr=true 11 | 12 | Restart=always 13 | RestartSec=10 14 | 15 | [X-Fleet] 16 | Global=true 17 | MachineMetadata=role=node 18 | -------------------------------------------------------------------------------- /src/fleet/kube-scheduler.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Kubernetes API Server 3 | Documentation=https://github.com/GoogleCloudPlatform/kubernetes 4 | 5 | [Service] 6 | EnvironmentFile=/etc/environment 7 | ExecStartPre=/opt/bin/wupiao 127.0.0.1:8080 8 | ExecStart=/opt/bin/kube-scheduler --master=127.0.0.1:8080 9 | 10 | Restart=always 11 | RestartSec=10 12 | 13 | [X-Fleet] 14 | MachineOf=kube-apiserver.service 15 | -------------------------------------------------------------------------------- /src/force_coreos_update.command: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # force_coreos_update.command 4 | # CoreOS Kubernetes Cluster for OS X 5 | # 6 | # Created by Rimantas on 01/04/2014. 7 | # Copyright (c) 2014 Rimantas Mocevicius. All rights reserved. 8 | 9 | function pause(){ 10 | read -p "$*" 11 | } 12 | 13 | cd ~/coreos-k8s-cluster/control 14 | vagrant up 15 | vagrant ssh k8smaster-01 -c "sudo update_engine_client -update" 16 | echo "Done with k8smaster-01 " 17 | echo " " 18 | # 19 | cd ~/coreos-k8s-cluster/workers 20 | vagrant up 21 | vagrant ssh k8snode-01 -c "sudo update_engine_client -update" 22 | echo "Done with k8snode-01 " 23 | echo " " 24 | vagrant ssh k8snode-02 -c "sudo update_engine_client -update" 25 | echo "Done with k8snode-02 " 26 | echo " " 27 | 28 | echo "Update has finished !!!" 29 | echo "You need to reboot machines if CoreOS update was successful" 30 | echo "Just use 'Reload' from the App menu" 31 | pause 'Press [Enter] key to continue...' 32 | -------------------------------------------------------------------------------- /src/gen_kubeconfig: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | server=$1 4 | 5 | rm -f "$HOME/coreos-k8s-cluster/control/kubeconfig" 6 | kubectl=$HOME/coreos-k8s-cluster/bin/kubectl 7 | $kubectl --kubeconfig="$HOME/coreos-k8s-cluster/control/kubeconfig" config set-cluster k8cluster-01 --server=http://$server:8080 8 | $kubectl --kubeconfig="$HOME/coreos-k8s-cluster/control/kubeconfig" config set-context default-context --cluster=k8cluster-01 9 | $kubectl --kubeconfig="$HOME/coreos-k8s-cluster/control/kubeconfig" config use-context default-context 10 | -------------------------------------------------------------------------------- /src/gsed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rimusz/coreos-kubernetes-cluster-osx/6fa4a44846f8df02ab0d2f24737179c0a5a8924d/src/gsed -------------------------------------------------------------------------------- /src/icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rimusz/coreos-kubernetes-cluster-osx/6fa4a44846f8df02ab0d2f24737179c0a5a8924d/src/icon.icns -------------------------------------------------------------------------------- /src/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rimusz/coreos-kubernetes-cluster-osx/6fa4a44846f8df02ab0d2f24737179c0a5a8924d/src/icon.png -------------------------------------------------------------------------------- /src/icon2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rimusz/coreos-kubernetes-cluster-osx/6fa4a44846f8df02ab0d2f24737179c0a5a8924d/src/icon2.png -------------------------------------------------------------------------------- /src/k8s/dashboard-controller.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ReplicationController 3 | metadata: 4 | # Keep the name in sync with image version and 5 | # gce/coreos/kube-manifests/addons/dashboard counterparts 6 | name: kubernetes-dashboard-v1.0.1 7 | namespace: kube-system 8 | labels: 9 | k8s-app: kubernetes-dashboard 10 | version: v1.0.1 11 | kubernetes.io/cluster-service: "true" 12 | spec: 13 | replicas: 1 14 | selector: 15 | k8s-app: kubernetes-dashboard 16 | template: 17 | metadata: 18 | labels: 19 | k8s-app: kubernetes-dashboard 20 | version: v1.0.1 21 | kubernetes.io/cluster-service: "true" 22 | spec: 23 | containers: 24 | - name: kubernetes-dashboard 25 | image: gcr.io/google_containers/kubernetes-dashboard-amd64:v1.0.1 26 | command: 27 | - "/dashboard" 28 | - "--port=9090" 29 | - "--apiserver-host=172.17.15.101:8080" 30 | resources: 31 | # keep request = limit to keep this container in guaranteed class 32 | limits: 33 | cpu: 100m 34 | memory: 50Mi 35 | requests: 36 | cpu: 100m 37 | memory: 50Mi 38 | ports: 39 | - containerPort: 9090 40 | livenessProbe: 41 | httpGet: 42 | path: / 43 | port: 9090 44 | initialDelaySeconds: 30 45 | timeoutSeconds: 30 46 | -------------------------------------------------------------------------------- /src/k8s/dashboard-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: kubernetes-dashboard 5 | namespace: kube-system 6 | labels: 7 | k8s-app: kubernetes-dashboard 8 | kubernetes.io/cluster-service: "true" 9 | spec: 10 | selector: 11 | k8s-app: kubernetes-dashboard 12 | ports: 13 | - port: 80 14 | targetPort: 9090 15 | -------------------------------------------------------------------------------- /src/k8s/download_k8s.command: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # download_k8s.command 4 | # CoreOS Kubernetes Cluster for OS X 5 | # 6 | # Created by Rimantas on 01/04/2014. 7 | # Copyright (c) 2014 Rimantas Mocevicius. All rights reserved. 8 | 9 | function pause(){ 10 | read -p "$*" 11 | } 12 | 13 | rm -f kubectl 14 | rm -f *.tgz 15 | 16 | mkdir nodes 17 | mkdir master 18 | 19 | # get latest k8s version 20 | function get_latest_version_number { 21 | local -r latest_url="https://storage.googleapis.com/kubernetes-release/release/stable.txt" 22 | curl -Ss ${latest_url} 23 | 24 | } 25 | 26 | K8S_VERSION=$(get_latest_version_number) 27 | 28 | # download latest version of kubectl for OS X 29 | echo "Downloading kubectl $K8S_VERSION for OS X" 30 | curl -k -L https://storage.googleapis.com/kubernetes-release/release/$K8S_VERSION/bin/darwin/amd64/kubectl > kubectl 31 | chmod a+x kubectl 32 | 33 | # download latest version of k8s binaries for CoreOS 34 | # master 35 | bins=( kubectl kube-apiserver kube-scheduler kube-controller-manager ) 36 | for b in "${bins[@]}"; do 37 | curl -k -L https://storage.googleapis.com/kubernetes-release/release/$K8S_VERSION/bin/linux/amd64/$b > master/$b 38 | done 39 | chmod a+x master/* 40 | tar czvf master.tgz -C master . 41 | rm -f ./master/* 42 | 43 | # nodes 44 | bins=( kubectl kubelet kube-proxy ) 45 | for b in "${bins[@]}"; do 46 | curl -k -L https://storage.googleapis.com/kubernetes-release/release/$K8S_VERSION/bin/linux/amd64/$b > nodes/$b 47 | done 48 | chmod a+x nodes/* 49 | tar czvf nodes.tgz -C nodes . 50 | rm -f ./nodes/* 51 | 52 | # 53 | echo "Download has finished !!!" 54 | pause 'Press [Enter] key to continue...' 55 | -------------------------------------------------------------------------------- /src/k8s/kube-system-ns.yaml: -------------------------------------------------------------------------------- 1 | kind: "Namespace" 2 | apiVersion: "v1" 3 | metadata: 4 | name: "kube-system" 5 | labels: 6 | name: "kube-system" 7 | -------------------------------------------------------------------------------- /src/k8s/kubectl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rimusz/coreos-kubernetes-cluster-osx/6fa4a44846f8df02ab0d2f24737179c0a5a8924d/src/k8s/kubectl -------------------------------------------------------------------------------- /src/k8s/master.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rimusz/coreos-kubernetes-cluster-osx/6fa4a44846f8df02ab0d2f24737179c0a5a8924d/src/k8s/master.tgz -------------------------------------------------------------------------------- /src/k8s/nodes.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rimusz/coreos-kubernetes-cluster-osx/6fa4a44846f8df02ab0d2f24737179c0a5a8924d/src/k8s/nodes.tgz -------------------------------------------------------------------------------- /src/k8s/skydns-rc.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ReplicationController 3 | metadata: 4 | name: kube-dns-v11 5 | namespace: kube-system 6 | labels: 7 | k8s-app: kube-dns 8 | version: v11 9 | kubernetes.io/cluster-service: "true" 10 | spec: 11 | replicas: 1 12 | selector: 13 | k8s-app: kube-dns 14 | version: v11 15 | template: 16 | metadata: 17 | labels: 18 | k8s-app: kube-dns 19 | version: v11 20 | kubernetes.io/cluster-service: "true" 21 | spec: 22 | containers: 23 | - name: etcd 24 | image: gcr.io/google_containers/etcd-amd64:2.2.1 25 | resources: 26 | # TODO: Set memory limits when we've profiled the container for large 27 | # clusters, then set request = limit to keep this container in 28 | # guaranteed class. Currently, this container falls into the 29 | # "burstable" category so the kubelet doesn't backoff from restarting it. 30 | limits: 31 | cpu: 100m 32 | memory: 500Mi 33 | requests: 34 | cpu: 100m 35 | memory: 50Mi 36 | command: 37 | - /usr/local/bin/etcd 38 | - -data-dir 39 | - /var/etcd/data 40 | - -listen-client-urls 41 | - http://127.0.0.1:2379,http://127.0.0.1:4001 42 | - -advertise-client-urls 43 | - http://127.0.0.1:2379,http://127.0.0.1:4001 44 | - -initial-cluster-token 45 | - skydns-etcd 46 | volumeMounts: 47 | - name: etcd-storage 48 | mountPath: /var/etcd/data 49 | - name: kube2sky 50 | image: gcr.io/google_containers/kube2sky:1.14 51 | resources: 52 | # TODO: Set memory limits when we've profiled the container for large 53 | # clusters, then set request = limit to keep this container in 54 | # guaranteed class. Currently, this container falls into the 55 | # "burstable" category so the kubelet doesn't backoff from restarting it. 56 | limits: 57 | cpu: 100m 58 | # Kube2sky watches all pods. 59 | memory: 200Mi 60 | requests: 61 | cpu: 100m 62 | memory: 50Mi 63 | livenessProbe: 64 | httpGet: 65 | path: /healthz 66 | port: 8080 67 | scheme: HTTP 68 | initialDelaySeconds: 60 69 | timeoutSeconds: 5 70 | successThreshold: 1 71 | failureThreshold: 5 72 | readinessProbe: 73 | httpGet: 74 | path: /readiness 75 | port: 8081 76 | scheme: HTTP 77 | # we poll on pod startup for the Kubernetes master service and 78 | # only setup the /readiness HTTP server once that's available. 79 | initialDelaySeconds: 30 80 | timeoutSeconds: 5 81 | args: 82 | # command = "/kube2sky" 83 | - --kube_master_url=http://172.17.15.101:8080 84 | - --domain=cluster.local 85 | - name: skydns 86 | image: gcr.io/google_containers/skydns:2015-10-13-8c72f8c 87 | resources: 88 | # TODO: Set memory limits when we've profiled the container for large 89 | # clusters, then set request = limit to keep this container in 90 | # guaranteed class. Currently, this container falls into the 91 | # "burstable" category so the kubelet doesn't backoff from restarting it. 92 | limits: 93 | cpu: 100m 94 | memory: 200Mi 95 | requests: 96 | cpu: 100m 97 | memory: 50Mi 98 | args: 99 | # command = "/skydns" 100 | - -machines=http://127.0.0.1:4001 101 | - -addr=0.0.0.0:53 102 | - -ns-rotate=false 103 | - -domain=cluster.local 104 | ports: 105 | - containerPort: 53 106 | name: dns 107 | protocol: UDP 108 | - containerPort: 53 109 | name: dns-tcp 110 | protocol: TCP 111 | - name: healthz 112 | image: gcr.io/google_containers/exechealthz:1.0 113 | resources: 114 | # keep request = limit to keep this container in guaranteed class 115 | limits: 116 | cpu: 10m 117 | memory: 20Mi 118 | requests: 119 | cpu: 10m 120 | memory: 20Mi 121 | args: 122 | - -cmd=nslookup kubernetes.default.svc.cluster.local 127.0.0.1 >/dev/null 123 | - -port=8080 124 | ports: 125 | - containerPort: 8080 126 | protocol: TCP 127 | volumes: 128 | - name: etcd-storage 129 | emptyDir: {} 130 | dnsPolicy: Default # Don't use cluster DNS. 131 | -------------------------------------------------------------------------------- /src/k8s/skydns-svc.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: kube-dns 5 | namespace: kube-system 6 | labels: 7 | k8s-app: kube-dns 8 | kubernetes.io/cluster-service: "true" 9 | kubernetes.io/name: "KubeDNS" 10 | spec: 11 | selector: 12 | k8s-app: kube-dns 13 | clusterIP: 10.100.0.10 14 | ports: 15 | - name: dns 16 | port: 53 17 | protocol: UDP 18 | - name: dns-tcp 19 | port: 53 20 | protocol: TCP 21 | -------------------------------------------------------------------------------- /src/kubectl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cmd=($HOME/coreos-k8s-cluster/control/kubectl --kubeconfig="$HOME/coreos-k8s-cluster/control/kubeconfig" "${@+$@}") 4 | 5 | "${cmd[@]}" 6 | -------------------------------------------------------------------------------- /src/os_shell.command: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # os_shell.command 4 | # CoreOS Kubernetes Cluster for OS X 5 | # 6 | # Created by Rimantas on 01/12/2014. 7 | # Copyright (c) 2014 Rimantas Mocevicius. All rights reserved. 8 | 9 | # Add vagrant ssh key to ssh-agent 10 | ssh-add ~/.vagrant.d/insecure_private_key >/dev/null 2>&1 11 | 12 | # path to the bin folder where we store our binary files 13 | export PATH=${HOME}/coreos-k8s-cluster/bin:$PATH 14 | 15 | # set etcd endpoint 16 | export ETCDCTL_PEERS=http://172.17.15.101:2379 17 | echo "etcd cluster:" 18 | etcdctl --no-sync ls / 19 | echo "" 20 | 21 | # set fleetctl endpoint 22 | export FLEETCTL_ENDPOINT=http://172.17.15.101:2379 23 | export FLEETCTL_DRIVER=etcd 24 | export FLEETCTL_STRICT_HOST_KEY_CHECKING=false 25 | echo "fleetctl list-machines:" 26 | fleetctl list-machines 27 | echo " " 28 | echo "fleetctl list-units:" 29 | fleetctl list-units 30 | echo " " 31 | 32 | # set kubernetes master 33 | export KUBERNETES_MASTER=http://172.17.15.101:8080 34 | echo "kubectl get nodes:" 35 | kubectl get nodes 36 | echo " " 37 | 38 | # open bash shell 39 | /bin/bash 40 | -------------------------------------------------------------------------------- /src/update.command: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # update.command 4 | # CoreOS Kubernetes Cluster for OS X 5 | # 6 | # Created by Rimantas on 01/04/2014. 7 | # Copyright (c) 2014 Rimantas Mocevicius. All rights reserved. 8 | 9 | function pause(){ 10 | read -p "$*" 11 | } 12 | 13 | # get App's Resources folder 14 | res_folder=$(cat ~/coreos-k8s-cluster/.env/resouces_path) 15 | 16 | # copy gsed to ~/coreos-k8s-cluster/bin 17 | cp -f "${res_folder}"/gsed ~/coreos-k8s-cluster/bin 18 | chmod 755 ~/coreos-k8s-cluster/bin/gsed 19 | 20 | # copy wget with https support to ~/coreos-k8s-cluster/bin 21 | cp -f "${res_folder}"/wget ~/coreos-k8s-cluster/bin 22 | chmod 755 ~/coreos-k8s-cluster/bin/wget 23 | 24 | # 25 | cd ~/coreos-k8s-cluster/control 26 | vagrant up 27 | # 28 | cd ~/coreos-k8s-cluster/workers 29 | vagrant up 30 | 31 | # download latest versions of etcdctl and fleetctl 32 | cd ~/coreos-k8s-cluster/control 33 | LATEST_RELEASE=$(vagrant ssh k8smaster-01 -c "etcdctl --version" | cut -d " " -f 3- | tr -d '\r' ) 34 | cd ~/coreos-k8s-cluster/bin 35 | echo "Downloading etcdctl $LATEST_RELEASE for OS X" 36 | curl -k -L -o etcd.zip "https://github.com/coreos/etcd/releases/download/v$LATEST_RELEASE/etcd-v$LATEST_RELEASE-darwin-amd64.zip" 37 | unzip -j -o "etcd.zip" "etcd-v$LATEST_RELEASE-darwin-amd64/etcdctl" 38 | rm -f etcd.zip 39 | echo "etcdctl was copied to ~/coreos-k8s-cluster/bin" 40 | echo " " 41 | 42 | # 43 | cd ~/coreos-k8s-cluster/control 44 | LATEST_RELEASE=$(vagrant ssh k8smaster-01 -c 'fleetctl version' | cut -d " " -f 3- | tr -d '\r') 45 | cd ~/coreos-k8s-cluster/bin 46 | echo "Downloading fleetctl v$LATEST_RELEASE for OS X" 47 | curl -k -L -o fleet.zip "https://github.com/coreos/fleet/releases/download/v$LATEST_RELEASE/fleet-v$LATEST_RELEASE-darwin-amd64.zip" 48 | unzip -j -o "fleet.zip" "fleet-v$LATEST_RELEASE-darwin-amd64/fleetctl" 49 | rm -f fleet.zip 50 | echo "fleetctl was copied to ~/coreos-k8s-cluster/bin " 51 | echo " " 52 | 53 | # get lastest OS X helm version from bintray 54 | bin_version=$(curl -I https://bintray.com/deis/helm/helm/_latestVersion | grep "Location:" | sed -n 's%.*helm/%%;s%/view.*%%p' ) 55 | echo "Downloading helm latest version for OS X" 56 | curl -L "https://dl.bintray.com/deis/helm/helm-$bin_version-darwin-amd64.zip" -o helm.zip 57 | unzip -o helm.zip 58 | rm -f helm.zip 59 | # 60 | 61 | # 62 | echo "Reinstalling updated fleet units to '~/coreos-k8s-cluster/fleet' folder:" 63 | # set fleetctl tunnel 64 | export FLEETCTL_ENDPOINT=http://172.17.15.101:2379 65 | export FLEETCTL_DRIVER=etcd 66 | export FLEETCTL_STRICT_HOST_KEY_CHECKING=false 67 | cd ~/coreos-k8s-cluster/fleet 68 | 69 | # 70 | if [ "$(diff "$res_folder"/fleet/fleet-ui.service ~/coreos-k8s-cluster/fleet/fleet-ui.service | tr -d '\n' | cut -c1-4 )" != "" ] 71 | then 72 | echo "updating fleet-ui.service!" 73 | cp -fr "$res_folder"/fleet/fleet-ui.service ~/coreos-k8s-cluster/fleet/fleet-ui.service 74 | ~/coreos-k8s-cluster/bin/fleetctl destroy fleet-ui.service 75 | ~/coreos-k8s-cluster/bin/fleetctl start fleet-ui.service 76 | fi 77 | 78 | if [ "$(diff "$res_folder"/fleet/kube-apiserver.service ~/coreos-k8s-cluster/fleet/kube-apiserver.service | tr -d '\n' | cut -c1-4 )" != "" ] 79 | then 80 | echo "updating kube-apiserver.service!" 81 | cp -fr "$res_folder"/fleet/kube-apiserver.service ~/coreos-k8s-cluster/fleet/kube-apiserver.service 82 | ~/coreos-k8s-cluster/bin/fleetctl destroy kube-apiserver.service 83 | ~/coreos-k8s-cluster/bin/fleetctl start kube-apiserver.service 84 | fi 85 | 86 | if [ "$(diff "$res_folder"/fleet/kube-controller-manager.service ~/coreos-k8s-cluster/fleet/kube-controller-manager.service | tr -d '\n' | cut -c1-4 )" != "" ] 87 | then 88 | echo "updating kube-controller-manager.service!" 89 | cp -fr "$res_folder"/fleet/kube-controller-manager.service ~/coreos-k8s-cluster/fleet/kube-controller-manager.service 90 | ~/coreos-k8s-cluster/bin/fleetctl destroy kube-controller-manager.service 91 | ~/coreos-k8s-cluster/bin/fleetctl start kube-controller-manager.service 92 | fi 93 | 94 | if [ "$(diff "$res_folder"/fleet/kube-kubelet.service ~/coreos-k8s-cluster/fleet/kube-kubelet.service | tr -d '\n' | cut -c1-4 )" != "" ] 95 | then 96 | echo "updating kube-kubelet.service!" 97 | cp -fr "$res_folder"/fleet/kube-kubelet.service ~/coreos-k8s-cluster/fleet/kube-kubelet.service 98 | ~/coreos-k8s-cluster/bin/fleetctl destroy kube-kubelet.service 99 | ~/coreos-k8s-cluster/bin/fleetctl start kube-kubelet.service 100 | fi 101 | 102 | if [ "$(diff "$res_folder"/fleet/kube-proxy.service ~/coreos-k8s-cluster/fleet/kube-proxy.service | tr -d '\n' | cut -c1-4 )" != "" ] 103 | then 104 | echo "updating kube-proxy.service!" 105 | cp -fr "$res_folder"/fleet/kube-proxy.service ~/coreos-k8s-cluster/fleet/kube-proxy.service 106 | ~/coreos-k8s-cluster/bin/fleetctl destroy kube-proxy.service 107 | ~/coreos-k8s-cluster/bin/fleetctl start kube-proxy.service 108 | fi 109 | 110 | if [ "$(diff "$res_folder"/fleet/kube-scheduler.service ~/coreos-k8s-cluster/fleet/kube-scheduler.service | tr -d '\n' | cut -c1-4 )" != "" ] 111 | then 112 | echo "updating kube-scheduler.service!" 113 | cp -fr "$res_folder"/fleet/kube-scheduler.service ~/coreos-k8s-cluster/fleet/kube-scheduler.service 114 | ~/coreos-k8s-cluster/bin/fleetctl destroy kube-scheduler.service 115 | ~/coreos-k8s-cluster/bin/fleetctl start kube-scheduler.service 116 | fi 117 | 118 | 119 | # 120 | echo "Finished updating fleet units" 121 | ~/coreos-k8s-cluster/bin/fleetctl list-units 122 | echo " " 123 | 124 | # set kubernetes master 125 | export KUBERNETES_MASTER=http://172.17.15.101:8080 126 | echo Waiting for Kubernetes cluster to be ready. This can take a few minutes... 127 | spin='-\|/' 128 | i=1 129 | until ~/coreos-k8s-cluster/bin/kubectl version | grep 'Server Version' >/dev/null 2>&1; do printf "\b${spin:i++%${#sp}:1}"; sleep .1; done 130 | i=0 131 | until ~/coreos-k8s-cluster/bin/kubectl get nodes | grep 172.17.15.102 >/dev/null 2>&1; do i=$(( (i+1) %4 )); printf "\r${spin:$i:1}"; sleep .1; done 132 | i=0 133 | until ~/coreos-k8s-cluster/bin/kubectl get nodes | grep 172.17.15.103 >/dev/null 2>&1; do i=$(( (i+1) %4 )); printf "\r${spin:$i:1}"; sleep .1; done 134 | # 135 | echo " " 136 | echo "k8s nodes list:" 137 | ~/coreos-k8s-cluster/bin/kubectl get nodes 138 | echo " " 139 | 140 | 141 | # 142 | echo "Update has finished !!!" 143 | pause 'Press [Enter] key to continue...' 144 | -------------------------------------------------------------------------------- /src/update_k8s.command: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # update_k8s.command 4 | # CoreOS Kubernetes Cluster for OS X 5 | # 6 | # Created by Rimantas on 01/04/2014. 7 | # Copyright (c) 2014 Rimantas Mocevicius. All rights reserved. 8 | 9 | function pause(){ 10 | read -p "$*" 11 | } 12 | 13 | # get latest k8s version 14 | function get_latest_version_number { 15 | local -r latest_url="https://storage.googleapis.com/kubernetes-release/release/stable.txt" 16 | curl -Ss ${latest_url} 17 | } 18 | 19 | K8S_VERSION=$(get_latest_version_number) 20 | 21 | # download latest version of kubectl for OS X 22 | echo "Downloading kubectl $K8S_VERSION for OS X" 23 | ~/coreos-k8s-cluster/bin/wget -N -P ~/coreos-k8s-cluster/control https://storage.googleapis.com/kubernetes-release/release/$K8S_VERSION/bin/darwin/amd64/kubectl 24 | chmod a+x ~/coreos-k8s-cluster/control/kubectl 25 | echo "kubectl was downloaded to ~/coreos-k8s-cluster/control" 26 | echo " " 27 | 28 | cd ~/coreos-k8s-cluster/tmp 29 | # clean up tmp folder 30 | rm -rf ~/coreos-k8s-cluster/tmp/* 31 | # download latest version of k8s for CoreOS 32 | # master 33 | echo "Downloading k8s $K8S_VERSION master services" 34 | bins=( kubectl kube-apiserver kube-scheduler kube-controller-manager ) 35 | for b in "${bins[@]}"; do 36 | curl -k -L https://storage.googleapis.com/kubernetes-release/release/$K8S_VERSION/bin/linux/amd64/$b > ~/coreos-k8s-cluster/tmp/$b 37 | done 38 | chmod a+x ~/coreos-k8s-cluster/tmp/* 39 | tar czvf master.tgz * 40 | cp -f master.tgz ~/coreos-k8s-cluster/control/ 41 | # clean up tmp folder 42 | rm -rf ~/coreos-k8s-cluster/tmp/* 43 | echo " " 44 | 45 | # nodes 46 | echo "Downloading k8s $K8S_VERSION node services" 47 | bins=( kubectl kubelet kube-proxy ) 48 | for b in "${bins[@]}"; do 49 | curl -k -L https://storage.googleapis.com/kubernetes-release/release/$K8S_VERSION/bin/linux/amd64/$b > ~/coreos-k8s-cluster/tmp/$b 50 | done 51 | chmod a+x ~/coreos-k8s-cluster/tmp/* 52 | tar czvf nodes.tgz * 53 | cp -f nodes.tgz ~/coreos-k8s-cluster/workers/ 54 | # clean up tmp folder 55 | rm -rf ~/coreos-k8s-cluster/tmp/* 56 | 57 | # install k8s files on master 58 | echo "Installing k8s $K8S_VERSION master services" 59 | cd ~/coreos-k8s-cluster/control 60 | vagrant scp master.tgz k8smaster-01:/home/core/ 61 | vagrant ssh k8smaster-01 -c "sudo /usr/bin/mkdir -p /opt/bin && sudo tar xzf /home/core/master.tgz -C /opt/bin && sudo chmod 755 /opt/bin/* " 62 | echo "Done with k8smaster-01 " 63 | echo " " 64 | 65 | # install k8s files on nodes 66 | echo "Installing k8s $K8S_VERSION node services" 67 | cd ~/coreos-k8s-cluster/workers 68 | vagrant scp nodes.tgz k8snode-01:/home/core/ 69 | vagrant scp nodes.tgz k8snode-02:/home/core/ 70 | # 71 | vagrant ssh k8snode-01 -c "sudo /usr/bin/mkdir -p /opt/bin && sudo tar xzf /home/core/nodes.tgz -C /opt/bin && sudo chmod 755 /opt/bin/* " 72 | echo "Done with k8snode-01 " 73 | echo " " 74 | vagrant ssh k8snode-02 -c "sudo /usr/bin/mkdir -p /opt/bin && sudo tar xzf /home/core/nodes.tgz -C /opt/bin && sudo chmod 755 /opt/bin/* " 75 | echo "Done with k8snode-02 " 76 | # 77 | 78 | # generate kubeconfig file 79 | ~/coreos-k8s-cluster/bin/gen_kubeconfig 172.17.15.101 80 | # 81 | 82 | # restart fleet units 83 | echo "Restarting fleet units:" 84 | # set fleetctl tunnel 85 | export FLEETCTL_ENDPOINT=http://172.17.15.101:2379 86 | export FLEETCTL_DRIVER=etcd 87 | export FLEETCTL_STRICT_HOST_KEY_CHECKING=false 88 | cd ~/coreos-k8s-cluster/fleet 89 | ~/coreos-k8s-cluster/bin/fleetctl stop *.service 90 | sleep 5 91 | ~/coreos-k8s-cluster/bin/fleetctl start *.service 92 | # 93 | sleep 8 94 | echo " " 95 | echo "fleetctl list-units:" 96 | ~/coreos-k8s-cluster/bin/fleetctl list-units 97 | echo " " 98 | 99 | # set kubernetes master 100 | export KUBERNETES_MASTER=http://172.17.15.101:8080 101 | echo Waiting for Kubernetes cluster to be ready. This can take a few minutes... 102 | spin='-\|/' 103 | i=1 104 | until ~/coreos-k8s-cluster/bin/kubectl version | grep 'Server Version' >/dev/null 2>&1; do printf "\b${spin:i++%${#sp}:1}"; sleep .1; done 105 | i=0 106 | until ~/coreos-k8s-cluster/bin/kubectl get nodes | grep ' Ready' >/dev/null 2>&1; do i=$(( (i+1) %4 )); printf "\r${spin:$i:1}"; sleep .1; done 107 | i=0 108 | until ~/coreos-k8s-cluster/bin/kubectl get nodes | grep ' Ready' >/dev/null 2>&1; do i=$(( (i+1) %4 )); printf "\r${spin:$i:1}"; sleep .1; done 109 | # 110 | echo " " 111 | echo "k8s nodes list:" 112 | ~/coreos-k8s-cluster/bin/kubectl get nodes 113 | echo " " 114 | 115 | 116 | echo "k8s update has finished !!!" 117 | pause 'Press [Enter] key to continue...' 118 | -------------------------------------------------------------------------------- /src/update_vbox.command: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # update_vbox.command 4 | # CoreOS Kubernetes Cluster for OS X 5 | # 6 | # Created by Rimantas on 01/04/2014. 7 | # Copyright (c) 2014 Rimantas Mocevicius. All rights reserved. 8 | 9 | function pause(){ 10 | read -p "$*" 11 | } 12 | 13 | # 14 | cd ~/coreos-k8s-cluster/control 15 | vagrant box update 16 | # 17 | cd ~/coreos-k8s-cluster/workers 18 | vagrant box update 19 | 20 | # 21 | echo "Update has finished !!!" 22 | pause 'Press [Enter] key to continue...' 23 | -------------------------------------------------------------------------------- /src/vagrant_control1.command: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # vagrant_control.command 4 | # CoreOS Kubernetes Cluster for OS X 5 | # 6 | # Created by Rimantas on 01/04/2014. 7 | # Copyright (c) 2014 Rimantas Mocevicius. All rights reserved. 8 | 9 | cd ~/coreos-k8s-cluster/control 10 | vagrant ssh k8smaster-01 -- -A 11 | 12 | -------------------------------------------------------------------------------- /src/vagrant_destroy.command: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # vagrant_destroy.command 4 | # CoreOS Kubernetes Cluster for OS X 5 | # 6 | # Created by Rimantas on 01/04/2014. 7 | # Copyright (c) 2014 Rimantas Mocevicius. All rights reserved. 8 | 9 | function pause(){ 10 | read -p "$*" 11 | } 12 | 13 | cd ~/coreos-k8s-cluster/workers 14 | vagrant destroy 15 | # 16 | cd ~/coreos-k8s-cluster/control 17 | vagrant destroy 18 | 19 | pause 'Press [Enter] key to continue...' 20 | -------------------------------------------------------------------------------- /src/vagrant_node1.command: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # vagrant_node1.command 4 | # CoreOS Kubernetes Cluster for OS X 5 | # 6 | # Created by Rimantas on 01/04/2014. 7 | # Copyright (c) 2014 Rimantas Mocevicius. All rights reserved. 8 | 9 | cd ~/coreos-k8s-cluster/workers 10 | vagrant ssh k8snode-01 -- -A 11 | 12 | -------------------------------------------------------------------------------- /src/vagrant_node2.command: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # vagrant_node2.command 4 | # CoreOS Kubernetes Cluster for OS X 5 | # 6 | # Created by Rimantas on 01/04/2014. 7 | # Copyright (c) 2014 Rimantas Mocevicius. All rights reserved. 8 | 9 | cd ~/coreos-k8s-cluster/workers 10 | vagrant ssh k8snode-02 -- -A 11 | 12 | -------------------------------------------------------------------------------- /src/vagrant_reload.command: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # vagrant_up.command 4 | # CoreOS Kubernetes Cluster for OS X 5 | # 6 | # Created by Rimantas on 01/04/2014. 7 | # Copyright (c) 2014 Rimantas Mocevicius. All rights reserved. 8 | 9 | function pause(){ 10 | read -p "$*" 11 | } 12 | 13 | cd ~/coreos-k8s-cluster/control 14 | vagrant reload 15 | # 16 | cd ~/coreos-k8s-cluster/workers 17 | vagrant reload 18 | 19 | # path to the bin folder where we store our binary files 20 | export PATH=${HOME}/coreos-k8s-cluster/bin:$PATH 21 | 22 | # set etcd endpoint 23 | export ETCDCTL_PEERS=http://172.17.15.101:2379 24 | echo "etcd cluster:" 25 | etcdctl --no-sync ls / 26 | echo " " 27 | 28 | # set fleetctl endpoint 29 | export FLEETCTL_ENDPOINT=http://172.17.15.101:2379 30 | export FLEETCTL_DRIVER=etcd 31 | export FLEETCTL_STRICT_HOST_KEY_CHECKING=false 32 | echo "fleetctl list-machines:" 33 | fleetctl list-machines 34 | echo " " 35 | echo "fleetctl list-units:" 36 | fleetctl list-units 37 | echo " " 38 | 39 | # set kubernetes master 40 | export KUBERNETES_MASTER=http://172.17.15.101:8080 41 | echo "kubectl get nodes:" 42 | kubectl get nodes 43 | echo " " 44 | 45 | echo " " 46 | echo "CoreOS Kubernetes Cluster was reloaded !!!" 47 | echo " " 48 | pause 'Press [Enter] key to continue...' 49 | -------------------------------------------------------------------------------- /src/vagrant_up.command: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # vagrant_up.command 4 | # CoreOS Kubernetes Cluster for OS X 5 | # 6 | # Created by Rimantas on 01/12/2014. 7 | # Copyright (c) 2014 Rimantas Mocevicius. All rights reserved. 8 | 9 | # Add vagrant ssh key to ssh-agent 10 | ssh-add ~/.vagrant.d/insecure_private_key >/dev/null 2>&1 11 | 12 | # get App's Resources folder 13 | res_folder=$(cat ~/coreos-k8s-cluster/.env/resouces_path) 14 | 15 | # path to the bin folder where we store our binary files 16 | export PATH=${HOME}/coreos-k8s-cluster/bin:$PATH 17 | 18 | # set etcd endpoint 19 | export ETCDCTL_PEERS=http://172.17.15.101:2379 20 | 21 | # set fleetctl endpoint 22 | export FLEETCTL_TUNNEL= 23 | export FLEETCTL_ENDPOINT=http://172.17.15.101:2379 24 | export FLEETCTL_DRIVER=etcd 25 | export FLEETCTL_STRICT_HOST_KEY_CHECKING=false 26 | # 27 | 28 | # set kubernetes master 29 | export KUBERNETES_MASTER=http://172.17.15.101:8080 30 | # 31 | 32 | cd ~/coreos-k8s-cluster/control 33 | machine_status=$(vagrant status | grep -o -m 1 'not created') 34 | 35 | if [ "$machine_status" = "not created" ] 36 | then 37 | # copy files needed for the App 38 | # copy gsed to ~/coreos-k8s-cluster/bin 39 | cp -f "${res_folder}"/gsed ~/coreos-k8s-cluster/bin 40 | chmod 755 ~/coreos-k8s-cluster/bin/gsed 41 | # copy wget with https support to ~/coreos-k8s-cluster/bin 42 | cp -f "${res_folder}"/wget ~/coreos-k8s-cluster/bin 43 | chmod 755 ~/coreos-k8s-cluster/bin/wget 44 | # copy fleet units 45 | cp -Rf "${res_folder}"/fleet/ ~/coreos-k8s-cluster/fleet 46 | # copy k8s UI files 47 | cp -f "${res_folder}"/k8s/*.yaml ~/coreos-k8s-cluster/kubernetes 48 | 49 | # 50 | vagrant box update 51 | vagrant up --provider virtualbox 52 | # 53 | cd ~/coreos-k8s-cluster/workers 54 | vagrant box update 55 | vagrant up --provider virtualbox 56 | 57 | # install k8s files on master 58 | echo " " 59 | echo "Installing k8s files to master and nodes:" 60 | cd ~/coreos-k8s-cluster/control 61 | vagrant scp master.tgz /home/core/ 62 | vagrant ssh k8smaster-01 -c "sudo /usr/bin/mkdir -p /opt/bin && sudo tar xzf /home/core/master.tgz -C /opt/bin && sudo chmod 755 /opt/bin/* && ls -alh /opt/bin " >/dev/null 2>&1 63 | 64 | # install k8s files on nodes 65 | cd ~/coreos-k8s-cluster/workers 66 | vagrant scp nodes.tgz /home/core/ 67 | # 68 | vagrant ssh k8snode-01 -c "sudo /usr/bin/mkdir -p /opt/bin && sudo tar xzf /home/core/nodes.tgz -C /opt/bin && sudo chmod 755 /opt/bin/* && ls -alh /opt/bin " >/dev/null 2>&1 69 | vagrant ssh k8snode-02 -c "sudo /usr/bin/mkdir -p /opt/bin && sudo tar xzf /home/core/nodes.tgz -C /opt/bin && sudo chmod 755 /opt/bin/* && ls -alh /opt/bin " >/dev/null 2>&1 70 | echo "Done installing ... " 71 | 72 | # install fleet units 73 | echo " " 74 | echo "Installing fleet units:" 75 | # copy fleet units 76 | rm -f ~/coreos-k8s-cluster/fleet/* 77 | cp -fR "$res_folder"/fleet/ ~/coreos-k8s-cluster/fleet 78 | cd ~/coreos-k8s-cluster/fleet 79 | fleetctl start *.service 80 | echo " " 81 | # 82 | echo Waiting for Kubernetes cluster to be ready. This can take a few minutes... 83 | spin='-\|/' 84 | i=0 85 | until ~/coreos-k8s-cluster/bin/kubectl version | grep 'Server Version' >/dev/null 2>&1; do i=$(( (i+1) %4 )); printf "\r${spin:$i:1}"; sleep .1; done 86 | i=0 87 | until ~/coreos-k8s-cluster/bin/kubectl get nodes | grep 172.17.15.102 >/dev/null 2>&1; do i=$(( (i+1) %4 )); printf "\r${spin:$i:1}"; sleep .1; done 88 | i=0 89 | until ~/coreos-k8s-cluster/bin/kubectl get nodes | grep 172.17.15.103 >/dev/null 2>&1; do i=$(( (i+1) %4 )); printf "\r${spin:$i:1}"; sleep .1; done 90 | echo " " 91 | # attach label to the nodes 92 | ~/coreos-k8s-cluster/bin/kubectl label nodes 172.17.15.102 node=worker1 93 | ~/coreos-k8s-cluster/bin/kubectl label nodes 172.17.15.103 node=worker2 94 | # 95 | echo " " 96 | echo "Creating kube-system namespace ..." 97 | ~/coreos-k8s-cluster/bin/kubectl create -f ~/coreos-k8s-cluster/kubernetes/kube-system-ns.yaml 98 | # 99 | echo " " 100 | echo "Installing SkyDNS ..." 101 | ~/coreos-k8s-cluster/bin/kubectl create -f ~/coreos-k8s-cluster/kubernetes/skydns-rc.yaml 102 | ~/coreos-k8s-cluster/bin/kubectl create -f ~/coreos-k8s-cluster/kubernetes/skydns-svc.yaml 103 | # 104 | echo " " 105 | echo "Installing Kubernetes UI ..." 106 | ~/coreos-k8s-cluster/bin/kubectl create -f ~/coreos-k8s-cluster/kubernetes/dashboard-controller.yaml 107 | ~/coreos-k8s-cluster/bin/kubectl create -f ~/coreos-k8s-cluster/kubernetes/dashboard-service.yaml 108 | # clean up kubernetes folder 109 | rm -f ~/coreos-k8s-cluster/kubernetes/kube-system-ns.yaml 110 | rm -f ~/coreos-k8s-cluster/kubernetes/skydns-rc.yaml 111 | rm -f ~/coreos-k8s-cluster/kubernetes/skydns-svc.yaml 112 | rm -f ~/coreos-k8s-cluster/kubernetes/dashboard-controller.yaml 113 | rm -f ~/coreos-k8s-cluster/kubernetes/dashboard-service.yaml 114 | else 115 | # start control 116 | vagrant up 117 | # 118 | ~/coreos-k8s-cluster/bin/fleetctl stop ~/coreos-k8s-cluster/fleet/kubernetes-ui.service 119 | ~/coreos-k8s-cluster/bin/fleetctl destroy ~/coreos-k8s-cluster/fleet/kubernetes-ui.service 120 | rm -f ~/coreos-k8s-cluster/fleet/kubernetes-ui.service 121 | # start nodes 122 | cd ~/coreos-k8s-cluster/workers 123 | vagrant up 124 | fi 125 | 126 | 127 | # 128 | echo " " 129 | echo "etcd cluster:" 130 | etcdctl --no-sync ls / 131 | echo "" 132 | # 133 | echo "fleetctl list-machines:" 134 | fleetctl list-machines 135 | echo " " 136 | # 137 | echo "fleetctl list-units:" 138 | fleetctl list-units 139 | echo " " 140 | # 141 | 142 | echo Waiting for Kubernetes cluster to be ready. This can take a few minutes... 143 | spin='-\|/' 144 | i=0 145 | until ~/coreos-k8s-cluster/bin/kubectl version | grep 'Server Version' >/dev/null 2>&1; do i=$(( (i+1) %4 )); printf "\r${spin:$i:1}"; sleep .1; done 146 | i=0 147 | until ~/coreos-k8s-cluster/bin/kubectl get nodes | grep 172.17.15.102 >/dev/null 2>&1; do i=$(( (i+1) %4 )); printf "\r${spin:$i:1}"; sleep .1; done 148 | i=0 149 | until ~/coreos-k8s-cluster/bin/kubectl get nodes | grep 172.17.15.103 >/dev/null 2>&1; do i=$(( (i+1) %4 )); printf "\r${spin:$i:1}"; sleep .1; done 150 | echo " " 151 | # 152 | echo "kubectl get nodes:" 153 | kubectl get nodes 154 | echo " " 155 | 156 | cd ~/coreos-k8s-cluster/kubernetes 157 | 158 | # open bash shell 159 | /bin/bash 160 | -------------------------------------------------------------------------------- /src/wget: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rimusz/coreos-kubernetes-cluster-osx/6fa4a44846f8df02ab0d2f24737179c0a5a8924d/src/wget --------------------------------------------------------------------------------