├── README.md ├── coreos-installer ├── boot-screens │ ├── boot.msg │ ├── exithelp.cfg │ ├── fastboot.cfg │ ├── kraken.png │ ├── ldlinux.c32 │ ├── libcom32.c32 │ ├── libutil.c32 │ ├── master │ │ ├── boot.msg │ │ └── fastboot.cfg │ ├── menu.cfg │ ├── minion │ │ ├── boot.msg │ │ └── fastboot.cfg │ ├── prompt.cfg │ ├── stdmenu.cfg │ ├── syslinux.cfg │ ├── txt.cfg │ └── vesamenu.c32 ├── cloud-configs │ ├── README.md │ ├── first.yaml │ └── index.html └── pxelinux.cfg │ ├── default │ └── default.orig ├── kubernetes └── skydns │ ├── skydns-rc.yaml │ └── skydns-svc.yaml ├── kubnuc.jpg ├── pxe-cloud-config ├── README.md ├── first.yaml ├── master.yaml └── minion.yaml ├── pxecore.png └── setuplinks.sh /README.md: -------------------------------------------------------------------------------- 1 | # pxe-coreos 2 | PXE tftp os-x setup 3 | 4 | Mikel Nelson 5/26/2015 5 | 6 | ![image](kubnuc.jpg) 7 | 8 | ## Purpose 9 | This Repository attempts to capture the setup of a Linux PXE boot system to load CoreOS onto net booted Machines/VMs. 10 | 11 | ## Environment 12 | This was created on the following network setup: 13 | 14 | * m0n0wall (pfsense) firewall 15 | * LAN Subnet 16 | * DHCP 17 | * OS-X Mac Mini 18 | * tftp - pxe boot files 19 | * http - cloud configuration files 20 | * Bare Metal or VirtualBox VM 21 | 22 | 23 | ## Setup 24 | ### Enable a tftp server 25 | OS-X comes with a tftp server installed, all you have to do is enable it. 26 | Good reference page: [http://hints.macworld.com/article.php?story=20070218233806794](http://) 27 | 28 | * Backup the original tftp.plist 29 | 30 | cp /System/Library/LaunchDaemons/tftp.plist ~/Desktop/tftp.plist 31 | (or wherever you want...) 32 | 33 | * Modify `/System/Library/LaunchDaemons/tftp.plist` add `-s` argument. Everything else should be ok. 34 | 35 | 36 | 37 | 38 | 39 | Disabled 40 | 41 | Label 42 | com.apple.tftpd 43 | ProgramArguments 44 | 45 | /usr/libexec/tftpd 46 | -i 47 | -s 48 | /private/tftpboot 49 | 50 | inetdCompatibility 51 | 52 | Wait 53 | 54 | 55 | InitGroups 56 | 57 | Sockets 58 | 59 | Listeners 60 | 61 | SockServiceName 62 | tftp 63 | SockType 64 | dgram 65 | 66 | 67 | 68 | 69 | 70 | * The `/private/tftpboot` directory should already exist on the system. 71 | * Start the tftpd server: 72 | 73 | $ sudo launchctl load -w /System/Library/LaunchDaemons/tftp.plist 74 | 75 | * To upload any file to the tftpd server, it must already exist and be world writable. e.g. 76 | 77 | $ cd /private/tftpboot 78 | $ sudo touch testfile.txt 79 | $ sudo chmod 666 testfile.txt 80 | 81 | At this point, you're ready to start using the service to store data as needed. For testing, you can perform the following: 82 | 83 | $ cd ~/Desktop 84 | $ echo "THIS IS A TEST" > testfile.txt 85 | $ tftp localhost 86 | 87 | This will open a tftp connection and switch to an interactive tftp session. Now perform the following: 88 | 89 | tftp>verbose 90 | tftp>put testfile.txt 91 | tftp>quit 92 | 93 | ### Setup The CoreOS PXE Files 94 | 95 | #### Summary of PXE setup: 96 | 97 | * All these files should be placed in the root directory of the tftp server. In our example: `/private/tftpboot` 98 | * A version of `pxelinux.0`. This is the initial boot file PXE pulls from the tftp server. The linux distribution really doesn't matter as we will use it to pull the CoreOS files onto the system. This example will use Debian. 99 | * `pxelinux.cfg` directory with at least a `default` file. This is the configuration file that controls what is loaded next. It also can present the boot menus. 100 | * Some distribution of CoreOS. 101 | 102 | #### References: 103 | * CoreOS Boot from PXE: [https://coreos.com/docs/running-coreos/bare-metal/booting-with-pxe/](http://) 104 | * PXE Oracle Example: [https://docs.oracle.com/cd/E24628_01/em.121/e27046/appdx_pxeboot.htm#EMLCM12198](http://) 105 | * PXE Linux: [http://www.syslinux.org/wiki/index.php/PXELINUX](http://) 106 | * Debian Net Boot (Down the page at Provie the boot image): [https://wiki.debian.org/PXEBootInstall](http://) 107 | * Debian distro files for Netboot: [http://www.debian.org/distrib/netinst#netboot](http://) 108 | 109 | #### The Setup 110 | 111 | $ pwd 112 | /private/tftpboot 113 | $ ls -laF 114 | drwxr-xr-x 2 root wheel 68 Oct 16 2014 NetBoot/ 115 | drwxr-xr-x 7 root wheel 238 May 27 08:08 coreos-alpha/ 116 | drwxr-xr-x 5 root wheel 170 May 27 07:56 coreos-installer/ 117 | drwxrwxr-x 3 root wheel 102 Apr 22 15:11 debian-installer/ 118 | lrwxr-xr-x 1 root wheel 41 May 27 08:21 ldlinux.c32@ -> coreos-installer/boot-screens/ldlinux.c32 119 | lrwxr-xr-x 1 root wheel 33 May 26 17:57 pxelinux.0@ -> debian-installer/amd64/pxelinux.0 120 | lrwxr-xr-x 1 root wheel 29 May 27 08:09 pxelinux.cfg@ -> coreos-installer/pxelinux.cfg 121 | 122 | Notes: 123 | 124 | * `NetBoot` is supplied by OS-X server and not applicable for our system. 125 | * `coreos-alpha` contians the CoreOS Alpha channel OS install images 126 | * `coreos-installer` contains the CoreOS install menus and configurations 127 | * `debian-installer` came from the Debian netboot download 128 | * `ldlinux.c32` is only needed if color menus etc are used. Text only does not need this. 129 | * `pxelinux.0` links to the Debian version of pxelinux.0. That is really the only file needed. 130 | * `pxelinux.cfg` links to the configuration directory to use. 131 | 132 | ##### Configuration Menus 133 | The current setup presents a menu that allows selection of the desired CoreOS channel install. This example only has the `coreos-alpha` directory populated, but you can easily add `coreos-beta` and `coreos-stable` direcotries along with the correct files. 134 | 135 | ##### File Trees 136 | 137 | CoreOS Alpha. (see [https://coreos.com/docs/running-coreos/bare-metal/booting-with-pxe/](http://) ) 138 | 139 | coreos-alpha 140 | ├── coreos_production_pxe.vmlinuz 141 | ├── coreos_production_pxe.vmlinuz.sig 142 | ├── coreos_production_pxe_image.cpio.gz 143 | └── coreos_production_pxe_image.cpio.gz.sig 144 | 145 | PXE Configuration 146 | 147 | coreos-installer/ 148 | ├── README.md 149 | ├── boot-screens 150 | │   ├── boot.msg 151 | │   ├── exithelp.cfg 152 | │   ├── fastboot.cfg 153 | │   ├── kraken.png 154 | │   ├── ldlinux.c32 155 | │   ├── libcom32.c32 156 | │   ├── libutil.c32 157 | │   ├── menu.cfg 158 | │   ├── prompt.cfg 159 | │   ├── stdmenu.cfg 160 | │   ├── syslinux.cfg 161 | │   ├── txt.cfg 162 | │   └── vesamenu.c32 163 | └── pxelinux.cfg 164 | └── default -> ../boot-screens/syslinux.cfg 165 | 166 | 167 | Note: `default` may link to either `syslinux.cfg` (for menu selection start) or `fastboot.cfg` (which just starts up CoreOS Alpha). Also, `fastboot.cfg` only needs `boot.msg`. `syslinux.cfg` needs all the other files listed due to VGA menus. 168 | 169 | The most relevant file to edit is: `txt.cfg` 170 | 171 | default install-alpha 172 | label install-alpha 173 | menu label ^Install Alpha Channel 174 | menu default 175 | kernel coreos-alpha/coreos_production_pxe.vmlinuz 176 | append initrd=coreos-alpha/coreos_production_pxe_image.cpio.gz console=tty0 177 | # append initrd=coreos-coreos_production_pxe_image.cpio.gz cloud-config-url=http:///pxe-cloud-config.yml 178 | 179 | label install-beta 180 | menu label ^Install Beta Channel 181 | kernel coreos-beta/coreos_production_pxe.vmlinuz 182 | append initrd=coreos-beta/coreos_production_pxe_image.cpio.gz console=tty0 183 | # append initrd=coreos-coreos_production_pxe_image.cpio.gz cloud-config-url=http://example.com/pxe-cloud-config.yml 184 | 185 | label install-stable 186 | menu label ^Install Stable Channel 187 | kernel coreos-stable/coreos_production_pxe.vmlinuz 188 | append initrd=coreos-stable/coreos_production_pxe_image.cpio.gz console=tty0 189 | # append initrd=coreos-coreos_production_pxe_image.cpio.gz cloud-config-url=http://example.com/pxe-cloud-config.yml 190 | 191 | ## Install 192 | sudo cp the directories from this project to the correct location on you tftp server. 193 | 194 | ## Configure DHCP for PXE 195 | 196 | On the firewall DHCP setup: 197 | * Set `Next server` to the name or IP of the tftp server 198 | * Set the `Filename` to `pxelinux.0` 199 | 200 | ## Testing 201 | ### VirtualBox 202 | Create a new VM with no disk drive, and set the network to `bridged` and `netboot`. 203 | 204 | ![VirtualBox Example](./pxecore.png?raw=true) 205 | 206 | # Running A Kubernetes Cluster 207 | This section superceeds the previous. 208 | 209 | Based on these instructions: [https://github.com/GoogleCloudPlatform/kubernetes/blob/release-1.0/docs/getting-started-guides/docker-multinode/master.md](https://github.com/GoogleCloudPlatform/kubernetes/blob/release-1.0/docs/getting-started-guides/docker-multinode/master.md) 210 | 211 | ## Modifications 212 | The above Kubernetes instructions need to be modified as follows: 213 | 214 | * etcd2 is running as a service on node-01, and proxy on all other nodes (vs container) 215 | * flanneld is running as a service on all nodes (vs container) 216 | * You can avoid all the delete/etc/ sockets etc and proceed to the running sections. 217 | * Use image quay.io/mikeln/hypercube:v1.0.1 (built via the mikeln/kube-local-build project) 218 | * Make sure you set a FQDN that DNS can resolve to an IP address for each node. E.g. for my setup: 219 | * samnuc01.mineco.lab 10.22.6.241 220 | * samnuc02.mineco.lab 10.22.6.242 221 | * samnuc03.mineco.lab 10.22.6.243 222 | * NOTE: you can use `hostnamectl set-hostname` on coreos after the fact. 223 | * Master e.g. 224 | * `docker run --net=host -d -v /var/run/docker.sock:/var/run/docker.sock quay.io/mikeln/hyperkube:v1.0.1 /hyperkube kubelet --api_servers=http://localhost:8080 --v=2 --address=0.0.0.0 --hostname_override=$(hostname -i) --enable_server --config=/etc/kubernetes/manifests-multi --cluster_domain=kubernetes.local --cluster_dns=10.100.0.10` 225 | * `docker run -d --net=host --privileged quay.io/mikeln/hyperkube:v1.0.1 /hyperkube proxy --master=http://127.0.0.1:8080 --v=2` 226 | * Node e.g 227 | * `sudo docker run --net=host -d -v /var/run/docker.sock:/var/run/docker.sock quay.io/mikeln/hyperkube:v1.0.1 /hyperkube kubelet --api_servers=http://10.22.6.241:8080 --v=2 --address=0.0.0.0 --enable_server --hostname_override=$(hostname -i) --cluster_domain=kubernetes.local --cluster_dns=10.100.0.10` 228 | * `sudo docker run -d --net=host --privileged quay.io/mikeln/hyperkube:v1.0.1 /hyperkube proxy --master=http://10.22.6.241:8080 --v=2` 229 | 230 | * skydns 231 | * use kraken-services/skydns but make sure master is set to the correct master IP. 232 | * dns is set to 10.100.0.10 233 | 234 | 235 | ## Example Output 236 | ```` 237 | l2067532491-mn:hyperkube mikel_nelson$ kub get nodes -o wide 238 | NAME LABELS STATUS 239 | 10.22.6.241 kubernetes.io/hostname=10.22.6.241 Ready 240 | 10.22.6.242 kubernetes.io/hostname=10.22.6.242 Ready 241 | 10.22.6.243 kubernetes.io/hostname=10.22.6.243 Ready 242 | ```` 243 | ```` 244 | l2067532491-mn:hyperkube mikel_nelson$ kub get pods -o wide 245 | NAME READY STATUS RESTARTS AGE NODE 246 | k8s-master-10.22.6.241 3/3 Running 0 13m 10.22.6.241 247 | nginx-940xj 1/1 Running 0 1m 10.22.6.242 248 | nginx-eo44c 1/1 Running 0 7m 10.22.6.241 249 | nginx-k3ypx 1/1 Running 0 7m 10.22.6.243 250 | ```` 251 | ```` 252 | l2067532491-mn:hyperkube mikel_nelson$ kub get services 253 | NAME LABELS SELECTOR IP(S) PORT(S) 254 | kubernetes component=apiserver,provider=kubernetes 10.0.0.1 443/TCP 255 | nginx run=nginx run=nginx 10.0.0.125 80/TCP 256 | ```` 257 | ```` 258 | l2067532491-mn:hyperkube mikel_nelson$ kub get rc 259 | CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLICAS 260 | nginx nginx nginx run=nginx 3 261 | ````` 262 | -------------------------------------------------------------------------------- /coreos-installer/boot-screens/boot.msg: -------------------------------------------------------------------------------- 1 | ===================================== 2 | PXE Boot CoreOS 3 | MLN 5/26/2015 4 | ===================================== 5 | -------------------------------------------------------------------------------- /coreos-installer/boot-screens/exithelp.cfg: -------------------------------------------------------------------------------- 1 | label menu 2 | kernel coreos-installer/boot-screens/vesamenu.c32 3 | config coreos-installer/boot-screens/syslinux.cfg 4 | -------------------------------------------------------------------------------- /coreos-installer/boot-screens/fastboot.cfg: -------------------------------------------------------------------------------- 1 | # 2 | # MLN CoreOS Boot 5/26/2015 3 | # 4 | # Fast boot setup...no choice 15s timeout to autoboot 5 | # 6 | DISPLAY coreos-installer/boot-screens/boot.msg 7 | 8 | DEFAULT coreos 9 | LABEL coreos 10 | menu label ^Install 11 | menu default 12 | kernel coreos-alpha/coreos_production_pxe.vmlinuz 13 | append initrd=coreos-coreos_production_pxe_image.cpio.gz cloud-config-url=http://example.com/pxe-cloud-config.yml 14 | 15 | PROMPT 1 16 | TIMEOUT 15 17 | -------------------------------------------------------------------------------- /coreos-installer/boot-screens/kraken.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeln/pxe-coreos/8f83174e2a644bee15428b3f0c4944a5781e4c05/coreos-installer/boot-screens/kraken.png -------------------------------------------------------------------------------- /coreos-installer/boot-screens/ldlinux.c32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeln/pxe-coreos/8f83174e2a644bee15428b3f0c4944a5781e4c05/coreos-installer/boot-screens/ldlinux.c32 -------------------------------------------------------------------------------- /coreos-installer/boot-screens/libcom32.c32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeln/pxe-coreos/8f83174e2a644bee15428b3f0c4944a5781e4c05/coreos-installer/boot-screens/libcom32.c32 -------------------------------------------------------------------------------- /coreos-installer/boot-screens/libutil.c32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeln/pxe-coreos/8f83174e2a644bee15428b3f0c4944a5781e4c05/coreos-installer/boot-screens/libutil.c32 -------------------------------------------------------------------------------- /coreos-installer/boot-screens/master/boot.msg: -------------------------------------------------------------------------------- 1 | ===================================== 2 | PXE MASTER Boot CoreOS 3 | MLN 6/23/2015 4 | ===================================== 5 | -------------------------------------------------------------------------------- /coreos-installer/boot-screens/master/fastboot.cfg: -------------------------------------------------------------------------------- 1 | # 2 | # MLN CoreOS Boot 5/26/2015 3 | # 4 | # Fast boot setup...no choice 15s timeout to autoboot 5 | # 6 | DISPLAY coreos-installer/boot-screens/master/boot.msg 7 | 8 | DEFAULT coreos 9 | LABEL coreos 10 | menu label ^Install MASTER Alpha 11 | menu default 12 | kernel coreos-alpha/coreos_production_pxe.vmlinuz 13 | #append initrd=coreos-alpha/coreos_production_pxe_image.cpio.gz cloud-config-url=http://dockerrepo.mineco.lab:8088/master.yaml coreos.autologin 14 | append initrd=coreos-alpha/coreos_production_pxe_image.cpio.gz cloud-config-url=http://dockerrepo.mineco.lab:8088/master.yaml coreos.autologin root=/dev/sda1 15 | 16 | PROMPT 1 17 | TIMEOUT 5 18 | -------------------------------------------------------------------------------- /coreos-installer/boot-screens/menu.cfg: -------------------------------------------------------------------------------- 1 | menu hshift 7 2 | menu width 61 3 | 4 | menu title CoreOS installer boot menu 5 | include coreos-installer/boot-screens/stdmenu.cfg 6 | include coreos-installer/boot-screens/txt.cfg 7 | label help 8 | menu label ^Help 9 | text help 10 | Display help screens; type 'menu' at boot prompt to return to this menu 11 | endtext 12 | config coreos-installer/boot-screens/prompt.cfg 13 | -------------------------------------------------------------------------------- /coreos-installer/boot-screens/minion/boot.msg: -------------------------------------------------------------------------------- 1 | ===================================== 2 | PXE NODE Boot CoreOS 3 | MLN 6/23/2015 4 | ===================================== 5 | -------------------------------------------------------------------------------- /coreos-installer/boot-screens/minion/fastboot.cfg: -------------------------------------------------------------------------------- 1 | # 2 | # MLN CoreOS Boot 5/26/2015 3 | # 4 | # Fast boot setup...no choice 15s timeout to autoboot 5 | # 6 | DISPLAY coreos-installer/boot-screens/minion/boot.msg 7 | 8 | DEFAULT coreos 9 | LABEL coreos 10 | menu label ^Install NODE Alpha 11 | menu default 12 | kernel coreos-alpha/coreos_production_pxe.vmlinuz 13 | append initrd=coreos-alpha/coreos_production_pxe_image.cpio.gz cloud-config-url=http://dockerrepo.mineco.lab:8088/minion.yaml coreos.autologin root=/dev/sda1 14 | #append initrd=coreos-alpha/coreos_production_pxe_image.cpio.gz cloud-config-url=http://dockerrepo.mineco.lab:8088/minion.yaml coreos.autologin 15 | 16 | PROMPT 1 17 | TIMEOUT 5 18 | -------------------------------------------------------------------------------- /coreos-installer/boot-screens/prompt.cfg: -------------------------------------------------------------------------------- 1 | prompt 1 2 | display coreos-installer/boot-screens/f1.txt 3 | timeout 0 4 | include coreos-installer/boot-screens/menu.cfg 5 | include coreos-installer/boot-screens/exithelp.cfg 6 | -------------------------------------------------------------------------------- /coreos-installer/boot-screens/stdmenu.cfg: -------------------------------------------------------------------------------- 1 | menu background coreos-installer/boot-screens/kraken.png 2 | menu color title * #FF18ccae * 3 | menu color border * #00000000 #00000000 none 4 | menu color sel * #ff000000 #76ebdf83 none 5 | menu color unsel * #ff000000 #00000000 none 6 | menu color hotsel 1;7;37;40 #ff000000 #76a1d0ff * 7 | menu color tabmsg * #ffffffff #00000000 * 8 | menu color help 37;40 #ffdddd00 #00000000 none 9 | # XXX When adjusting vshift, take care that rows is set to a small 10 | # enough value so any possible menu will fit on the screen, 11 | # rather than falling off the bottom. 12 | menu vshift 12 13 | menu rows 10 14 | menu helpmsgrow 15 15 | # The command line must be at least one line from the bottom. 16 | menu cmdlinerow 16 17 | menu timeoutrow 16 18 | menu tabmsgrow 18 19 | menu tabmsg Press ENTER to boot or TAB to edit a menu entry 20 | -------------------------------------------------------------------------------- /coreos-installer/boot-screens/syslinux.cfg: -------------------------------------------------------------------------------- 1 | # D-I config version 2.0 2 | # search path for the c32 support libraries (libcom32, libutil etc.) 3 | path coreos-installer/boot-screens/ 4 | include coreos-installer/boot-screens/menu.cfg 5 | default coreos-installer/boot-screens/vesamenu.c32 6 | prompt 0 7 | timeout 0 8 | -------------------------------------------------------------------------------- /coreos-installer/boot-screens/txt.cfg: -------------------------------------------------------------------------------- 1 | default install-alpha 2 | label install-alpha 3 | menu label ^Install Alpha Channel 4 | menu default 5 | kernel coreos-alpha/coreos_production_pxe.vmlinuz 6 | append initrd=coreos-alpha/coreos_production_pxe_image.cpio.gz cloud-config-url=http://dockerrepo.mineco.lab:8088/first.yaml coreos.autologin root=/dev/sda1 7 | #append initrd=coreos-alpha/coreos_production_pxe_image.cpio.gz sshkey="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC9WsDHltIB7PVFCZQpNkjbBxaWyQeh8ihjw9df5zvZM6TRz80QNM9XceNmjeh0zxocMflnDY19rkeKvy53yd7LFMThand0nLKxgPmsJUM+rkLyOQuDAxEBUWFjSiuxFsWdRYgAFDIaholsLTj9GKiNjntVDXYnHJnvu+g42aaUcq4PKex2meaEDDk6K8xDWj1th2f9GtE5/pWCZZTH7VcTMiX4PrU7EW5guNQdkFRj9a/Hv3ZEwrNWaJvcXIHKFWcA/VyDfrJ4RItTrjIRSJiD6vIZHsQ7mFQsUJOL4IWzE/i38ywgZeDalhlPYwRvFo1zknUwvRieZeSItqq4S7CB mikel_nelson@l2067532491-mn.mineco.lab" cloud-config-url=http://dockerrepo.mineco.lab:8088/first.yaml 8 | # append initrd=coreos-alpha/coreos_production_pxe_image.cpio.gz cloud-config-url=tftp://10.22.6.208/first.yaml 9 | # append initrd=coreos-coreos_production_pxe_image.cpio.gz cloud-config-url=http://example.com/pxe-cloud-config.yml 10 | 11 | label install-beta 12 | menu label ^Install Beta Channel 13 | kernel coreos-beta/coreos_production_pxe.vmlinuz 14 | append initrd=coreos-beta/coreos_production_pxe_image.cpio.gz console=tty0 15 | # append initrd=coreos-coreos_production_pxe_image.cpio.gz cloud-config-url=http://example.com/pxe-cloud-config.yml 16 | 17 | label install-stable 18 | menu label ^Install Stable Channel 19 | kernel coreos-stable/coreos_production_pxe.vmlinuz 20 | append initrd=coreos-stable/coreos_production_pxe_image.cpio.gz console=tty0 21 | # append initrd=coreos-coreos_production_pxe_image.cpio.gz cloud-config-url=http://example.com/pxe-cloud-config.yml 22 | 23 | -------------------------------------------------------------------------------- /coreos-installer/boot-screens/vesamenu.c32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeln/pxe-coreos/8f83174e2a644bee15428b3f0c4944a5781e4c05/coreos-installer/boot-screens/vesamenu.c32 -------------------------------------------------------------------------------- /coreos-installer/cloud-configs/README.md: -------------------------------------------------------------------------------- 1 | = Cloud Configs = 2 | 3 | These need to reside in an http server. 4 | here: /private/www/pxe 5 | accessible via: http://dockerrepo.mineco.lab:8088/ 6 | 7 | -------------------------------------------------------------------------------- /coreos-installer/cloud-configs/first.yaml: -------------------------------------------------------------------------------- 1 | #cloud-config 2 | 3 | --- 4 | write_files: 5 | - path: /home/core/.bash_profile 6 | owner: core:core 7 | permissions: 0755 8 | content: | 9 | # /etc/skel/.bash_profile 10 | # MLN 11 | # This file is sourced by bash for login shells. The following line 12 | # runs your .bashrc and is recommended by the bash info pages. 13 | [[ -f ~/.bashrc ]] && . ~/.bashrc 14 | # 15 | # if a shelll 16 | # 17 | if test -t 0 ; then 18 | # interactive shell 19 | export TERM="xterm-256color" 20 | export CLICOLOR=1 21 | set -o vi 22 | export MY_IP=`ip addr show dev enp0s25 | grep "inet " | cut -d " " -f6 | cut -d "/" -f1` 23 | export PROMPT_COMMAND='echo -ne "\033]0;NUC-$MY_IP:$PWD\007"' 24 | fi 25 | # 26 | # set aliases 27 | # 28 | if [ -f ~/.aliases ]; then 29 | . ~/.aliases 30 | fi 31 | - path: /home/core/.aliases 32 | owner: core:core 33 | permissions: 0755 34 | content: | 35 | # 36 | # customize for self 37 | # 38 | alias la='ls -laF' 39 | alias ll='ls -laF' 40 | - path: /etc/motd 41 | owner: root 42 | permissions: 0644 43 | content: | 44 | +----------------------------------+ 45 | Hello from Mikeln NUC July 46 | _____ _ _ _ _ _____ 47 | / ____| | \ | | | | |/ ____| 48 | | (___ __ _ _ __ ___ ___ _ _ _ __ __ _ | \| | | | | | 49 | \___ \ / _` | '_ ` _ \/ __| | | | '_ \ / _` | | . ` | | | | | 50 | ____) | (_| | | | | | \__ \ |_| | | | | (_| | | |\ | |__| | |____ 51 | |_____/ \__,_|_| |_| |_|___/\__,_|_| |_|\__, | |_| \_|\____/ \_____| 52 | __/ | 53 | |___/ 54 | +----------------------------------+ 55 | coreos: 56 | units: 57 | - name: etcd2.service 58 | command: start 59 | - name: fleet.service 60 | command: start 61 | - name: nameservers.network 62 | content: | 63 | [Network] 64 | DNS=10.22.6.1 65 | DHCP=ipv4 66 | 67 | ssh_authorized_keys: 68 | - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC9WsDHltIB7PVFCZQpNkjbBxaWyQeh8ihjw9df5zvZM6TRz80QNM9XceNmjeh0zxocMflnDY19rkeKvy53yd7LFMThand0nLKxgPmsJUM+rkLyOQuDAxEBUWFjSiuxFsWdRYgAFDIaholsLTj9GKiNjntVDXYnHJnvu+g42aaUcq4PKex2meaEDDk6K8xDWj1th2f9GtE5/pWCZZTH7VcTMiX4PrU7EW5guNQdkFRj9a/Hv3ZEwrNWaJvcXIHKFWcA/VyDfrJ4RItTrjIRSJiD6vIZHsQ7mFQsUJOL4IWzE/i38ywgZeDalhlPYwRvFo1zknUwvRieZeSItqq4S7CB mikel_nelson@l2067532491-mn.mineco.lab 69 | 70 | -------------------------------------------------------------------------------- /coreos-installer/cloud-configs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | MLN PXE Cloud Config on MiniServer 4 | 5 | 6 |

