-
Notifications
You must be signed in to change notification settings - Fork 4
/
cloud-provider-vm.txt
84 lines (65 loc) · 3.13 KB
/
cloud-provider-vm.txt
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
* Install openstack using devstack
* create ubuntu16.04 image in glance
https://computingforgeeks.com/adding-images-openstack-glance/
* Create security groups
* launch instance with private n/w and associate a floating IP
* launch instance with ubuntu 16.04 image creating a keypair
* login the openstack vm with keypair
ssh -i my-key.pem ubuntu@172.24.4.5
# Prepare vm to install kubernetes and cloud provider openstack
* Install go
wget https://dl.google.com/go/go1.10.3.linux-amd64.tar.gz
sudo tar -xvf go1.10.3.linux-amd64.tar.gz
sudo mv go /usr/local/
* Edit the /etc/environment file
GOPATH=/home/ubuntu/go
PATH=/usr/local/go/bin:/home/ubuntu/go/bin
* Install docker
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
sudo apt-key fingerprint 0EBFCD88
sudo apt-get update
sudo apt-get install docker-ce
sudo usermod -aG docker $USER
sed -i '/^ExecStart=\/usr\/bin\/dockerd$/ s/$/ --exec-opt native.cgroupdriver=systemd/' /lib/systemd/system/docker.service
sudo systemctl daemon-reload
sudo systemctl enable docker
sudo systemctl start docker
* Install make, git, gcc, dep
sudo apt-get install git gcc make python-pip
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
* mkdir /home/ubuntu/go/src
mkdir /home/ubuntu/go/src/k8s.io
cd /home/ubuntu/go/src/k8s.io/
git clone https://github.com/adisky/cloud-provider-openstack.git
git clone https://github.com/kubernetes/kubernetes
* Install etcd
curl -L https://github.com/coreos/etcd/releases/download/v3.3.1/etcd-v3.3.1-linux-amd64.tar.gz -o etcd-v3.3.1-linux amd64.tar.gz
tar xzvf etcd-v3.3.1-linux-amd64.tar.gz
cd etcd-v3.3.1-linux-amd64
sudo cp etcd /usr/local/bin/
sudo cp etcdctl /usr/local/bin/
etcd --version
* exports
export EXTERNAL_CLOUD_PROVIDER_BINARY=$GOPATH/src/k8s.io/cloud-provider-openstack/openstack-cloud-controller-manager
export API_HOST_IP=$(ip route get 1.1.1.1 | awk '{print $7}')
export KUBELET_HOST="0.0.0.0"
export ALLOW_SECURITY_CONTEXT=true
export ENABLE_CRI=false
export ENABLE_HOSTPATH_PROVISIONER=true
export ENABLE_SINGLE_CA_SIGNER=true
export KUBE_ENABLE_CLUSTER_DNS=false
export LOG_LEVEL=4
export CLOUD_PROVIDER=openstack
export EXTERNAL_CLOUD_PROVIDER=true
export CLOUD_CONFIG=/etc/kubernetes/cloud-config
export ALLOW_PRIVILEGED=true
export ENABLE_DAEMON=true
export HOSTNAME_OVERRIDE=$(hostname)
export FEATURE_GATES="CSIPersistentVolume=true,MountPropagation=true"root@myvm:/home/ubuntu/go/src/k8s.io/kubernetes#
export RUNTIME_CONFIG="storage.k8s.io/v1alpha1=true"
export KUBERNETES_PROVIDER=local
cluster/kubectl.sh config set-cluster local --server=https://localhost:6443 --certificate-authority=/var/run/kubernetes/server-ca.crt
cluster/kubectl.sh config set-credentials myself --client-key=/var/run/kubernetes/client-admin.key --client-certificate=/var/run/kubernetes/client-admin.crt
cluster/kubectl.sh config set-context local --cluster=local --user=myself
cluster/kubectl.sh config use-context local
cluster/kubectl.sh