-
Notifications
You must be signed in to change notification settings - Fork 27
/
k8s_run_old
executable file
·91 lines (66 loc) · 2.25 KB
/
k8s_run_old
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/bash
ANSIBLE_INVENTORY="ansible/inventory/hosts"
PRIVATE_KEY="~/.ssh/id_rsa"
echo "Configure Ansible"
export ANSIBLE_HOST_KEY_CHECKING=False
# 1. DOCKER
echo "Install Docker"
ansible-playbook -i $ANSIBLE_INVENTORY --private-key $PRIVATE_KEY ansible/installDocker.yaml
#wget https://dl.k8s.io/v1.8.5/kubernetes.tar.gz
#tar -zxvf kubernetes.tar.gz
#./kubernetes/cluster/get-kube-binaries.sh
# TODO: RUN KUBERNETES WITH KUBEADM AND COPY CONFIGURATION FOR SYSTEMD
#Tip: One possible starting point is to setup a cluster using an existing Getting Started Guide. After getting a cluster running,
# you can then copy the init.d scripts or systemd unit files from that cluster, and then modify them for use on your custom cluster.
#etcd
export ETCD_VERSION=3.0.17
export ETCD_IMAGE=gcr.io/google-containers/etcd:$ETCD_VERSION
docker run --detach \
--name=etcd \
--net=host \
-p 8080:8080 \
$ETCD_IMAGE \
etcd \
--data-dir=/var/etcd/data
export HYPERKUBE_VERSION=1.8.5
export HYPERKUBE_IMAGE=gcr.io/google-containers/hyperkube:$HYPERKUBE_VERSION
#docker run -d \
# --net=host \
# gcr.io/google_containers/etcd:2.0.9 \
# /usr/local/bin/etcd \
# --addr=127.0.0.1:4001 \
# --bind-addr=0.0.0.0:4001 \
# --data-dir=/var/etcd/data
#kubelet - all
#????
#curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
#sudo apt-get-repository "deb http://apt.kubernetes.io/ kubernetes-xenial main"
#sudo apt update
#sudo apt install -y kubelet
docker run --detach \
--net=container:etcd \
--name=kubelet \
gcr.io/google_containers/hyperkube:v1.8.5 \
/kubelet \
--kube-config=~/kubelet.conf
#kube-proxy - all
????
#kube-apiserver - master
docker run --detach \
--net=container:etcd \
--name=apiserver \
$HYPERKUBE_IMAGE \
/apiserver \
--etcd-servers=http://10.240.0.21:2379 \
--service-cluster-ip-range=10.0.0.1/24 \
--insecure-bind-address=0.0.0.0 \
--insecure-port=8080 \
--admission-control=AlwaysAdmit
#kube-controller-manager - master
docker run --detach \
--net=container:etcd \
--name=controller-manager \
$HYPERKUBE_IMAGE \
/controller-manager \
--master=10.240.0.21:8080
#kube-scheduler - master