PXE Cloud Configs

7 |
8 |

This contains the files needed for a PXE cloud config startup

9 | 10 | 11 | -------------------------------------------------------------------------------- /coreos-installer/pxelinux.cfg/default: -------------------------------------------------------------------------------- 1 | ../boot-screens/syslinux.cfg -------------------------------------------------------------------------------- /coreos-installer/pxelinux.cfg/default.orig: -------------------------------------------------------------------------------- 1 | # 2 | # MLN CoreOS Boot 5/26/2015 3 | # 4 | DISPLAY coreos-alpha/boot-screens/boot.msg 5 | 6 | DEFAULT coreos 7 | LABEL coreos 8 | menu label ^Install 9 | menu default 10 | kernel coreos-alpha/coreos_production_pxe.vmlinuz 11 | append initrd=coreos-alpha/coreos_production_pxe_image.cpio.gz console=tty0 12 | # append initrd=coreos-coreos_production_pxe_image.cpio.gz cloud-config-url=http://example.com/pxe-cloud-config.yml 13 | 14 | PROMPT 1 15 | TIMEOUT 0 16 | -------------------------------------------------------------------------------- /kubernetes/skydns/skydns-rc.yaml: -------------------------------------------------------------------------------- 1 | # based on https://github.com/GoogleCloudPlatform/kubernetes/blob/master/cluster/addons/dns/skydns-rc.yaml.in 2 | apiVersion: v1 3 | kind: ReplicationController 4 | metadata: 5 | labels: 6 | k8s-app: kube-dns-v3 7 | kubernetes.io/cluster-service: "true" 8 | name: kube-dns-v3 9 | namespace: default 10 | spec: 11 | replicas: 3 12 | selector: 13 | k8s-app: kube-dns 14 | version: v3 15 | template: 16 | metadata: 17 | labels: 18 | k8s-app: kube-dns 19 | version: v3 20 | kubernetes.io/color: FFFF66 21 | kubernetes.io/cluster-service: "true" 22 | spec: 23 | containers: 24 | - name: etcd 25 | resources: 26 | limits: 27 | cpu: 100m 28 | memory: 50Mi 29 | image: gcr.io/google_containers/etcd:2.0.9 30 | command: 31 | - /usr/local/bin/etcd 32 | - -data-dir 33 | - /var/etcd/data 34 | - -listen-client-urls 35 | - http://127.0.0.1:2379,http://127.0.0.1:4001 36 | - -advertise-client-urls 37 | - http://127.0.0.1:2379,http://127.0.0.1:4001 38 | - -initial-cluster-token 39 | - skydns-etcd 40 | volumeMounts: 41 | - name: etcd-storage 42 | mountPath: /var/etcd/data 43 | - name: kube2sky 44 | resources: 45 | limits: 46 | cpu: 100m 47 | memory: 50Mi 48 | image: gcr.io/google_containers/kube2sky:1.11 49 | # command: "/kube2sky" 50 | args: 51 | - -domain=kubernetes.local 52 | - -kube_master_url=http://10.22.6.241:8080 53 | # - -kubecfg_file=/etc/dns_token/kubeconfig 54 | # volumeMounts: 55 | # - mountPath: /etc/dns_token 56 | # name: dns-token 57 | # readOnly: true 58 | - name: skydns 59 | resources: 60 | limits: 61 | cpu: 100m 62 | memory: 50Mi 63 | image: gcr.io/google_containers/skydns:2015-03-11-001 64 | # command: "/skydns" 65 | args: 66 | - -machines=http://localhost:4001 67 | - -addr=0.0.0.0:53 68 | - -domain=kubernetes.local 69 | ports: 70 | - containerPort: 53 71 | name: dns 72 | protocol: UDP 73 | - containerPort: 53 74 | name: dns-tcp 75 | protocol: TCP 76 | livenessProbe: 77 | httpGet: 78 | path: /healthz 79 | port: 8080 80 | scheme: HTTP 81 | initialDelaySeconds: 30 82 | timeoutSeconds: 5 83 | - name: healthz 84 | image: gcr.io/google_containers/exechealthz:1.0 85 | resources: 86 | limits: 87 | cpu: 10m 88 | memory: 20Mi 89 | args: 90 | - -cmd=nslookup kubernetes.default.svc.kubernetes.local localhost >/dev/null 91 | - -port=8080 92 | ports: 93 | - containerPort: 8080 94 | protocol: TCP 95 | dnsPolicy: Default # Don't use cluster DNS. 96 | volumes: 97 | - name: etcd-storage 98 | emptyDir: {} 99 | -------------------------------------------------------------------------------- /kubernetes/skydns/skydns-svc.yaml: -------------------------------------------------------------------------------- 1 | # based on https://github.com/GoogleCloudPlatform/kubernetes/blob/master/cluster/addons/dns/skydns-svc.yaml.in 2 | apiVersion: v1 3 | kind: Service 4 | metadata: 5 | labels: 6 | k8s-app: kube-dns 7 | kubernetes.io/cluster-service: "true" 8 | kubernetes.io/name: "KubeDNS" 9 | name: kube-dns 10 | namespace: default 11 | spec: 12 | ports: 13 | - name: dns 14 | port: 53 15 | protocol: UDP 16 | - name: dns-tcp 17 | port: 53 18 | protocol: TCP 19 | selector: 20 | k8s-app: kube-dns 21 | clusterIP: 10.100.0.10 22 | -------------------------------------------------------------------------------- /kubnuc.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeln/pxe-coreos/8f83174e2a644bee15428b3f0c4944a5781e4c05/kubnuc.jpg -------------------------------------------------------------------------------- /pxe-cloud-config/README.md: -------------------------------------------------------------------------------- 1 | This file resides on the HTTP web server. 2 | -------------------------------------------------------------------------------- /pxe-cloud-config/first.yaml: -------------------------------------------------------------------------------- 1 | #cloud-config 2 | 3 | --- 4 | write_files: 5 | - path: /home/core/.bash_profile 6 | owner: core:core 7 | permissions: 0755 8 | content: | 9 | # /etc/skel/.bash_profile 10 | # MLN 11 | # This file is sourced by bash for login shells. The following line 12 | # runs your .bashrc and is recommended by the bash info pages. 13 | [[ -f ~/.bashrc ]] && . ~/.bashrc 14 | # 15 | # if a shelll 16 | # 17 | if test -t 0 ; then 18 | # interactive shell 19 | export TERM="xterm-256color" 20 | export CLICOLOR=1 21 | set -o vi 22 | export MY_IP=`ip addr show dev enp0s25 | grep "inet " | cut -d " " -f6 | cut -d "/" -f1` 23 | export PROMPT_COMMAND='echo -ne "\033]0;NUC-$MY_IP:$PWD\007"' 24 | fi 25 | # 26 | # set aliases 27 | # 28 | if [ -f ~/.aliases ]; then 29 | . ~/.aliases 30 | fi 31 | - path: /home/core/.aliases 32 | owner: core:core 33 | permissions: 0755 34 | content: | 35 | # 36 | # customize for self 37 | # 38 | alias la='ls -laF' 39 | alias ll='ls -laF' 40 | - path: /etc/motd 41 | owner: root 42 | permissions: 0644 43 | content: | 44 | +----------------------------------+ 45 | Hello from Mikeln NUC July 46 | _____ _ _ _ _ _____ 47 | / ____| | \ | | | | |/ ____| 48 | | (___ __ _ _ __ ___ ___ _ _ _ __ __ _ | \| | | | | | 49 | \___ \ / _` | '_ ` _ \/ __| | | | '_ \ / _` | | . ` | | | | | 50 | ____) | (_| | | | | | \__ \ |_| | | | | (_| | | |\ | |__| | |____ 51 | |_____/ \__,_|_| |_| |_|___/\__,_|_| |_|\__, | |_| \_|\____/ \_____| 52 | __/ | 53 | |___/ 54 | +----------------------------------+ 55 | coreos: 56 | units: 57 | - name: etcd2.service 58 | command: start 59 | - name: fleet.service 60 | command: start 61 | - name: nameservers.network 62 | content: | 63 | [Network] 64 | DNS=10.22.6.1 65 | DHCP=ipv4 66 | 67 | ssh_authorized_keys: 68 | - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC9WsDHltIB7PVFCZQpNkjbBxaWyQeh8ihjw9df5zvZM6TRz80QNM9XceNmjeh0zxocMflnDY19rkeKvy53yd7LFMThand0nLKxgPmsJUM+rkLyOQuDAxEBUWFjSiuxFsWdRYgAFDIaholsLTj9GKiNjntVDXYnHJnvu+g42aaUcq4PKex2meaEDDk6K8xDWj1th2f9GtE5/pWCZZTH7VcTMiX4PrU7EW5guNQdkFRj9a/Hv3ZEwrNWaJvcXIHKFWcA/VyDfrJ4RItTrjIRSJiD6vIZHsQ7mFQsUJOL4IWzE/i38ywgZeDalhlPYwRvFo1zknUwvRieZeSItqq4S7CB mikel_nelson@l2067532491-mn.mineco.lab 69 | 70 | -------------------------------------------------------------------------------- /pxe-cloud-config/master.yaml: -------------------------------------------------------------------------------- 1 | #cloud-config 2 | 3 | --- 4 | write_files: 5 | - path: /home/core/.bash_profile 6 | owner: core:core 7 | permissions: 0755 8 | content: | 9 | # /etc/skel/.bash_profile 10 | # MLN 11 | # This file is sourced by bash for login shells. The following line 12 | # runs your .bashrc and is recommended by the bash info pages. 13 | [[ -f ~/.bashrc ]] && . ~/.bashrc 14 | # 15 | # if a shelll 16 | # 17 | if test -t 0 ; then 18 | # interactive shell 19 | export TERM="xterm-256color" 20 | export CLICOLOR=1 21 | set -o vi 22 | export MY_IP=`ip addr show dev enp0s25 | grep "inet " | cut -d " " -f6 | cut -d "/" -f1` 23 | export PROMPT_COMMAND='echo -ne "\033]0;NUC-$MY_IP:$PWD\007"' 24 | fi 25 | # 26 | # set aliases 27 | # 28 | if [ -f ~/.aliases ]; then 29 | . ~/.aliases 30 | fi 31 | - path: /home/core/.aliases 32 | owner: core:core 33 | permissions: 0755 34 | content: | 35 | # 36 | # customize for self 37 | # 38 | alias la='ls -laF' 39 | alias ll='ls -laF' 40 | - path: /etc/motd 41 | owner: root 42 | permissions: 0644 43 | content: | 44 | +----------------------------------+ 45 | Hello from Mikeln MASTER NUC July 46 | _____ _ _ _ _ _____ 47 | / ____| | \ | | | | |/ ____| 48 | | (___ __ _ _ __ ___ ___ _ _ _ __ __ _ | \| | | | | | 49 | \___ \ / _` | '_ ` _ \/ __| | | | '_ \ / _` | | . ` | | | | | 50 | ____) | (_| | | | | | \__ \ |_| | | | | (_| | | |\ | |__| | |____ 51 | |_____/ \__,_|_| |_| |_|___/\__,_|_| |_|\__, | |_| \_|\____/ \_____| 52 | __/ | 53 | |___/ 54 | +----------------------------------+ 55 | coreos: 56 | etcd2: 57 | name: samnuc01 58 | discovery-srv: mineco.lab 59 | initial-advertise-peer-urls: http://samnuc01.mineco.lab:2380 60 | initial-cluster-token: etcd-cluster-1 61 | initial-cluster-state: new 62 | advertise-client-urls: http://samnuc01.mineco.lab:2379 63 | # important: IP:2379 for external, localhost:2379 for etcdctl, localhost:4001 for fleet 64 | listen-client-urls: http://samnuc01.mineco.lab:2379, http://127.0.0.1:2379, http://127.0.0.1:4001 65 | listen-peer-urls: http://samnuc01.mineco.lab:2380 66 | fleet: 67 | metadata: "role=boss,kube=role=master" 68 | etcd_request_timeout: 5.0 69 | units: 70 | - name: etcd2.service 71 | command: start 72 | - name: fleet.service 73 | command: start 74 | - name: flanneld.service 75 | drop-ins: 76 | - name: 50-network-config.conf 77 | content: | 78 | [Service] 79 | ExecStartPre=/usr/bin/etcdctl set /coreos.com/network/config '{ "Network": "10.55.0.0/16" }' 80 | command: start 81 | - name: nameservers.network 82 | content: | 83 | [Network] 84 | DNS=10.22.6.1 85 | DHCP=ipv4 86 | hostname: samnuc01 87 | ssh_authorized_keys: 88 | - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC9WsDHltIB7PVFCZQpNkjbBxaWyQeh8ihjw9df5zvZM6TRz80QNM9XceNmjeh0zxocMflnDY19rkeKvy53yd7LFMThand0nLKxgPmsJUM+rkLyOQuDAxEBUWFjSiuxFsWdRYgAFDIaholsLTj9GKiNjntVDXYnHJnvu+g42aaUcq4PKex2meaEDDk6K8xDWj1th2f9GtE5/pWCZZTH7VcTMiX4PrU7EW5guNQdkFRj9a/Hv3ZEwrNWaJvcXIHKFWcA/VyDfrJ4RItTrjIRSJiD6vIZHsQ7mFQsUJOL4IWzE/i38ywgZeDalhlPYwRvFo1zknUwvRieZeSItqq4S7CB mikel_nelson@l2067532491-mn.mineco.lab 89 | -------------------------------------------------------------------------------- /pxe-cloud-config/minion.yaml: -------------------------------------------------------------------------------- 1 | #cloud-config 2 | 3 | --- 4 | write_files: 5 | - path: /home/core/.bash_profile 6 | owner: core:core 7 | permissions: 0755 8 | content: | 9 | # /etc/skel/.bash_profile 10 | # MLN 11 | # This file is sourced by bash for login shells. The following line 12 | # runs your .bashrc and is recommended by the bash info pages. 13 | [[ -f ~/.bashrc ]] && . ~/.bashrc 14 | # 15 | # if a shelll 16 | # 17 | if test -t 0 ; then 18 | # interactive shell 19 | export TERM="xterm-256color" 20 | export CLICOLOR=1 21 | set -o vi 22 | export MY_IP=`ip addr show dev enp0s25 | grep "inet " | cut -d " " -f6 | cut -d "/" -f1` 23 | export PROMPT_COMMAND='echo -ne "\033]0;NUC-$MY_IP:$PWD\007"' 24 | fi 25 | # 26 | # set aliases 27 | # 28 | if [ -f ~/.aliases ]; then 29 | . ~/.aliases 30 | fi 31 | - path: /home/core/.aliases 32 | owner: core:core 33 | permissions: 0755 34 | content: | 35 | # 36 | # customize for self 37 | # 38 | alias la='ls -laF' 39 | alias ll='ls -laF' 40 | - path: /etc/motd 41 | owner: root 42 | permissions: 0644 43 | content: | 44 | +----------------------------------+ 45 | Hello from Mikeln Node NUC July 46 | _____ _ _ _ _ _____ 47 | / ____| | \ | | | | |/ ____| 48 | | (___ __ _ _ __ ___ ___ _ _ _ __ __ _ | \| | | | | | 49 | \___ \ / _` | '_ ` _ \/ __| | | | '_ \ / _` | | . ` | | | | | 50 | ____) | (_| | | | | | \__ \ |_| | | | | (_| | | |\ | |__| | |____ 51 | |_____/ \__,_|_| |_| |_|___/\__,_|_| |_|\__, | |_| \_|\____/ \_____| 52 | __/ | 53 | |___/ 54 | +----------------------------------+ 55 | coreos: 56 | etcd2: 57 | proxy: on 58 | discovery-srv: mineco.lab 59 | fleet: 60 | metadata: "role=peon,kube-role=node" 61 | units: 62 | - name: etcd2.service 63 | enable: true 64 | command: start 65 | - name: fleet.service 66 | command: start 67 | - name: flanneld.service 68 | drop-ins: 69 | - name: 50-network-config.conf 70 | content: | 71 | [Service] 72 | ExecStartPre=/usr/bin/etcdctl set /coreos.com/network/config '{ "Network": "10.55.0.0/16" }' 73 | command: start 74 | - name: nameservers.network 75 | content: | 76 | [Network] 77 | DNS=10.22.6.1 78 | DHCP=ipv4 79 | ssh_authorized_keys: 80 | - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC9WsDHltIB7PVFCZQpNkjbBxaWyQeh8ihjw9df5zvZM6TRz80QNM9XceNmjeh0zxocMflnDY19rkeKvy53yd7LFMThand0nLKxgPmsJUM+rkLyOQuDAxEBUWFjSiuxFsWdRYgAFDIaholsLTj9GKiNjntVDXYnHJnvu+g42aaUcq4PKex2meaEDDk6K8xDWj1th2f9GtE5/pWCZZTH7VcTMiX4PrU7EW5guNQdkFRj9a/Hv3ZEwrNWaJvcXIHKFWcA/VyDfrJ4RItTrjIRSJiD6vIZHsQ7mFQsUJOL4IWzE/i38ywgZeDalhlPYwRvFo1zknUwvRieZeSItqq4S7CB mikel_nelson@l2067532491-mn.mineco.lab 81 | -------------------------------------------------------------------------------- /pxecore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeln/pxe-coreos/8f83174e2a644bee15428b3f0c4944a5781e4c05/pxecore.png -------------------------------------------------------------------------------- /setuplinks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # links up items in the tftpboot directory 4 | # 5 | sudo cp -R coreos-installer /private/tftpboot/coreos-installer 6 | # 7 | # copy and create coreos install... 8 | # 9 | cd /private/tftpboot 10 | 11 | sudo mkdir coreos-alpha 12 | 13 | sudo ln -s coreos-installer/pxelinux.cfg pxelinux.cfg 14 | # 15 | # only needed for vga 16 | sudo ln -s coreos-installer/boot-screens/ldlinux.c32 ldlinux.c32 17 | # 18 | # assumes a debian file... 19 | sudo ln -s debian-installer/amd64/pxelinux.0 pxelinux.0 20 | --------------------------------------------------------------------------------