mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 22:46:12 +00:00
Merge pull request #2625 from kelseyhightower/update-to-0.5
update CoreOS installation guides
This commit is contained in:
commit
25dc715a41
@ -2,12 +2,6 @@
|
||||
|
||||
There are multiple guides on running Kubernetes with [CoreOS](http://coreos.com):
|
||||
|
||||
* [Single Node Kubernetes example in any environment](coreos/coreos_quick_start.md)
|
||||
* [Multi-node cluster using cloud-config](coreos/coreos_cloud_config.md)
|
||||
* [Elastic Kubernetes cluster with fleet and flannel](https://github.com/kelseyhightower/kubernetes-fleet-tutorial)
|
||||
* [Single Node Cluster](coreos/coreos_single_node_cluster.md)
|
||||
* [Multi-node Cluster](coreos/coreos_multinode_cluster.md)
|
||||
* [Multi-node cluster using cloud-config and Weave on Vagrant](https://github.com/errordeveloper/weave-demos/blob/master/poseidon/README.md)
|
||||
|
||||
Warning: the following instructions are slightly stale, after setting this up, you need to also start the scheduler binary.
|
||||
|
||||
[Multiple host example using VMware Fusion](http://coreos.com/blog/running-kubernetes-example-on-CoreOS-part-2/)
|
||||
|
||||
|
157
docs/getting-started-guides/coreos/cloud-configs/master.yaml
Normal file
157
docs/getting-started-guides/coreos/cloud-configs/master.yaml
Normal file
@ -0,0 +1,157 @@
|
||||
#cloud-config
|
||||
|
||||
coreos:
|
||||
units:
|
||||
- name: setup-network-environment.service
|
||||
command: start
|
||||
content: |
|
||||
[Unit]
|
||||
Description=Setup Network Environment
|
||||
Documentation=https://github.com/kelseyhightower/setup-network-environment
|
||||
Requires=network-online.target
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
ExecStartPre=-/usr/bin/mkdir -p /opt/bin
|
||||
ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/k8s/setup-network-environment
|
||||
ExecStartPre=/usr/bin/chmod +x /opt/bin/setup-network-environment
|
||||
ExecStart=/opt/bin/setup-network-environment
|
||||
RemainAfterExit=yes
|
||||
Type=oneshot
|
||||
- name: etcd.service
|
||||
command: start
|
||||
content: |
|
||||
[Unit]
|
||||
Description=etcd
|
||||
Requires=setup-network-environment.service
|
||||
After=setup-network-environment.service
|
||||
|
||||
[Service]
|
||||
EnvironmentFile=/etc/network-environment
|
||||
User=etcd
|
||||
PermissionsStartOnly=true
|
||||
ExecStart=/usr/bin/etcd \
|
||||
--name ${DEFAULT_IPV4} \
|
||||
--addr ${DEFAULT_IPV4}:4001 \
|
||||
--bind-addr 0.0.0.0 \
|
||||
--cluster-active-size 1 \
|
||||
--data-dir /var/lib/etcd \
|
||||
--http-read-timeout 86400 \
|
||||
--peer-addr ${DEFAULT_IPV4}:7001 \
|
||||
--snapshot true
|
||||
Restart=always
|
||||
RestartSec=10s
|
||||
- name: fleet.socket
|
||||
command: start
|
||||
content: |
|
||||
[Socket]
|
||||
ListenStream=/var/run/fleet.sock
|
||||
- name: fleet.service
|
||||
command: start
|
||||
content: |
|
||||
[Unit]
|
||||
Description=fleet daemon
|
||||
Wants=etcd.service
|
||||
After=etcd.service
|
||||
Wants=fleet.socket
|
||||
After=fleet.socket
|
||||
|
||||
[Service]
|
||||
Environment="FLEET_ETCD_SERVERS=http://127.0.0.1:4001"
|
||||
Environment="FLEET_METADATA=role=master"
|
||||
ExecStart=/usr/bin/fleetd
|
||||
Restart=always
|
||||
RestartSec=10s
|
||||
- name: flannel.service
|
||||
command: start
|
||||
content: |
|
||||
[Unit]
|
||||
Requires=etcd.service
|
||||
After=etcd.service
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
Description=flannel is an etcd backed overlay network for containers
|
||||
|
||||
[Service]
|
||||
Type=notify
|
||||
ExecStartPre=-/usr/bin/mkdir -p /opt/bin
|
||||
ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/k8s/flanneld
|
||||
ExecStartPre=/usr/bin/chmod +x /opt/bin/flanneld
|
||||
ExecStartPre=-/usr/bin/etcdctl mk /coreos.com/network/config '{"Network":"10.244.0.0/16", "Backend": {"Type": "vxlan"}}'
|
||||
ExecStart=/opt/bin/flanneld
|
||||
- name: kube-apiserver.service
|
||||
command: start
|
||||
content: |
|
||||
[Unit]
|
||||
Description=Kubernetes API Server
|
||||
Documentation=https://github.com/GoogleCloudPlatform/kubernetes
|
||||
Requires=etcd.service
|
||||
After=etcd.service
|
||||
|
||||
[Service]
|
||||
ExecStartPre=-/usr/bin/mkdir -p /opt/bin
|
||||
ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/kubernetes-release/release/v0.5.4/bin/linux/amd64/kube-apiserver
|
||||
ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-apiserver
|
||||
ExecStart=/opt/bin/kube-apiserver \
|
||||
--address=0.0.0.0 \
|
||||
--port=8080 \
|
||||
--portal_net 10.1.0.0/16 \
|
||||
--etcd_servers=http://127.0.0.1:4001 \
|
||||
--logtostderr=true
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
- name: kube-controller-manager.service
|
||||
command: start
|
||||
content: |
|
||||
[Unit]
|
||||
Description=Kubernetes Controller Manager
|
||||
Documentation=https://github.com/GoogleCloudPlatform/kubernetes
|
||||
Requires=kube-apiserver.service
|
||||
After=kube-apiserver.service
|
||||
|
||||
[Service]
|
||||
ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/kubernetes-release/release/v0.5.4/bin/linux/amd64/kube-controller-manager
|
||||
ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-controller-manager
|
||||
ExecStart=/opt/bin/kube-controller-manager \
|
||||
--master=127.0.0.1:8080 \
|
||||
--logtostderr=true
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
- name: kube-scheduler.service
|
||||
command: start
|
||||
content: |
|
||||
[Unit]
|
||||
Description=Kubernetes Scheduler
|
||||
Documentation=https://github.com/GoogleCloudPlatform/kubernetes
|
||||
Requires=kube-apiserver.service
|
||||
After=kube-apiserver.service
|
||||
|
||||
[Service]
|
||||
ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/kubernetes-release/release/v0.5.4/bin/linux/amd64/kube-scheduler
|
||||
ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-scheduler
|
||||
ExecStart=/opt/bin/kube-scheduler --master=127.0.0.1:8080
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
- name: kube-register.service
|
||||
command: start
|
||||
content: |
|
||||
[Unit]
|
||||
Description=Kubernetes Registration Service
|
||||
Documentation=https://github.com/kelseyhightower/kube-register
|
||||
Requires=kube-apiserver.service
|
||||
After=kube-apiserver.service
|
||||
Requires=fleet.service
|
||||
After=fleet.service
|
||||
|
||||
[Service]
|
||||
ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/k8s/kube-register
|
||||
ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-register
|
||||
ExecStart=/opt/bin/kube-register \
|
||||
--metadata=role=node \
|
||||
--fleet-endpoint=unix:///var/run/fleet.sock \
|
||||
--api-endpoint=http://127.0.0.1:8080
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
update:
|
||||
group: alpha
|
||||
reboot-strategy: off
|
109
docs/getting-started-guides/coreos/cloud-configs/node.yaml
Normal file
109
docs/getting-started-guides/coreos/cloud-configs/node.yaml
Normal file
@ -0,0 +1,109 @@
|
||||
#cloud-config
|
||||
|
||||
coreos:
|
||||
units:
|
||||
- name: etcd.service
|
||||
mask: true
|
||||
- name: fleet.service
|
||||
command: start
|
||||
content: |
|
||||
[Unit]
|
||||
Description=fleet daemon
|
||||
Wants=etcd.service
|
||||
After=etcd.service
|
||||
Wants=fleet.socket
|
||||
After=fleet.socket
|
||||
|
||||
[Service]
|
||||
Environment="FLEET_ETCD_SERVERS=http://<master-private-ip>:4001"
|
||||
Environment="FLEET_METADATA=role=node"
|
||||
ExecStart=/usr/bin/fleetd
|
||||
Restart=always
|
||||
RestartSec=10s
|
||||
- name: flannel.service
|
||||
command: start
|
||||
content: |
|
||||
[Unit]
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
Description=flannel is an etcd backed overlay network for containers
|
||||
|
||||
[Service]
|
||||
Type=notify
|
||||
ExecStartPre=-/usr/bin/mkdir -p /opt/bin
|
||||
ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/k8s/flanneld
|
||||
ExecStartPre=/usr/bin/chmod +x /opt/bin/flanneld
|
||||
ExecStart=/opt/bin/flanneld -etcd-endpoints http://<master-private-ip>:4001
|
||||
- name: docker.service
|
||||
command: start
|
||||
content: |
|
||||
[Unit]
|
||||
After=flannel.service
|
||||
Wants=flannel.service
|
||||
Description=Docker Application Container Engine
|
||||
Documentation=http://docs.docker.io
|
||||
|
||||
[Service]
|
||||
EnvironmentFile=/run/flannel/subnet.env
|
||||
ExecStartPre=/bin/mount --make-rprivate /
|
||||
ExecStart=/usr/bin/docker -d --bip=${FLANNEL_SUBNET} --mtu=${FLANNEL_MTU} -s=btrfs -H fd://
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
- name: setup-network-environment.service
|
||||
command: start
|
||||
content: |
|
||||
[Unit]
|
||||
Description=Setup Network Environment
|
||||
Documentation=https://github.com/kelseyhightower/setup-network-environment
|
||||
Requires=network-online.target
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
ExecStartPre=-/usr/bin/mkdir -p /opt/bin
|
||||
ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/k8s/setup-network-environment
|
||||
ExecStartPre=/usr/bin/chmod +x /opt/bin/setup-network-environment
|
||||
ExecStart=/opt/bin/setup-network-environment
|
||||
RemainAfterExit=yes
|
||||
Type=oneshot
|
||||
- name: kube-proxy.service
|
||||
command: start
|
||||
content: |
|
||||
[Unit]
|
||||
Description=Kubernetes Proxy
|
||||
Documentation=https://github.com/GoogleCloudPlatform/kubernetes
|
||||
Requires=setup-network-environment.service
|
||||
After=setup-network-environment.service
|
||||
|
||||
[Service]
|
||||
ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/kubernetes-release/release/v0.5.4/bin/linux/amd64/kube-proxy
|
||||
ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-proxy
|
||||
ExecStart=/opt/bin/kube-proxy \
|
||||
--etcd_servers=http://<master-private-ip>:4001 \
|
||||
--logtostderr=true
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
- name: kube-kubelet.service
|
||||
command: start
|
||||
content: |
|
||||
[Unit]
|
||||
Description=Kubernetes Kubelet
|
||||
Documentation=https://github.com/GoogleCloudPlatform/kubernetes
|
||||
Requires=setup-network-environment.service
|
||||
After=setup-network-environment.service
|
||||
|
||||
[Service]
|
||||
EnvironmentFile=/etc/network-environment
|
||||
ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/kubernetes-release/release/v0.5.4/bin/linux/amd64/kubelet
|
||||
ExecStartPre=/usr/bin/chmod +x /opt/bin/kubelet
|
||||
ExecStart=/opt/bin/kubelet \
|
||||
--address=0.0.0.0 \
|
||||
--port=10250 \
|
||||
--hostname_override=${DEFAULT_IPV4} \
|
||||
--etcd_servers=http://<master-private-ip>:4001 \
|
||||
--logtostderr=true
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
update:
|
||||
group: alpha
|
||||
reboot-strategy: off
|
136
docs/getting-started-guides/coreos/cloud-configs/standalone.yaml
Normal file
136
docs/getting-started-guides/coreos/cloud-configs/standalone.yaml
Normal file
@ -0,0 +1,136 @@
|
||||
#cloud-config
|
||||
|
||||
hostname: standalone
|
||||
coreos:
|
||||
units:
|
||||
- name: etcd.service
|
||||
command: start
|
||||
- name: fleet.service
|
||||
command: start
|
||||
- name: flannel.service
|
||||
command: start
|
||||
content: |
|
||||
[Unit]
|
||||
Requires=etcd.service
|
||||
After=etcd.service
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
Description=flannel is an etcd backed overlay network for containers
|
||||
|
||||
[Service]
|
||||
Type=notify
|
||||
ExecStartPre=-/usr/bin/mkdir -p /opt/bin
|
||||
ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/k8s/flanneld
|
||||
ExecStartPre=/usr/bin/chmod +x /opt/bin/flanneld
|
||||
ExecStartPre=-/usr/bin/etcdctl mk /coreos.com/network/config '{"Network":"10.244.0.0/16", "Backend": {"Type": "vxlan"}}'
|
||||
ExecStart=/opt/bin/flanneld
|
||||
- name: docker.service
|
||||
command: start
|
||||
content: |
|
||||
[Unit]
|
||||
After=flannel.service
|
||||
Wants=flannel.service
|
||||
Description=Docker Application Container Engine
|
||||
Documentation=http://docs.docker.io
|
||||
|
||||
[Service]
|
||||
EnvironmentFile=/run/flannel/subnet.env
|
||||
ExecStartPre=/bin/mount --make-rprivate /
|
||||
ExecStart=/usr/bin/docker -d --bip=${FLANNEL_SUBNET} --mtu=${FLANNEL_MTU} -s=btrfs -H fd://
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
- name: kube-apiserver.service
|
||||
command: start
|
||||
content: |
|
||||
[Unit]
|
||||
Description=Kubernetes API Server
|
||||
Documentation=https://github.com/GoogleCloudPlatform/kubernetes
|
||||
Requires=etcd.service
|
||||
After=etcd.service
|
||||
|
||||
[Service]
|
||||
ExecStartPre=-/usr/bin/mkdir -p /opt/bin
|
||||
ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/kubernetes-release/release/v0.5.4/bin/linux/amd64/kube-apiserver
|
||||
ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-apiserver
|
||||
ExecStart=/opt/bin/kube-apiserver \
|
||||
--address=0.0.0.0 \
|
||||
--portal_net 10.1.0.0/16 \
|
||||
--port=8080 \
|
||||
--etcd_servers=http://127.0.0.1:4001 \
|
||||
--logtostderr=true
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
- name: kube-controller-manager.service
|
||||
command: start
|
||||
content: |
|
||||
[Unit]
|
||||
Description=Kubernetes Controller Manager
|
||||
Documentation=https://github.com/GoogleCloudPlatform/kubernetes
|
||||
Requires=kube-apiserver.service
|
||||
After=kube-apiserver.service
|
||||
|
||||
[Service]
|
||||
ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/kubernetes-release/release/v0.5.4/bin/linux/amd64/kube-controller-manager
|
||||
ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-controller-manager
|
||||
ExecStart=/opt/bin/kube-controller-manager \
|
||||
--machines=127.0.0.1 \
|
||||
--master=127.0.0.1:8080 \
|
||||
--logtostderr=true
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
- name: kube-scheduler.service
|
||||
command: start
|
||||
content: |
|
||||
[Unit]
|
||||
Description=Kubernetes Scheduler
|
||||
Documentation=https://github.com/GoogleCloudPlatform/kubernetes
|
||||
Requires=kube-apiserver.service
|
||||
After=kube-apiserver.service
|
||||
|
||||
[Service]
|
||||
ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/kubernetes-release/release/v0.5.4/bin/linux/amd64/kube-scheduler
|
||||
ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-scheduler
|
||||
ExecStart=/opt/bin/kube-scheduler --master=127.0.0.1:8080
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
- name: kube-proxy.service
|
||||
command: start
|
||||
content: |
|
||||
[Unit]
|
||||
Description=Kubernetes Proxy
|
||||
Documentation=https://github.com/GoogleCloudPlatform/kubernetes
|
||||
Requires=etcd.service
|
||||
After=etcd.service
|
||||
|
||||
[Service]
|
||||
ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/kubernetes-release/release/v0.5.4/bin/linux/amd64/kube-proxy
|
||||
ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-proxy
|
||||
ExecStart=/opt/bin/kube-proxy \
|
||||
--etcd_servers=http://127.0.0.1:4001 \
|
||||
--logtostderr=true
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
- name: kube-kubelet.service
|
||||
command: start
|
||||
content: |
|
||||
[Unit]
|
||||
Description=Kubernetes Kubelet
|
||||
Documentation=https://github.com/GoogleCloudPlatform/kubernetes
|
||||
Requires=etcd.service
|
||||
After=etcd.service
|
||||
|
||||
[Service]
|
||||
ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/kubernetes-release/release/v0.5.4/bin/linux/amd64/kubelet
|
||||
ExecStartPre=/usr/bin/chmod +x /opt/bin/kubelet
|
||||
ExecStart=/opt/bin/kubelet \
|
||||
--address=0.0.0.0 \
|
||||
--port=10250 \
|
||||
--hostname_override=127.0.0.1 \
|
||||
--etcd_servers=http://127.0.0.1:4001 \
|
||||
--logtostderr=true
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
update:
|
||||
group: alpha
|
||||
reboot-strategy: off
|
@ -1,218 +0,0 @@
|
||||
#cloud-config
|
||||
|
||||
hostname: master
|
||||
coreos:
|
||||
etcd:
|
||||
name: master
|
||||
addr: 192.168.12.10:4001
|
||||
bind-addr: 0.0.0.0
|
||||
peer-addr: 192.168.12.10:7001
|
||||
peer-heartbeat-interval: 250
|
||||
peer-election-timeout: 1000
|
||||
units:
|
||||
- name: static.network
|
||||
command: start
|
||||
content: |
|
||||
[Match]
|
||||
Name=ens33
|
||||
|
||||
[Network]
|
||||
Address=192.168.12.10/24
|
||||
DNS=192.168.12.2
|
||||
Gateway=192.168.12.2
|
||||
- name: cbr0.netdev
|
||||
command: start
|
||||
content: |
|
||||
[NetDev]
|
||||
Kind=bridge
|
||||
Name=cbr0
|
||||
- name: cbr0.network
|
||||
command: start
|
||||
content: |
|
||||
[Match]
|
||||
Name=cbr0
|
||||
|
||||
[Network]
|
||||
Address=10.244.0.1/24
|
||||
|
||||
[Route]
|
||||
Destination=10.0.0.0/8
|
||||
Gateway=0.0.0.0
|
||||
- name: cbr0-interface.network
|
||||
command: start
|
||||
content: |
|
||||
[Match]
|
||||
Name=ens34
|
||||
|
||||
[Network]
|
||||
Bridge=cbr0
|
||||
- name: nat.service
|
||||
command: start
|
||||
content: |
|
||||
[Unit]
|
||||
Description=NAT non container traffic
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/sbin/iptables -t nat -A POSTROUTING -o ens33 -j MASQUERADE ! -d 10.0.0.0/8
|
||||
RemainAfterExit=yes
|
||||
Type=oneshot
|
||||
- name: etcd.service
|
||||
command: start
|
||||
- name: fleet.service
|
||||
command: start
|
||||
- name: docker.service
|
||||
command: start
|
||||
content: |
|
||||
[Unit]
|
||||
After=network.target
|
||||
Description=Docker Application Container Engine
|
||||
Documentation=http://docs.docker.io
|
||||
|
||||
[Service]
|
||||
ExecStartPre=/bin/mount --make-rprivate /
|
||||
ExecStart=/usr/bin/docker -d -s=btrfs -H fd:// -b cbr0 --iptables=false
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
- name: download-kubernetes.service
|
||||
command: start
|
||||
content: |
|
||||
[Unit]
|
||||
After=network-online.target
|
||||
Before=kube-apiserver.service
|
||||
Before=kube-controller-manager.service
|
||||
Before=kubelet.service
|
||||
Before=kube-proxy.service
|
||||
Before=kube-scheduler.service
|
||||
Description=Download Kubernetes Binaries
|
||||
Documentation=https://github.com/GoogleCloudPlatform/kubernetes
|
||||
Requires=network-online.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/wget -N -P /opt/bin http://storage.googleapis.com/kubernetes/kube-apiserver
|
||||
ExecStart=/usr/bin/wget -N -P /opt/bin http://storage.googleapis.com/kubernetes/kube-controller-manager
|
||||
ExecStart=/usr/bin/wget -N -P /opt/bin http://storage.googleapis.com/kubernetes/kubecfg
|
||||
ExecStart=/usr/bin/wget -N -P /opt/bin http://storage.googleapis.com/kubernetes/kubelet
|
||||
ExecStart=/usr/bin/wget -N -P /opt/bin http://storage.googleapis.com/kubernetes/kube-proxy
|
||||
ExecStart=/usr/bin/wget -N -P /opt/bin http://storage.googleapis.com/kubernetes/kube-scheduler
|
||||
ExecStart=/usr/bin/chmod +x /opt/bin/kube-apiserver
|
||||
ExecStart=/usr/bin/chmod +x /opt/bin/kube-controller-manager
|
||||
ExecStart=/usr/bin/chmod +x /opt/bin/kubecfg
|
||||
ExecStart=/usr/bin/chmod +x /opt/bin/kubelet
|
||||
ExecStart=/usr/bin/chmod +x /opt/bin/kube-proxy
|
||||
ExecStart=/usr/bin/chmod +x /opt/bin/kube-scheduler
|
||||
RemainAfterExit=yes
|
||||
Type=oneshot
|
||||
- name: kube-apiserver.service
|
||||
command: start
|
||||
content: |
|
||||
[Unit]
|
||||
After=etcd.service
|
||||
After=download-kubernetes.service
|
||||
ConditionFileIsExecutable=/opt/bin/kube-apiserver
|
||||
Description=Kubernetes API Server
|
||||
Documentation=https://github.com/GoogleCloudPlatform/kubernetes
|
||||
Wants=etcd.service
|
||||
Wants=download-kubernetes.service
|
||||
|
||||
[Service]
|
||||
ExecStart=/opt/bin/kube-apiserver \
|
||||
--address=127.0.0.1 \
|
||||
--port=8080 \
|
||||
--etcd_servers=http://127.0.0.1:4001 \
|
||||
--logtostderr=true
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
- name: kube-scheduler.service
|
||||
command: start
|
||||
content: |
|
||||
[Unit]
|
||||
After=kube-apiserver.service
|
||||
After=download-kubernetes.service
|
||||
ConditionFileIsExecutable=/opt/bin/kube-scheduler
|
||||
Description=Kubernetes Scheduler
|
||||
Documentation=https://github.com/GoogleCloudPlatform/kubernetes
|
||||
Wants=kube-apiserver.service
|
||||
|
||||
[Service]
|
||||
ExecStart=/opt/bin/kube-scheduler \
|
||||
--logtostderr=true \
|
||||
--master=127.0.0.1:8080
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
- name: kube-controller-manager.service
|
||||
command: start
|
||||
content: |
|
||||
[Unit]
|
||||
After=etcd.service
|
||||
After=download-kubernetes.service
|
||||
ConditionFileIsExecutable=/opt/bin/kube-controller-manager
|
||||
Description=Kubernetes Controller Manager
|
||||
Documentation=https://github.com/GoogleCloudPlatform/kubernetes
|
||||
Wants=etcd.service
|
||||
Wants=download-kubernetes.service
|
||||
|
||||
[Service]
|
||||
ExecStart=/opt/bin/kube-controller-manager \
|
||||
--master=127.0.0.1:8080 \
|
||||
--machines=192.168.12.10,192.168.12.11,192.168.12.12 \
|
||||
--logtostderr=true
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
- name: kubelet.service
|
||||
command: start
|
||||
content: |
|
||||
[Unit]
|
||||
After=etcd.service
|
||||
After=download-kubernetes.service
|
||||
ConditionFileIsExecutable=/opt/bin/kubelet
|
||||
Description=Kubernetes Kubelet
|
||||
Documentation=https://github.com/GoogleCloudPlatform/kubernetes
|
||||
Wants=etcd.service
|
||||
Wants=download-kubernetes.service
|
||||
|
||||
[Service]
|
||||
ExecStart=/opt/bin/kubelet \
|
||||
--address=0.0.0.0 \
|
||||
--port=10250 \
|
||||
--hostname_override=192.168.12.10 \
|
||||
--etcd_servers=http://127.0.0.1:4001 \
|
||||
--logtostderr=true
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
- name: kube-proxy.service
|
||||
command: start
|
||||
content: |
|
||||
[Unit]
|
||||
After=etcd.service
|
||||
After=download-kubernetes.service
|
||||
ConditionFileIsExecutable=/opt/bin/kube-proxy
|
||||
Description=Kubernetes Proxy
|
||||
Documentation=https://github.com/GoogleCloudPlatform/kubernetes
|
||||
Wants=etcd.service
|
||||
Wants=download-kubernetes.service
|
||||
|
||||
[Service]
|
||||
ExecStart=/opt/bin/kube-proxy --etcd_servers=http://127.0.0.1:4001 --logtostderr=true
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
update:
|
||||
group: alpha
|
||||
reboot-strategy: off
|
||||
ssh_authorized_keys:
|
||||
- <ssh_public_key>
|
@ -1,143 +0,0 @@
|
||||
#cloud-config
|
||||
|
||||
hostname: node1
|
||||
coreos:
|
||||
etcd:
|
||||
name: node1
|
||||
addr: 192.168.12.11:4001
|
||||
bind-addr: 0.0.0.0
|
||||
peer-addr: 192.168.12.11:7001
|
||||
peers: 192.168.12.10:7001,192.168.12.12:7001
|
||||
peer-heartbeat-interval: 250
|
||||
peer-election-timeout: 1000
|
||||
units:
|
||||
- name: static.network
|
||||
command: start
|
||||
content: |
|
||||
[Match]
|
||||
Name=ens33
|
||||
|
||||
[Network]
|
||||
Address=192.168.12.11/24
|
||||
DNS=192.168.12.2
|
||||
Gateway=192.168.12.2
|
||||
- name: cbr0.netdev
|
||||
command: start
|
||||
content: |
|
||||
[NetDev]
|
||||
Kind=bridge
|
||||
Name=cbr0
|
||||
- name: cbr0.network
|
||||
command: start
|
||||
content: |
|
||||
[Match]
|
||||
Name=cbr0
|
||||
|
||||
[Network]
|
||||
Address=10.244.1.1/24
|
||||
|
||||
[Route]
|
||||
Destination=10.0.0.0/8
|
||||
Gateway=0.0.0.0
|
||||
- name: cbr0-interface.network
|
||||
command: start
|
||||
content: |
|
||||
[Match]
|
||||
Name=ens34
|
||||
|
||||
[Network]
|
||||
Bridge=cbr0
|
||||
- name: nat.service
|
||||
command: start
|
||||
content: |
|
||||
[Unit]
|
||||
Description=NAT non container traffic
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/sbin/iptables -t nat -A POSTROUTING -o ens33 -j MASQUERADE ! -d 10.0.0.0/8
|
||||
RemainAfterExit=yes
|
||||
Type=oneshot
|
||||
- name: etcd.service
|
||||
command: start
|
||||
- name: fleet.service
|
||||
command: start
|
||||
- name: docker.service
|
||||
command: start
|
||||
content: |
|
||||
[Unit]
|
||||
After=network.target
|
||||
Description=Docker Application Container Engine
|
||||
Documentation=http://docs.docker.io
|
||||
|
||||
[Service]
|
||||
ExecStartPre=/bin/mount --make-rprivate /
|
||||
ExecStart=/usr/bin/docker -d -s=btrfs -H fd:// -b cbr0 --iptables=false
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
- name: download-kubernetes.service
|
||||
command: start
|
||||
content: |
|
||||
[Unit]
|
||||
After=network-online.target
|
||||
Before=kubelet.service
|
||||
Before=proxy.service
|
||||
Description=Download Kubernetes Binaries
|
||||
Documentation=https://github.com/GoogleCloudPlatform/kubernetes
|
||||
Requires=network-online.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/wget -N -P /opt/bin http://storage.googleapis.com/kubernetes/kubelet
|
||||
ExecStart=/usr/bin/wget -N -P /opt/bin http://storage.googleapis.com/kubernetes/proxy
|
||||
ExecStart=/usr/bin/chmod +x /opt/bin/kubelet
|
||||
ExecStart=/usr/bin/chmod +x /opt/bin/proxy
|
||||
RemainAfterExit=yes
|
||||
Type=oneshot
|
||||
- name: kubelet.service
|
||||
command: start
|
||||
content: |
|
||||
[Unit]
|
||||
After=etcd.service
|
||||
After=download-kubernetes.service
|
||||
ConditionFileIsExecutable=/opt/bin/kubelet
|
||||
Description=Kubernetes Kubelet
|
||||
Documentation=https://github.com/GoogleCloudPlatform/kubernetes
|
||||
Wants=etcd.service
|
||||
Wants=download-kubernetes.service
|
||||
|
||||
[Service]
|
||||
ExecStart=/opt/bin/kubelet \
|
||||
--address=0.0.0.0 \
|
||||
--port=10250 \
|
||||
--hostname_override=192.168.12.11 \
|
||||
--etcd_servers=http://127.0.0.1:4001 \
|
||||
--logtostderr=true
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
- name: proxy.service
|
||||
command: start
|
||||
content: |
|
||||
[Unit]
|
||||
After=etcd.service
|
||||
After=download-kubernetes.service
|
||||
ConditionFileIsExecutable=/opt/bin/proxy
|
||||
Description=Kubernetes Proxy
|
||||
Documentation=https://github.com/GoogleCloudPlatform/kubernetes
|
||||
Wants=etcd.service
|
||||
Wants=download-kubernetes.service
|
||||
|
||||
[Service]
|
||||
ExecStart=/opt/bin/proxy --etcd_servers=http://127.0.0.1:4001 --logtostderr=true
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
update:
|
||||
group: alpha
|
||||
reboot-strategy: off
|
||||
ssh_authorized_keys:
|
||||
- <ssh_public_key>
|
@ -1,143 +0,0 @@
|
||||
#cloud-config
|
||||
|
||||
hostname: node2
|
||||
coreos:
|
||||
etcd:
|
||||
name: node2
|
||||
addr: 192.168.12.12:4001
|
||||
bind-addr: 0.0.0.0
|
||||
peer-addr: 192.168.12.12:7001
|
||||
peers: 192.168.12.10:7001,192.168.12.11:7001
|
||||
peer-heartbeat-interval: 250
|
||||
peer-election-timeout: 1000
|
||||
units:
|
||||
- name: static.network
|
||||
command: start
|
||||
content: |
|
||||
[Match]
|
||||
Name=ens33
|
||||
|
||||
[Network]
|
||||
Address=192.168.12.12/24
|
||||
DNS=192.168.12.2
|
||||
Gateway=192.168.12.2
|
||||
- name: cbr0.netdev
|
||||
command: start
|
||||
content: |
|
||||
[NetDev]
|
||||
Kind=bridge
|
||||
Name=cbr0
|
||||
- name: cbr0.network
|
||||
command: start
|
||||
content: |
|
||||
[Match]
|
||||
Name=cbr0
|
||||
|
||||
[Network]
|
||||
Address=10.244.2.1/24
|
||||
|
||||
[Route]
|
||||
Destination=10.0.0.0/8
|
||||
Gateway=0.0.0.0
|
||||
- name: cbr0-interface.network
|
||||
command: start
|
||||
content: |
|
||||
[Match]
|
||||
Name=ens34
|
||||
|
||||
[Network]
|
||||
Bridge=cbr0
|
||||
- name: nat.service
|
||||
command: start
|
||||
content: |
|
||||
[Unit]
|
||||
Description=NAT non container traffic
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/sbin/iptables -t nat -A POSTROUTING -o ens33 -j MASQUERADE ! -d 10.0.0.0/8
|
||||
RemainAfterExit=yes
|
||||
Type=oneshot
|
||||
- name: etcd.service
|
||||
command: start
|
||||
- name: fleet.service
|
||||
command: start
|
||||
- name: docker.service
|
||||
command: start
|
||||
content: |
|
||||
[Unit]
|
||||
After=network.target
|
||||
Description=Docker Application Container Engine
|
||||
Documentation=http://docs.docker.io
|
||||
|
||||
[Service]
|
||||
ExecStartPre=/bin/mount --make-rprivate /
|
||||
ExecStart=/usr/bin/docker -d -s=btrfs -H fd:// -b cbr0 --iptables=false
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
- name: download-kubernetes.service
|
||||
command: start
|
||||
content: |
|
||||
[Unit]
|
||||
After=network-online.target
|
||||
Before=kubelet.service
|
||||
Before=proxy.service
|
||||
Description=Download Kubernetes Binaries
|
||||
Documentation=https://github.com/GoogleCloudPlatform/kubernetes
|
||||
Requires=network-online.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/wget -N -P /opt/bin http://storage.googleapis.com/kubernetes/kubelet
|
||||
ExecStart=/usr/bin/wget -N -P /opt/bin http://storage.googleapis.com/kubernetes/proxy
|
||||
ExecStart=/usr/bin/chmod +x /opt/bin/kubelet
|
||||
ExecStart=/usr/bin/chmod +x /opt/bin/proxy
|
||||
RemainAfterExit=yes
|
||||
Type=oneshot
|
||||
- name: kubelet.service
|
||||
command: start
|
||||
content: |
|
||||
[Unit]
|
||||
After=etcd.service
|
||||
After=download-kubernetes.service
|
||||
ConditionFileIsExecutable=/opt/bin/kubelet
|
||||
Description=Kubernetes Kubelet
|
||||
Documentation=https://github.com/GoogleCloudPlatform/kubernetes
|
||||
Wants=etcd.service
|
||||
Wants=download-kubernetes.service
|
||||
|
||||
[Service]
|
||||
ExecStart=/opt/bin/kubelet \
|
||||
--address=0.0.0.0 \
|
||||
--port=10250 \
|
||||
--hostname_override=192.168.12.12 \
|
||||
--etcd_servers=http://127.0.0.1:4001 \
|
||||
--logtostderr=true
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
- name: proxy.service
|
||||
command: start
|
||||
content: |
|
||||
[Unit]
|
||||
After=etcd.service
|
||||
After=download-kubernetes.service
|
||||
ConditionFileIsExecutable=/opt/bin/proxy
|
||||
Description=Kubernetes Proxy
|
||||
Documentation=https://github.com/GoogleCloudPlatform/kubernetes
|
||||
Wants=etcd.service
|
||||
Wants=download-kubernetes.service
|
||||
|
||||
[Service]
|
||||
ExecStart=/opt/bin/proxy --etcd_servers=http://127.0.0.1:4001 --logtostderr=true
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
update:
|
||||
group: alpha
|
||||
reboot-strategy: off
|
||||
ssh_authorized_keys:
|
||||
- <ssh_public_key>
|
@ -1,135 +0,0 @@
|
||||
#cloud-config
|
||||
|
||||
hostname: standalone
|
||||
coreos:
|
||||
units:
|
||||
- name: etcd.service
|
||||
command: start
|
||||
- name: fleet.service
|
||||
command: start
|
||||
- name: download-kubernetes.service
|
||||
command: start
|
||||
content: |
|
||||
[Unit]
|
||||
After=network-online.target
|
||||
Before=kube-apiserver.service
|
||||
Before=kube-controller-manager.service
|
||||
Before=kubelet.service
|
||||
Before=kube-proxy.service
|
||||
Before=kube-scheduler.service
|
||||
Description=Download Kubernetes Binaries
|
||||
Documentation=https://github.com/GoogleCloudPlatform/kubernetes
|
||||
Requires=network-online.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/wget -N -P /opt/bin http://storage.googleapis.com/kubernetes/kube-apiserver
|
||||
ExecStart=/usr/bin/wget -N -P /opt/bin http://storage.googleapis.com/kubernetes/kube-controller-manager
|
||||
ExecStart=/usr/bin/wget -N -P /opt/bin http://storage.googleapis.com/kubernetes/kubecfg
|
||||
ExecStart=/usr/bin/wget -N -P /opt/bin http://storage.googleapis.com/kubernetes/kubelet
|
||||
ExecStart=/usr/bin/wget -N -P /opt/bin http://storage.googleapis.com/kubernetes/kube-proxy
|
||||
ExecStart=/usr/bin/wget -N -P /opt/bin http://storage.googleapis.com/kubernetes/kube-scheduler
|
||||
ExecStart=/usr/bin/chmod +x /opt/bin/kube-apiserver
|
||||
ExecStart=/usr/bin/chmod +x /opt/bin/kube-controller-manager
|
||||
ExecStart=/usr/bin/chmod +x /opt/bin/kubecfg
|
||||
ExecStart=/usr/bin/chmod +x /opt/bin/kubelet
|
||||
ExecStart=/usr/bin/chmod +x /opt/bin/kube-proxy
|
||||
ExecStart=/usr/bin/chmod +x /opt/bin/kube-scheduler
|
||||
RemainAfterExit=yes
|
||||
Type=oneshot
|
||||
- name: kube-apiserver.service
|
||||
command: start
|
||||
content: |
|
||||
[Unit]
|
||||
ConditionFileIsExecutable=/opt/bin/kube-apiserver
|
||||
Description=Kubernetes API Server
|
||||
Documentation=https://github.com/GoogleCloudPlatform/kubernetes
|
||||
|
||||
[Service]
|
||||
ExecStart=/opt/bin/kube-apiserver \
|
||||
--address=127.0.0.1 \
|
||||
--port=8080 \
|
||||
--etcd_servers=http://127.0.0.1:4001 \
|
||||
--logtostderr=true
|
||||
Restart=on-failure
|
||||
RestartSec=1
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
- name: kube-scheduler.service
|
||||
command: start
|
||||
content: |
|
||||
[Unit]
|
||||
After=kube-apiserver.service
|
||||
After=download-kubernetes.service
|
||||
ConditionFileIsExecutable=/opt/bin/kube-scheduler
|
||||
Description=Kubernetes Scheduler
|
||||
Documentation=https://github.com/GoogleCloudPlatform/kubernetes
|
||||
Wants=kube-apiserver.service
|
||||
|
||||
[Service]
|
||||
ExecStart=/opt/bin/kube-scheduler \
|
||||
--logtostderr=true \
|
||||
--master=127.0.0.1:8080
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
- name: kube-controller-manager.service
|
||||
command: start
|
||||
content: |
|
||||
[Unit]
|
||||
ConditionFileIsExecutable=/opt/bin/kube-controller-manager
|
||||
Description=Kubernetes Controller Manager
|
||||
Documentation=https://github.com/GoogleCloudPlatform/kubernetes
|
||||
|
||||
[Service]
|
||||
ExecStart=/opt/bin/kube-controller-manager \
|
||||
--master=127.0.0.1:8080 \
|
||||
--machines=127.0.0.1 \
|
||||
--logtostderr=true
|
||||
Restart=on-failure
|
||||
RestartSec=1
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
- name: kubelet.service
|
||||
command: start
|
||||
content: |
|
||||
[Unit]
|
||||
ConditionFileIsExecutable=/opt/bin/kubelet
|
||||
Description=Kubernetes Kubelet
|
||||
Documentation=https://github.com/GoogleCloudPlatform/kubernetes
|
||||
|
||||
[Service]
|
||||
ExecStart=/opt/bin/kubelet \
|
||||
--address=127.0.0.1 \
|
||||
--port=10250 \
|
||||
--hostname_override=127.0.0.1 \
|
||||
--etcd_servers=http://127.0.0.1:4001 \
|
||||
--logtostderr=true
|
||||
Restart=on-failure
|
||||
RestartSec=1
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
- name: kube-proxy.service
|
||||
command: start
|
||||
content: |
|
||||
[Unit]
|
||||
ConditionFileIsExecutable=/opt/bin/kube-proxy
|
||||
Description=Kubernetes Proxy
|
||||
Documentation=https://github.com/GoogleCloudPlatform/kubernetes
|
||||
|
||||
[Service]
|
||||
ExecStart=/opt/bin/kube-proxy --etcd_servers=http://127.0.0.1:4001 --logtostderr=true
|
||||
Restart=on-failure
|
||||
RestartSec=1
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
update:
|
||||
group: alpha
|
||||
reboot-strategy: etcd-lock
|
||||
ssh_authorized_keys:
|
||||
- <ssh_public_key>
|
@ -1,131 +0,0 @@
|
||||
# CoreOS Cloud Configs
|
||||
|
||||
The recommended way to run Kubernetes on CoreOS is to use [Cloud-Config](https://coreos.com/docs/cluster-management/setup/cloudinit-cloud-config/).
|
||||
|
||||
## Setup
|
||||
|
||||
Get the cloud-config templates which we'll be editing in place for this example.
|
||||
```
|
||||
git clone https://github.com/GoogleCloudPlatform/kubernetes.git
|
||||
cd kubernetes/docs/getting-started-guides/coreos/configs
|
||||
```
|
||||
|
||||
### Standalone
|
||||
|
||||
The standalone cloud-config file can be used to setup a single node Kubernetes cluster that has had CoreOS installed.
|
||||
|
||||
* [standalone.yml](configs/standalone.yml)
|
||||
|
||||
Skip to ['Configure Access'](#configure-access).
|
||||
|
||||
|
||||
### Cluster
|
||||
|
||||
These are the current instructions for [Kelsey Hightowers blog post Running Kubernetes on CoreOS Part 2](https://coreos.com/blog/running-kubernetes-example-on-CoreOS-part-2/)
|
||||
which provides a good background context for understanding Kubernetes and how to set this up using VMWare Fusion Pro.
|
||||
|
||||
#### Machine Configuration
|
||||
To start we'll need 3 nodes for our cluster with the following:
|
||||
* 1 CPU
|
||||
* 512 MB RAM
|
||||
* 20 GB HDD
|
||||
* 2 Network Interfaces
|
||||
* CD ROM (to install CoreOS and to provide configuration from [cloud-drive] (http://coreos.com/docs/cluster-management/setup/cloudinit-config-drive/)
|
||||
|
||||
The primary network interface for each machine should be on a network with access to the outside world in order to
|
||||
update CoreOS, access the Docker repository, download Kubernetes, etc. The second interface on each machine should each
|
||||
be connected to a switch. (VMWare Fusion Pro users can create a custom network with DHCP and NAT disabled that these
|
||||
secondary interfaces connected to - see [the blog post](https://coreos.com/blog/running-kubernetes-example-on-CoreOS-part-2/)
|
||||
for screenshots).
|
||||
|
||||
Boot each node from the [CoreOS](https://coreos.com/) ISO. Hit 'Return' a few times in the console window of a node.
|
||||
Above the login prompt CoreOS lists the names it has generated for the network interfaces followed by the IP address it
|
||||
has been assigned. Note the first interface name, and proceed to install CoreOS.
|
||||
|
||||
#### Cloud Configuration
|
||||
The following cloud-config templates are used to setup a three node Kubernetes cluster.
|
||||
* [master.yml](configs/master.yml)
|
||||
* [node1.yml](configs/node1.yml)
|
||||
* [node2.yml](configs/node2.yml)
|
||||
|
||||
Search for occurrences of 'ens33' in these templates and replace with the interface name provided by CoreOS.
|
||||
|
||||
Replace all occurrences of '192.168.12.10' with the IP address you wish to apply to the master node, '192.168.12.11'
|
||||
with the IP address to assign to node1, '192.168.12.12' with IP address for node2. In the section
|
||||
'coreos/units/static.network' set the DNS and Gateway entries to match your network. (VMWare Fusion users can find this
|
||||
information in: "/Library/Preferences/VMware Fusion/vmnet8/dhcpd.conf" see [the blog post](https://coreos.com/blog/running-kubernetes-example-on-CoreOS-part-2/)
|
||||
- be sure to choose static IPs outside the dynamic ip range specified here).
|
||||
|
||||
### Configure Access
|
||||
|
||||
For both the standalone and cluster configurations, the final change required to the cloud-config file(s) is to replace
|
||||
<ssh_public_key> with your public ssh key (typically the contents of ~/.ssh/id_rsa.pub).
|
||||
|
||||
### Create config-drives
|
||||
|
||||
Now create the ISO images that cloud-config will access when booting your node(s).
|
||||
|
||||
```
|
||||
mkdir -p /tmp/new-drive/openstack/latest/
|
||||
mkdir -p ~/iso
|
||||
```
|
||||
|
||||
Using Linux:
|
||||
|
||||
```
|
||||
for i in standalone master node1 node2; do
|
||||
cp ${i}.yml /tmp/new-drive/openstack/latest/user_data
|
||||
mkisofs -R -V config-2 -o ~/iso/${i}.iso /tmp/new-drive
|
||||
done
|
||||
```
|
||||
|
||||
Using OS X:
|
||||
|
||||
```
|
||||
for i in standalone master node1 node2; do
|
||||
cp ${i}.yml /tmp/new-drive/openstack/latest/user_data
|
||||
hdiutil makehybrid -iso -joliet -joliet-volume-name "config-2" -joliet -o ~/iso/${i}.iso /tmp/new-drive
|
||||
done
|
||||
```
|
||||
|
||||
Make each ISO file accessible to its corresponding node by using it to define a cd/dvd drive for the VM (or create a
|
||||
physical CD for bare metal), and boot the node. At the consoles login prompt, confirm the configured IP address for the
|
||||
node is listed next to the interface name.
|
||||
|
||||
## Remote Access
|
||||
|
||||
Setup a SSH tunnel to the Kubernetes API Server, replacing ${APISERVER} with the IP address of your master or
|
||||
standalone node.
|
||||
|
||||
```
|
||||
sudo ssh -f -nNT -L 8080:127.0.0.1:8080 core@${APISERVER}
|
||||
```
|
||||
|
||||
Download a kubecfg client
|
||||
|
||||
**Darwin**
|
||||
|
||||
```
|
||||
wget http://storage.googleapis.com/kubernetes/darwin/kubecfg -O /usr/local/bin/kubecfg
|
||||
```
|
||||
|
||||
**Linux**
|
||||
|
||||
```
|
||||
wget http://storage.googleapis.com/kubernetes/kubecfg -O /usr/local/bin/kubecfg
|
||||
```
|
||||
|
||||
Issue commands remotely using the kubecfg command line tool.
|
||||
|
||||
```
|
||||
kubecfg list /pods
|
||||
```
|
||||
|
||||
Test a sample pod:
|
||||
|
||||
````
|
||||
kubecfg -c examples/guestbook-go/redis-master-pod.json create pods
|
||||
kubecfg list /pods
|
||||
```
|
||||
|
||||
Your pod should now be listed as 'running'.
|
122
docs/getting-started-guides/coreos/coreos_multinode_cluster.md
Normal file
122
docs/getting-started-guides/coreos/coreos_multinode_cluster.md
Normal file
@ -0,0 +1,122 @@
|
||||
# CoreOS Multinode Cluster
|
||||
|
||||
Use the [master.yaml](cloud-configs/master.yaml) and [node.yaml](cloud-configs/node.yaml) cloud-configs to provision a multi-node Kubernetes cluster.
|
||||
|
||||
## Overview
|
||||
|
||||
* Provision the master node
|
||||
* Capture the master node private IP address
|
||||
* Edit node.yaml
|
||||
* Provision one or more worker nodes
|
||||
|
||||
### AWS
|
||||
|
||||
#### Provision the Master
|
||||
|
||||
```
|
||||
aws ec2 create-security-group --group-name kubernetes --description "Kubernetes Security Group"
|
||||
aws ec2 authorize-security-group-ingress --group-name kubernetes --protocol tcp --port 22 --cidr 0.0.0.0/0
|
||||
aws ec2 authorize-security-group-ingress --group-name kubernetes --protocol tcp --port 80 --cidr 0.0.0.0/0
|
||||
aws ec2 authorize-security-group-ingress --group-name kubernetes --source-security-group-name kubernetes
|
||||
```
|
||||
|
||||
```
|
||||
aws ec2 run-instances \
|
||||
--image-id ami-d92377e9 \
|
||||
--key-name <keypair> \
|
||||
--region us-west-2 \
|
||||
--security-groups kubernetes \
|
||||
--instance-type m3.medium \
|
||||
--user-data file://master.yaml
|
||||
```
|
||||
|
||||
#### Capture the private IP address
|
||||
|
||||
```
|
||||
aws ec2 describe-instances --instance-id <master-instance-id>
|
||||
```
|
||||
|
||||
#### Edit node.yaml
|
||||
|
||||
Edit `node.yaml` and replace all instances of `<master-private-ip>` with the private IP address of the master node.
|
||||
|
||||
#### Provision worker nodes
|
||||
|
||||
```
|
||||
aws ec2 run-instances \
|
||||
--count 1 \
|
||||
--image-id ami-d92377e9 \
|
||||
--key-name <keypair> \
|
||||
--region us-west-2 \
|
||||
--security-groups kubernetes \
|
||||
--instance-type m3.medium \
|
||||
--user-data file://node.yaml
|
||||
```
|
||||
|
||||
### GCE
|
||||
|
||||
#### Provision the Master
|
||||
|
||||
```
|
||||
gcloud compute instances create master \
|
||||
--image-project coreos-cloud \
|
||||
--image coreos-alpha-509-1-0-v20141124 \
|
||||
--boot-disk-size 200GB \
|
||||
--machine-type n1-standard-1 \
|
||||
--zone us-central1-a \
|
||||
--metadata-from-file user-data=master.yaml
|
||||
```
|
||||
|
||||
#### Capture the private IP address
|
||||
|
||||
```
|
||||
gcloud compute instances list
|
||||
```
|
||||
|
||||
#### Edit node.yaml
|
||||
|
||||
Edit `node.yaml` and replace all instances of `<master-private-ip>` with the private IP address of the master node.
|
||||
|
||||
#### Provision worker nodes
|
||||
|
||||
```
|
||||
gcloud compute instances create node1 \
|
||||
--image-project coreos-cloud \
|
||||
--image coreos-alpha-509-1-0-v20141124 \
|
||||
--boot-disk-size 200GB \
|
||||
--machine-type n1-standard-1 \
|
||||
--zone us-central1-a \
|
||||
--metadata-from-file user-data=node.yaml
|
||||
```
|
||||
|
||||
### VMware Fusion
|
||||
|
||||
#### Create the master config-drive
|
||||
|
||||
```
|
||||
mkdir -p /tmp/new-drive/openstack/latest/
|
||||
cp master.yaml /tmp/new-drive/openstack/latest/user_data
|
||||
hdiutil makehybrid -iso -joliet -joliet-volume-name "config-2" -joliet -o master.iso /tmp/new-drive
|
||||
```
|
||||
|
||||
#### Provision the Master
|
||||
|
||||
Boot the [vmware image](https://coreos.com/docs/running-coreos/platforms/vmware) using `master.iso` as a config drive.
|
||||
|
||||
#### Capture the master private IP address
|
||||
|
||||
#### Edit node.yaml
|
||||
|
||||
Edit `node.yaml` and replace all instances of `<master-private-ip>` with the private IP address of the master node.
|
||||
|
||||
#### Create the node config-drive
|
||||
|
||||
```
|
||||
mkdir -p /tmp/new-drive/openstack/latest/
|
||||
cp node.yaml /tmp/new-drive/openstack/latest/user_data
|
||||
hdiutil makehybrid -iso -joliet -joliet-volume-name "config-2" -joliet -o node.iso /tmp/new-drive
|
||||
```
|
||||
|
||||
#### Provision worker nodes
|
||||
|
||||
Boot one or more the [vmware image](https://coreos.com/docs/running-coreos/platforms/vmware) using `node.iso` as a config drive.
|
@ -1,59 +0,0 @@
|
||||
# CoreOS Quick Start Guide
|
||||
|
||||
The following steps will setup a single node Kubernetes cluster. For a more robust setup using cloud-config see the
|
||||
[Installation Guide](coreos_cloud_config.md) which automates the entire set-up. Those not installing via cloud-config
|
||||
need to define the required network configuration from in the [Network Guide](networking.md).
|
||||
|
||||
### Install Kubernetes binaries
|
||||
|
||||
```
|
||||
sudo mkdir -p /opt/bin
|
||||
sudo wget https://storage.googleapis.com/kubernetes/binaries.tar.gz
|
||||
sudo tar -xvf binaries.tar.gz -C /opt/bin
|
||||
```
|
||||
|
||||
### Add the Kubernetes systemd units
|
||||
|
||||
```
|
||||
git clone https://github.com/GoogleCloudPlatform/kubernetes.git
|
||||
sudo cp kubernetes/docs/getting-started-guides/coreos/units/* /etc/systemd/system/
|
||||
```
|
||||
|
||||
### Start the Kubernetes services
|
||||
|
||||
```
|
||||
sudo systemctl start kube-apiserver
|
||||
sudo systemctl start kube-scheduler
|
||||
sudo systemctl start kube-controller-manager
|
||||
sudo systemctl start kubelet
|
||||
sudo systemctl start kube-proxy
|
||||
```
|
||||
|
||||
### Running commands remotely
|
||||
|
||||
Setup a SSH tunnel to the Kubernetes API Server.
|
||||
|
||||
```
|
||||
sudo ssh -f -nNT -L 8080:127.0.0.1:8080 core@${APISERVER}
|
||||
```
|
||||
|
||||
Download a kubecfg client
|
||||
|
||||
**Darwin**
|
||||
|
||||
```
|
||||
curl -o /usr/local/bin/kubecfg https://storage.googleapis.com/kubernetes/darwin/kubecfg
|
||||
chmod +x /usr/local/bin/kubecfg
|
||||
```
|
||||
|
||||
**Linux**
|
||||
|
||||
```
|
||||
wget https://storage.googleapis.com/kubernetes/kubecfg -O /usr/local/bin/kubecfg
|
||||
```
|
||||
|
||||
Issue commands remotely using the kubecfg command line tool.
|
||||
|
||||
```
|
||||
kubecfg list /pods
|
||||
```
|
@ -0,0 +1,45 @@
|
||||
# CoreOS - Single Node Kubernetes Cluster
|
||||
|
||||
Use the [standalone.yaml](cloud-configs/standalone.yaml) cloud-config to provision a single node Kubernetes cluster.
|
||||
|
||||
### AWS
|
||||
|
||||
```
|
||||
aws ec2 create-security-group --group-name kubernetes --description "Kubernetes Security Group"
|
||||
aws ec2 authorize-security-group-ingress --group-name kubernetes --protocol tcp --port 22 --cidr 0.0.0.0/0
|
||||
aws ec2 authorize-security-group-ingress --group-name kubernetes --source-security-group-name kubernetes
|
||||
```
|
||||
|
||||
```
|
||||
aws ec2 run-instances \
|
||||
--image-id ami-d92377e9 \
|
||||
--key-name <keypair> \
|
||||
--region us-west-2 \
|
||||
--security-groups kubernetes \
|
||||
--instance-type m3.medium \
|
||||
--user-data file://standalone.yaml
|
||||
```
|
||||
|
||||
### GCE
|
||||
|
||||
```
|
||||
gcloud compute instances create standalone \
|
||||
--image-project coreos-cloud \
|
||||
--image coreos-alpha-509-1-0-v20141124 \
|
||||
--boot-disk-size 200GB \
|
||||
--machine-type n1-standard-1 \
|
||||
--zone us-central1-a \
|
||||
--metadata-from-file user-data=standalone.yaml
|
||||
```
|
||||
|
||||
### VMware Fusion
|
||||
|
||||
Create a [config-drive](https://coreos.com/docs/cluster-management/setup/cloudinit-config-drive) ISO.
|
||||
|
||||
```
|
||||
mkdir -p /tmp/new-drive/openstack/latest/
|
||||
cp standalone.yaml /tmp/new-drive/openstack/latest/user_data
|
||||
hdiutil makehybrid -iso -joliet -joliet-volume-name "config-2" -joliet -o standalone.iso /tmp/new-drive
|
||||
```
|
||||
|
||||
Boot the [vmware image](https://coreos.com/docs/running-coreos/platforms/vmware) using the `standalone.iso` as a config drive.
|
@ -1,67 +0,0 @@
|
||||
# Network Setup Guide
|
||||
|
||||
This guide demostrates a network setup that will work for environments with access to layer 2 networking
|
||||
(bare metal, vmware, etc). The following steps are not required when following the [Installation Guide](coreos_cloud_config.md).
|
||||
|
||||
Please note: With some hypervisors, you may have to enable special settings on the virtual network cards for bridging to work (for example, you need to allow 'MAC address spoofing' in Microsoft Hyper-V).
|
||||
|
||||
## Hostnames
|
||||
|
||||
On each node ensure the hostname is set.
|
||||
|
||||
```
|
||||
hostnamectl set-hostname master
|
||||
hostnamectl set-hostname node1
|
||||
hostnamectl set-hostname node2
|
||||
```
|
||||
|
||||
### Setup /etc/hosts
|
||||
|
||||
On each node add the following lines to /etc/hosts:
|
||||
|
||||
```
|
||||
192.168.12.10 master
|
||||
192.168.12.11 node1
|
||||
192.168.12.12 node2
|
||||
```
|
||||
|
||||
## Create the cbr0 bridge
|
||||
|
||||
On each node run the following commands to setup the cbr0 bridge used by Docker and Kubernetes.
|
||||
|
||||
```
|
||||
brctl addbr cbr0
|
||||
brctl addif cbr0 ens34
|
||||
ip link set dev cbr0 mtu 1460
|
||||
ip addr add 10.244.0.1/24 dev cbr0 # this will be different for each minion
|
||||
ip link set dev cbr0 up
|
||||
ip route add 10.0.0.0/8 dev cbr0
|
||||
```
|
||||
|
||||
Each node should use a different address. For example:
|
||||
|
||||
master
|
||||
|
||||
```
|
||||
ip addr add 10.244.0.1/24 dev cbr0
|
||||
```
|
||||
|
||||
node1
|
||||
|
||||
```
|
||||
ip addr add 10.244.1.1/24 dev cbr0
|
||||
```
|
||||
|
||||
node2
|
||||
|
||||
```
|
||||
ip addr add 10.244.2.1/24 dev cbr0
|
||||
```
|
||||
|
||||
## Configure IP tables
|
||||
|
||||
On each node run the following command to allow containers to reach the internet.
|
||||
|
||||
```
|
||||
iptables -t nat -A POSTROUTING -o ens33 -j MASQUERADE \! -d 10.0.0.0/8
|
||||
```
|
@ -1,11 +0,0 @@
|
||||
[Unit]
|
||||
After=network.target
|
||||
Description=Docker Application Container Engine
|
||||
Documentation=http://docs.docker.io
|
||||
|
||||
[Service]
|
||||
ExecStartPre=/bin/mount --make-rprivate /
|
||||
ExecStart=/usr/bin/docker -d -s=btrfs -H fd:// -b cbr0 --iptables=false --ip-masq=false
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
@ -1,23 +0,0 @@
|
||||
[Unit]
|
||||
After=network-online.target
|
||||
Before=kube-apiserver.service
|
||||
Before=kube-controller-manager.service
|
||||
Before=kubelet.service
|
||||
Before=kube-proxy.service
|
||||
Description=Download Kubernetes Binaries
|
||||
Documentation=https://github.com/GoogleCloudPlatform/kubernetes
|
||||
Requires=network-online.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/wget -N -P /opt/bin http://storage.googleapis.com/kubernetes/kube-apiserver
|
||||
ExecStart=/usr/bin/wget -N -P /opt/bin http://storage.googleapis.com/kubernetes/kube-controller-manager
|
||||
ExecStart=/usr/bin/wget -N -P /opt/bin http://storage.googleapis.com/kubernetes/kubecfg
|
||||
ExecStart=/usr/bin/wget -N -P /opt/bin http://storage.googleapis.com/kubernetes/kubelet
|
||||
ExecStart=/usr/bin/wget -N -P /opt/bin http://storage.googleapis.com/kubernetes/kube-proxy
|
||||
ExecStart=/usr/bin/chmod +x /opt/bin/kube-apiserver
|
||||
ExecStart=/usr/bin/chmod +x /opt/bin/kube-controller-manager
|
||||
ExecStart=/usr/bin/chmod +x /opt/bin/kubecfg
|
||||
ExecStart=/usr/bin/chmod +x /opt/bin/kubelet
|
||||
ExecStart=/usr/bin/chmod +x /opt/bin/kube-proxy
|
||||
RemainAfterExit=yes
|
||||
Type=oneshot
|
@ -1,17 +0,0 @@
|
||||
[Unit]
|
||||
ConditionFileIsExecutable=/opt/bin/kube-apiserver
|
||||
Description=Kubernetes API Server
|
||||
Documentation=https://github.com/GoogleCloudPlatform/kubernetes
|
||||
|
||||
[Service]
|
||||
ExecStart=/opt/bin/kube-apiserver \
|
||||
--address=127.0.0.1 \
|
||||
--port=8080 \
|
||||
--etcd_servers=http://127.0.0.1:4001 \
|
||||
--portal_net=10.0.0.0/24 \
|
||||
--logtostderr=true
|
||||
Restart=on-failure
|
||||
RestartSec=1
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
@ -1,16 +0,0 @@
|
||||
[Unit]
|
||||
ConditionFileIsExecutable=/opt/bin/kube-controller-manager
|
||||
Description=Kubernetes Controller Manager
|
||||
Documentation=https://github.com/GoogleCloudPlatform/kubernetes
|
||||
|
||||
[Service]
|
||||
ExecStart=/opt/bin/kube-controller-manager \
|
||||
--master=127.0.0.1:8080 \
|
||||
--machines=127.0.0.1 \
|
||||
--etcd_servers=http://127.0.0.1:4001 \
|
||||
--logtostderr=true
|
||||
Restart=on-failure
|
||||
RestartSec=1
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
@ -1,12 +0,0 @@
|
||||
[Unit]
|
||||
ConditionFileIsExecutable=/opt/bin/kube-proxy
|
||||
Description=Kubernetes Proxy
|
||||
Documentation=https://github.com/GoogleCloudPlatform/kubernetes
|
||||
|
||||
[Service]
|
||||
ExecStart=/opt/bin/kube-proxy --etcd_servers=http://127.0.0.1:4001 --logtostderr=true
|
||||
Restart=on-failure
|
||||
RestartSec=1
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
@ -1,16 +0,0 @@
|
||||
[Unit]
|
||||
After=kube-apiserver.service
|
||||
ConditionFileIsExecutable=/opt/bin/kube-scheduler
|
||||
Description=Kubernetes Scheduler
|
||||
Documentation=https://github.com/GoogleCloudPlatform/kubernetes
|
||||
Wants=kube-apiserver.service
|
||||
|
||||
[Service]
|
||||
ExecStart=/opt/bin/kube-scheduler \
|
||||
--logtostderr=true \
|
||||
--master=127.0.0.1:8080
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
@ -1,17 +0,0 @@
|
||||
[Unit]
|
||||
ConditionFileIsExecutable=/opt/bin/kubelet
|
||||
Description=Kubernetes Kubelet
|
||||
Documentation=https://github.com/GoogleCloudPlatform/kubernetes
|
||||
|
||||
[Service]
|
||||
ExecStart=/opt/bin/kubelet \
|
||||
--address=127.0.0.1 \
|
||||
--port=10250 \
|
||||
--hostname_override=127.0.0.1 \
|
||||
--etcd_servers=http://127.0.0.1:4001 \
|
||||
--logtostderr=true
|
||||
Restart=on-failure
|
||||
RestartSec=1
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Loading…
Reference in New Issue
Block a user