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 | --------------------------------------------------------------------------------