0. 서버 설정
Master : 192.168.75.129 (etcd, flannel, kube-apiserver, kube-controller-manager, kube-scheduler)
Node : 192.168.75.130 (flannel, kube-proxy, kubelet)
# gpasswd -a stack sudo (? 안되는데??)
0. Kubernetes 소스 다운로드 및 WebStorm 지정
# 소스 다운로드
Go 설치 및 패스 (http://ahnseungkyu.com/204)
$ cd ~/Documents/go_workspace/src
$ go get k8s.io/kubernetes
$ cd k8s.io/kubernetes
$ git checkout -b v1.1.2 tags/v1.1.2
# WebStorm New Project 로 Go 프로젝트 생성
경로 : ~/Documents/go_workspace/src/k8s.io/kubernetes
# WebStorm >> Preferences >> Languages & Frameworks >> Go >> Go SDK 에 추가
Path : /usr/local/go
# WebStorm >> Preferences >> Languages & Frameworks >> Go >> Go Libraries >> Project libraries 에 아래 경로 추가
경로 : Documents/go_workspace/src/k8s.io/kubernetes/Godeps/_workspace
[ Master Minion 서버에 모두 설치 ]
1. apt-get 으로 필요 s/w 설치
# docker 설치
$ sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
$ sudo vi /etc/apt/sources.list.d/docker.list
# Debian Jessie
deb https://apt.dockerproject.org/repo debian-jessie main
# Debian Stretch/Sid
deb https://apt.dockerproject.org/repo debian-stretch main
# Ubuntu Precise
deb https://apt.dockerproject.org/repo ubuntu-precise main
# Ubuntu Trusty (14.04 LTS)
deb https://apt.dockerproject.org/repo ubuntu-trusty main
# Ubuntu Utopic (14.10)
deb https://apt.dockerproject.org/repo ubuntu-utopic main
# Ubuntu Vivid (15.04)
deb https://apt.dockerproject.org/repo ubuntu-vivid main
# Ubuntu Wily (15.10)
deb https://apt.dockerproject.org/repo ubuntu-wily main
# Ubuntu Xenial (16.04)
deb https://apt.dockerproject.org/repo ubuntu-xenial main
$ sudo apt-get update
$ sudo apt-get purge lxc-docker*
$ sudo apt-get purge docker.io
$ sudo apt-get autoremove
$ sudo apt-get install docker-engine
$ sudo apt-get install bridge-utils
$ sudo apt-get install curl
$ sudo usermod -a -G docker stack # stack user에 docker 그룹을 추가
$ sudo systemctl start docker.service
2. go apt-get 설치
$ sudo apt-get install linux-libc-dev golang gcc
$ sudo apt-get install ansible
3. host 파일 등록 (모든 서버에, root 계정으로 수행)
# echo "192.168.75.129 kube-master
192.168.75.130 kube-node01" >> /etc/hosts
[ Kubernetes Master 설치 ]
4. etcd 설치
https://github.com/coreos/etcd/releases
$ curl -L https://github.com/coreos/etcd/releases/download/v2.2.2/etcd-v2.2.2-linux-amd64.tar.gz -o etcd-v2.2.2-linux-amd64.tar.gz
$ tar xzvf etcd-v2.2.2-linux-amd64.tar.gz
$ sudo cp -f etcd-v2.2.2-linux-amd64/etcd /usr/bin
$ sudo cp -f etcd-v2.2.2-linux-amd64/etcdctl /usr/bin
$ sudo mkdir -p /var/lib/etcd/member
$ sudo chmod -R 777 /var/lib/etcd
$ sudo vi /etc/network-environment
# The master's IPv4 address - reachable by the kubernetes nodes.
NODE_NAME=kube-master
MASTER_NAME=kube-master
NODE_NAME_01=kube-node01
$ sudo vi /lib/systemd/system/etcd.service
[Unit]
Description=etcd
After=network-online.service
[Service]
EnvironmentFile=/etc/network-environment # 혹은 /etc/default/etcd.conf
PermissionsStartOnly=true
ExecStart=/usr/bin/etcd \
--name ${NODE_NAME} \
--data-dir /var/lib/etcd \
--initial-advertise-peer-urls http://192.168.75.129:2380 \
--listen-peer-urls http://192.168.75.129:2380 \
--listen-client-urls http://192.168.75.129:2379,http://127.0.0.1:2379 \
--advertise-client-urls http://192.168.75.129:2379 \
--initial-cluster-token etcd-cluster-1 \
--initial-cluster ${MASTER_NAME}=http://kube-master:2380,${NODE_NAME_01}=http://kube-node01:2380 \
--initial-cluster-state new
Restart=always
RestartSec=10s
[Install]
WantedBy=multi-user.target
Alias=etcd.service
$ cd /lib/systemd/system
$ sudo chmod 775 etcd.service
$ sudo systemctl enable etcd.service
$ sudo systemctl daemon-reload # 파일 수정 후에는 reload 필요
$ sudo systemctl start etcd.service
$ etcdctl set /coreos.com/network/config "{\"Network\":\"172.16.0.0/16\"}"
$ etcdctl set /coreos.com/network/subnets/172.16.10.0-24 "{\"PublicIP\":\"192.168.75.129\"}"
$ etcdctl set /coreos.com/network/subnets/172.16.93.0-24 "{\"PublicIP\":\"192.168.75.130\"}"
$ etcdctl ls / # etcdctl ls --recursive (전체 다 보임)
/coreos.com/network/config
/coreos.com/network/subnets/172.16.10.0-24
/coreos.com/network/subnets/172.16.93.0-24
/registry
$ etcdctl get /coreos.com/network/config
{"Network":"172.16.0.0/16"}
$ etcdctl get /coreos.com/network/subnets/172.16.10.0-24 # Master의 flannel0 bridge ip
{"PublicIP":"192.168.75.129"}
$ etcdctl get /coreos.com/network/subnets/172.16.93.0-24 # Node01의 flannel0 bridge ip
{"PublicIP":"192.168.75.130"}
$ cd flannel
$ git checkout -b v0.5.4 tags/v0.5.4 # git checkout -b release-0.5.4 origin/release-0.5.4
$ ./build # bin 디렉토리가 생기면서 flanneld 실행파일이 빌드됨
$ sudo cp -f bin/flanneld /usr/bin/.
$ sudo netstat -tulpn | grep etcd # etcd 떠 있는 포트를 확인
$ sudo flanneld -etcd-endpoints=http://kube-master:4001 -v=0
$ cd /lib/systemd/system
$ sudo vi flanneld.service
[Unit]
Description=flanneld Service
After=etcd.service
Requires=etcd.service
[Service]
EnvironmentFile=/etc/network-environment
PermissionsStartOnly=true
User=root
ExecStart=/usr/bin/flanneld \
-etcd-endpoints http://localhost:4001,http://localhost:2379 \
-v=0
Restart=always
RestartSec=10s
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
Alias=flanneld.service
$ sudo systemctl enable flanneld.service
$ sudo systemctl start flanneld.service
6. Kubernetes API Server 설치
$ git clone https://github.com/GoogleCloudPlatform/kubernetes.git
$ cd kubernetes
$ git checkout -b release-1.1 origin/release-1.1
$ sudo make release
$ cd _output/release-tars
$ sudo tar zxvf kubernetes-server-linux-amd64.tar.gz
$ cd ~
$ git clone https://github.com/kubernetes/contrib.git
$ sudo cp -R ~/downloads/kubernetes/_output/* ~/downloads/contrib/ansible/roles/
$ cd ~/downloads/contrib/ansible/roles
$ sudo chown stack.stack -R *
$ vi ~/downloads/contrib/ansible/inventory
[masters]
kube-master
[etcd]
kube-master
[nodes]
kube-node01
$ sudo su -
# ssh-keygen
# for node in kube-master kube-node01; do
ssh-copy-id ${node}
done
# exit
$ vi ~/downloads/contrib/ansible/group_vars/all.yml
source_type: localBuild
cluster_name: cluster.local
ansible_ssh_user: root
kube_service_addresses: 10.254.0.0/16
networking: flannel
flannel_subnet: 172.16.0.0
flannel_prefix: 12
flannel_host_prefix: 24
cluster_logging: true
cluster_monitoring: true
kube-ui: true
dns_setup: true
dns_replicas: 1
$ cd ~/downloads/contrib/ansible
$ ./setup.sh
$ sudo cp kubernetes/server/bin/kube-apiserver /usr/bin
$ sudo cp kubernetes/server/bin/kube-controller-manager /usr/bin
$ sudo cp kubernetes/server/bin/kube-scheduler /usr/bin
$ sudo cp kubernetes/server/bin/kubectl /usr/bin
$ sudo cp kubernetes/server/bin/kubernetes /usr/bin
$ sudo mkdir -p /var/log/kubernetes
$ sudo chown -R stack.docker /var/log/kubernetes/
$ cd /lib/systemd/system
$ sudo vi kube-apiserver.service
[Unit]
Description=Kubernetes API Server
Documentation=https://github.com/GoogleCloudPlatform/kubernetes
Requires=etcd.service
After=etcd.service
[Service]
EnvironmentFile=/etc/network-environment
ExecStart=/usr/bin/kube-apiserver \
--api-rate=10 \
--bind-address=0.0.0.0 \
--etcd_servers=http://127.0.0.1:4001 \
--portal_net=10.254.0.0/16 \ # 어디서 쓰는 거지?
--insecure-bind-address=0.0.0.0 \
--log-dir=/var/log/kubernetes \
--logtostderr=true \
--kubelet_port=10250 \
--service_account_key_file=/tmp/kube-serviceaccount.key \
--service_account_lookup=false \
--service-cluster-ip-range=172.16.0.0/16 # flannel 과 연동해야 하나?
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
Alias=kube-apiserver.service
$ sudo systemctl enable kube-apiserver.service
$ sudo systemctl start kube-apiserver.service
$ sudo systemctl daemon-reload # 파일 수정 후에는 reload 필요
$ sudo systemctl restart kube-apiserver
6. Kubernetes Controller Manager 설치
$ cd /lib/systemd/system
$ sudo vi kube-controller-manager.service
[Unit]
Description=Kubernetes Controller Manager
Documentation=https://github.com/GoogleCloudPlatform/kubernetes
Requires=etcd.service
After=etcd.service
[Service]
ExecStart=/usr/bin/kube-controller-manager \
--address=0.0.0.0 \
--master=127.0.0.1:8080 \
--log-dir=/var/log/kubernetes \
--logtostderr=true
#--service_account_private_key_file=/tmp/kube-serviceaccount.key
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
Alias=kube-controller-manager.service
$ sudo systemctl enable kube-controller-manager.service
$ sudo systemctl start kube-controller-manager.service
$ sudo systemctl daemon-reload
$ sudo systemctl restart kube-controller-manager
7. Kubernetes Scheduler 설치
$ cd /lib/systemd/system
$ sudo vi kube-scheduler.service
[Unit]
Description=Kubernetes Scheduler
Documentation=https://github.com/GoogleCloudPlatform/kubernetes
Requires=etcd.service
After=etcd.service
[Service]
ExecStart=/usr/bin/kube-scheduler \
--master=127.0.0.1:8080 \
--log-dir=/var/log/kubernetes \
--logtostderr=true
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
Alias=kube-scheduler.service
$ sudo systemctl enable kube-scheduler.service
$ sudo systemctl start kube-scheduler.service
8. etcd 에 flannel 에서 사용할 ip range 등록 (flannel 을 node 에서 사용해야 필요함)
$ sudo etcdctl mk /coreos.com/network/config '{"Network":"172.17.0.0/16"}'
[ Service Cluster IP Range ]
10.0.0.0 - 10.255.255.255 (10/8 prefix)
172.16.0.0 - 172.31.255.255 (172.16/12 prefix)
192.168.0.0 - 192.168.255.255 (192.168/16 prefix)
[ Kubernetes Minion 설치 ]
4. etcd 설치
https://github.com/coreos/etcd/releases
$ curl -L https://github.com/coreos/etcd/releases/download/v2.2.2/etcd-v2.2.2-linux-amd64.tar.gz -o etcd-v2.2.2-linux-amd64.tar.gz
$ tar xzvf etcd-v2.2.2-linux-amd64.tar.gz
$ sudo cp -f etcd-v2.2.2-linux-amd64/etcd /usr/bin
$ sudo cp -f etcd-v2.2.2-linux-amd64/etcdctl /usr/bin
$ sudo mkdir -p /var/lib/etcd/member
$ sudo chmod -R 777 /var/lib/etcd
$ sudo vi /etc/network-environment
# The master's IPv4 address - reachable by the kubernetes nodes.
NODE_NAME=kube-node01
MASTER_NAME=kube-master
NODE_NAME_01=kube-node01
$ sudo vi /lib/systemd/system/etcd.service
[Unit]
Description=etcd
After=network-online.service
[Service]
EnvironmentFile=/etc/network-environment # 혹은 /etc/default/etcd.conf
PermissionsStartOnly=true
ExecStart=/usr/bin/etcd \
--name ${NODE_NAME} \
--data-dir /var/lib/etcd \
--initial-advertise-peer-urls http://192.168.75.130:2380 \
--listen-peer-urls http://192.168.75.130:2380 \
--listen-client-urls http://192.168.75.130:2379,http://127.0.0.1:2379 \
--advertise-client-urls http://192.168.75.130:2379 \
--initial-cluster-token etcd-cluster-1 \
--initial-cluster ${MASTER_NAME}=http://kube-master:2380,${NODE_NAME_01}=http://kube-node01:2380 \
--initial-cluster-state new
Restart=always
RestartSec=10s
[Install]
WantedBy=multi-user.target
Alias=etcd.service
$ cd /lib/systemd/system
$ sudo chmod 775 etcd.service
$ sudo systemctl enable etcd.service
$ sudo systemctl daemon-reload # 파일 수정 후에는 reload 필요
$ sudo systemctl start etcd.service
$ etcdctl member list
$ cd flannel
$ git checkout -b v0.5.5 tags/v0.5.5 # git checkout -b release-0.5.4 origin/release-0.5.4
$ ./build # bin 디렉토리가 생기면서 flanneld 실행파일이 빌드됨
$ sudo cp -f bin/flanneld /usr/bin/.
$ sudo netstat -tulpn | grep etcd # etcd 떠 있는 포트를 확인
$ sudo flanneld -etcd-endpoints=http://kube-node01:4001,http://kube-node01:2379 -v=0
$ cd /lib/systemd/system
$ sudo vi flanneld.service
[Unit]
Description=flanneld Service
After=etcd.service
Requires=etcd.service
[Service]
EnvironmentFile=/etc/network-environment
PermissionsStartOnly=true
User=root
ExecStart=/usr/bin/flanneld \
-etcd-endpoints http://kube-node01:4001,http://kube-node01:2379 \
-v=0
Restart=always
RestartSec=10s
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
Alias=flanneld.service
$ sudo systemctl enable flanneld.service
$ sudo systemctl start flanneld.service
8. Kubernetes Proxy 설치
$ git clone https://github.com/GoogleCloudPlatform/kubernetes.git
$ cd kubernetes
$ git checkout -b release-1.0 origin/release-1.0
$ sudo make release
$ cd _output/release-tars
$ sudo tar xvf kubernetes-server-linux-amd64.tar.gz
$ sudo cp kubernetes/server/bin/kube-proxy /usr/bin
$ sudo cp kubernetes/server/bin/kubelet /usr/bin
$ sudo cp kubernetes/server/bin/kubectl /usr/bin
$ sudo cp kubernetes/server/bin/kubernetes /usr/bin
$ sudo mkdir -p /var/log/kubernetes
$ sudo chown -R stack.docker /var/log/kubernetes/
$ cd /lib/systemd/system
$ sudo vi kube-proxy.service
[Unit]
Description=Kubernetes Proxy
Documentation=https://github.com/GoogleCloudPlatform/kubernetes
[Service]
ExecStart=/usr/bin/kube-proxy \
--master=http://kube-master:8080 \
--log-dir=/var/log/kubernetes \
--logtostderr=true \
--v=0 # debug 모드
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
Alias=kube-proxy.service
$ sudo systemctl enable kube-proxy.service
$ sudo systemctl start kube-proxy.service
9. Kubernetes Kubelet 설치
$ cd /lib/systemd/system
$ sudo vi kubelet.service
[Unit]
Description=Kubernetes Kubelet
Documentation=https://github.com/GoogleCloudPlatform/kubernetes
[Service]
ExecStart=/usr/bin/kubelet \
--address=0.0.0.0 \
--port=10250 \
--hostname_override=kube-minion \
--api_servers=http://kube-master:8080 \
--log-dir=/var/log/kubernetes \
--logtostderr=true \
--cluster_domain=cluster.local \
--v=0 # debug 모드
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
Alias=kubelet.service
$ sudo systemctl enable kubelet.service
$ sudo systemctl start kubelet.service
# docker 서비스 restart
$ cd flannel
$ git checkout -b v0.5.1 tags/v0.5.1 # git checkout -b release-0.5.4 origin/release-0.5.4
$ ./build # bin 디렉토리가 생기면서 flanneld 실행파일이 빌드됨
$ sudo cp -f bin/flanneld /usr/bin/.
$ sudo flanneld -etcd-endpoints=http://kube-master:4001 -v=0
10. 설치한 node 확인
$ sudo kubectl get nodes
NAME LABELS STATUS
192.168.75.202 kubernetes.io/hostname=192.168.75.202 NotReady
kube-minion kubernetes.io/hostname=kube-minion Ready
11. 서비스 올리기
# Master 서버
$ sudo systemctl start etcd.service
$ sudo systemctl start kube-apiserver.service
$ sudo systemctl start kube-controller-manager.service
$ sudo systemctl start kube-scheduler.service
# Minion 서버
$ sudo systemctl start kube-proxy.service
$ sudo systemctl start kubelet.service
12. mysql 서비스 올리기
$ mkdir pods
$ pods
$ vi mysql.yaml
apiVersion: v1
kind: Pod
metadata:
name: mysql
labels:
name: mysql
spec:
containers:
- resources:
limits :
cpu: 1
image: mysql
name: mysql
env:
- name: MYSQL_ROOT_PASSWORD
# change this
value: root
ports:
- containerPort: 3306
name: mysql
$ sudo kubectl create -f mysql.yaml
$ sudo kubectl get pods
$ vi mysql-service.yaml
apiVersion: v1
kind: Service
metadata:
labels:
name: mysql
name: mysql
spec:
publicIPs:
- 192.168.75.202
ports:
# the port that this service should serve on
- port: 3306
# label keys and values that must match in order to receive traffic for this service
selector:
name: mysql
$ sudo kubectl create -f mysql-service.yaml
$ sudo kubectl get services
**************************************************
***** juju 로 설치 (실패) ***********
**************************************************
1. juju 설치
$ sudo add-apt-repository ppa:juju/stable
$ sudo apt-get update
$ sudo apt-get install juju-core juju-quickstart
$ juju quickstart u/kubernetes/kubernetes-cluster
**************************************************
***** 여기는 참고 ***********
**************************************************
3. flannel 설치
$ git clone https://github.com/coreos/flannel.git
$ cd flannel
$ git checkout -b v0.5.1 tags/v0.5.1
$ ./build # bin 디렉토리가 생기면서 flanneld 실행파일이 빌드됨
$ cp bin/flanneld /opt/bin
4. etcd 설치
https://github.com/coreos/etcd/releases
$ curl -L https://github.com/coreos/etcd/releases/download/v2.1.1/etcd-v2.1.1-linux-amd64.tar.gz -o etcd-v2.1.1-linux-amd64.tar.gz
$ tar xzvf etcd-v2.1.1-linux-amd64.tar.gz
$ sudo cp etcd-v2.1.1-linux-amd64/bin/etcd* /opt/bin
$ cd /var/lib
$ sudo mkdir etcd
$ sudo chown stack.docker etcd
$ sudo mkdir /var/run/kubernetes
$ sudo chown stack.docker /var/run/kubernetes
$ sudo vi /etc/default/etcd
ETCD_NAME=default
ETCD_DATA_DIR="/var/lib/etcd/default.etcd"
ETCD_LISTEN_CLIENT_URLS="http://0.0.0.0:4001"
3. Kubernetes Master 설치
$ git clone https://github.com/GoogleCloudPlatform/kubernetes.git
$ cd kubernetes
$ git checkout -b release-1.0 origin/release-1.0
$ cd cluster/ubuntu/
$ ./build.sh # binaries 디렉토리로 다운로드 함
# Add binaries to /usr/bin
$ sudo cp -f binaries/master/* /usr/bin
$ sudo cp -f binaries/kubectl /usr/bin
$ wget https://github.com/Metaswitch/calico-kubernetes-ubuntu-demo/archive/master.tar.gz
$ tar -xvf master.tar.gz
$ sudo cp -f calico-kubernetes-ubuntu-demo-master/master/*.service /etc/systemd
$ cp calico-kubernetes-ubuntu-demo-master/node/network-environment-template network-environment
$ vi network-environment
#! /usr/bin/bash
# This node's IPv4 address
DEFAULT_IPV4=192.168.75.201
# The kubernetes master IP
KUBERNETES_MASTER=192.168.75.201
# Location of etcd cluster used by Calico. By default, this uses the etcd
# instance running on the Kubernetes Master
ETCD_AUTHORITY=192.168.75.201:4001
# The kubernetes-apiserver location - used by the calico plugin
KUBE_API_ROOT=https://192.168.75.201:443/api/v1/
$ sudo mv -f network-environment /etc
$ sudo systemctl enable /etc/systemd/etcd.service
$ sudo systemctl enable /etc/systemd/kube-apiserver.service
$ sudo systemctl enable /etc/systemd/kube-controller-manager.service
$ sudo systemctl enable /etc/systemd/kube-scheduler.service
$ sudo systemctl start etcd.service
$ sudo systemctl start kube-apiserver.service
$ sudo systemctl start kube-controller-manager.service
$ sudo systemctl start kube-scheduler.service
4. Kubernetes Minion 설치
$ git clone https://github.com/GoogleCloudPlatform/kubernetes.git
$ cd kubernetes
$ git checkout -b release-1.0 origin/release-1.0
$ cd cluster/ubuntu/
$ ./build.sh # binaries 디렉토리로 다운로드 함
# Add binaries to /usr/bin
$ sudo cp -f binaries/minion/* /usr/bin
$ wget https://github.com/Metaswitch/calico-kubernetes-ubuntu-demo/archive/master.tar.gz
$ tar -xvf master.tar.gz
$ sudo cp -f calico-kubernetes-ubuntu-demo-master/node/kube-proxy.service /etc/systemd
$ sudo cp -f calico-kubernetes-ubuntu-demo-master/node/kube-kubelet.service /etc/systemd
$ sudo systemctl enable /etc/systemd/kube-proxy.service
$ sudo systemctl enable /etc/systemd/kube-kubelet.service
$ cp calico-kubernetes-ubuntu-demo-master/node/network-environment-template network-environment
$ vi network-environment
#! /usr/bin/bash
# This node's IPv4 address
DEFAULT_IPV4=192.168.75.201
# The kubernetes master IP
KUBERNETES_MASTER=192.168.75.201
# Location of etcd cluster used by Calico. By default, this uses the etcd
# instance running on the Kubernetes Master
ETCD_AUTHORITY=192.168.75.201:4001
# The kubernetes-apiserver location - used by the calico plugin
KUBE_API_ROOT=https://192.168.75.201:443/api/v1/
$ sudo mv -f network-environment /etc
$ sudo systemctl start kube-proxy.service
$ sudo systemctl start kube-kubelet.service
4. kubernetes 설치
$ git clone https://github.com/GoogleCloudPlatform/kubernetes.git
$ cd kubernetes
$ git checkout -b release-1.0 origin/release-1.0
$ sudo make release
$ cd _output/release-tars
$ sudo chown -R stack.docker *
$ tar xvf kubernetes-server-linux-amd64.tar.gz
$ sudo su -
$ echo "192.168.75.201 kube-master
192.168.75.202 kube-minion" >> /etc/hosts
$ exit
5. kubernetes Master 설치
# kube-master 에 뜨는 서비스
etcd
flanneld
kube-apiserver
kube-controller-manager
kube-scheduler
$ cd ~/kubernetes/_output/release-tars/kubernetes
$ cp server/bin/kube-apiserver /opt/bin/
$ cp server/bin/kube-controller-manager /opt/bin/
$ cp server/bin/kube-scheduler /opt/bin/
$ cp server/bin/kubectl /opt/bin/
$ cp server/bin/kubernetes /opt/bin/
$ sudo cp kubernetes/cluster/ubuntu/master/init_conf/etcd.conf /etc/init/
$ sudo cp kubernetes/cluster/ubuntu/master/init_conf/kube-apiserver.conf /etc/init/
$ sudo cp kubernetes/cluster/ubuntu/master/init_conf/kube-controller-manager.conf /etc/init/
$ sudo cp kubernetes/cluster/ubuntu/master/init_conf/kube-scheduler.conf /etc/init/
$ sudo cp kubernetes/cluster/ubuntu/master/init_scripts/etcd /etc/init.d/
$ sudo cp kubernetes/cluster/ubuntu/master/init_scripts/kube-apiserver /etc/init.d/
$ sudo cp kubernetes/cluster/ubuntu/master/init_scripts/kube-controller-manager /etc/init.d/
$ sudo cp kubernetes/cluster/ubuntu/master/init_scripts/kube-scheduler /etc/init.d/
$ sudo vi /etc/default/kube-apiserver
KUBE_API_ADDRESS="--address=0.0.0.0"
KUBE_API_PORT="--port=8080"
KUBELET_PORT="--kubelet_port=10250"
KUBE_ETCD_SERVERS="--etcd_servers=http://127.0.0.1:4001"
KUBE_SERVICE_ADDRESSES="--portal_net=10.254.0.0/16"
KUBE_ADMISSION_CONTROL="--admission_control=NamespaceAutoProvision,LimitRanger,ResourceQuota"
KUBE_API_ARGS=""
$ sudo vi /etc/default/kube-controller-manager
KUBELET_ADDRESSES="--machines=192.168.75.202"
6. Minion 설치
# kube-minion 에 뜨는 서비스
flanneld
kubelet
kube-proxy
$ cd ~/kubernetes/_output/release-tars/kubernetes
$ sudo cp server/bin/kubelet /opt/bin/
$ sudo cp server/bin/kube-proxy /opt/bin/
$ sudo cp server/bin/kubectl /opt/bin/
$ sudo cp server/bin/kubernetes /opt/bin/
$ sudo cp kubernetes/cluster/ubuntu/minion/init_conf/kubelet.conf /etc/init
$ sudo cp kubernetes/cluster/ubuntu/minion/init_conf/kube-proxy.conf /etc/init
$ sudo cp kubernetes/cluster/ubuntu/minion/init_scripts/kubelet /etc/init.d/
$ sudo cp kubernetes/cluster/ubuntu/minion/init_scripts/kube-proxy /etc/init.d/
$ cd ~/kubernetes
$ vi cluster/ubuntu/config-default.sh
export nodes=${nodes:-"stack@192.168.75.201 stack@192.168.75.202"}
roles=${roles:-"ai i"}
export NUM_MINIONS=${NUM_MINIONS:-2}
export SERVICE_CLUSTER_IP_RANGE=${SERVICE_CLUSTER_IP_RANGE:-192.168.3.0/24}
export FLANNEL_NET=${FLANNEL_NET:-172.16.0.0/16}
$ cd cluster
$ KUBERNETES_PROVIDER=ubuntu ./kube-up.sh
3. go 소스 설치
https://golang.org/dl/
$ curl -L https://storage.googleapis.com/golang/go1.4.2.linux-amd64.tar.gz -o go1.4.2.linux-amd64.tar.gz
$ tar xvf go1.4.2.linux-amd64.tar.gz