reinit with flannel
This commit is contained in:
parent
693e361821
commit
a420e03ef3
|
|
@ -1,23 +1,57 @@
|
||||||
# Bootstrap
|
# Bootstrap
|
||||||
|
|
||||||
The following lines document hwo to initalize a fresh cluster. On a real cluster, or using Vagrant. It therefore assumes to clone kubespray to this folder. It will be excluded in *.gitignore* and all files are in this folder.
|
The following lines document how to initalize a fresh cluster. On a real cluster, or using Vagrant. It therefore assumes to clone kubespray to this folder. It will be excluded in *.gitignore* and all files are in this folder.
|
||||||
|
|
||||||
|
## Vagrant
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
git clone https://github.com/kubernetes-sigs/kubespray.git
|
./init.sh
|
||||||
#git clone git@github.com:iptizer/kubespray.git
|
|
||||||
./init_kubespray.sh
|
|
||||||
cd kubespray
|
cd kubespray
|
||||||
vagrant up
|
vagrant up
|
||||||
# up and abkle to ssh
|
# up and abkle to ssh
|
||||||
vagrant ssh k8s-1
|
vagrant ssh k8s-1
|
||||||
```
|
```
|
||||||
|
|
||||||
TODO 16.02.2020: Vagrant up works but no k8s is installed. Maybe due to wrong ansible playbook or because from here on kubespray should kick in
|
## Prod
|
||||||
|
|
||||||
## Done steps
|
Prepare server:
|
||||||
|
|
||||||
The following steps have been done while first setup and are not required to be redone:
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
cp ./kubespray/Vagrantfile .
|
ssh centos@<ip>
|
||||||
|
# auth via pw
|
||||||
|
sudo su - root
|
||||||
|
adduser moritz
|
||||||
|
visudo # add as sudo user
|
||||||
|
sudo yum -y install vim python3
|
||||||
|
ssh-keygen
|
||||||
|
vim .ssh/authorized_users # paste key
|
||||||
|
chmod 644 .ssh/authorized_users
|
||||||
|
# check whether login works with ssh key
|
||||||
|
sudo vim /etc/ssh/sshd_config # remove pw auth & root login
|
||||||
|
sudo yum upgrade -y && sudo reboot
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Install Kubernetes:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ ./init.sh
|
||||||
|
$ # follow instructions from output, sth like:
|
||||||
|
$ cd kubespray │nginx-ingress-default-backend-5b967cf596-sk7p7 1/1 Running 0 22h
|
||||||
|
$ ansible-playbook -i inventory/prod/inventory.ini cluster.yml
|
||||||
|
```
|
||||||
|
|
||||||
|
And get credentials:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
ssh <ip>
|
||||||
|
sudo su - root
|
||||||
|
cd
|
||||||
|
cp -r .kube /home/moritz/
|
||||||
|
chown -R moritz. /home/moritz/.kube
|
||||||
|
#ctrl + d
|
||||||
|
kubectl get ns # test connection
|
||||||
|
#ctrl + d
|
||||||
|
scp haumdaucher.de:/home/moritz/.kube/config .kube/config
|
||||||
|
```
|
||||||
|
|
||||||
|
Foreward in k8s-directory.
|
||||||
|
|
@ -40,6 +40,5 @@ echo "## Preparing real prod environment"
|
||||||
cp -r kubespray/inventory/sample kubespray/inventory/prod
|
cp -r kubespray/inventory/sample kubespray/inventory/prod
|
||||||
rm kubespray/inventory/prod/inventory.ini
|
rm kubespray/inventory/prod/inventory.ini
|
||||||
cp ./prod.ini kubespray/inventory/prod/inventory.ini
|
cp ./prod.ini kubespray/inventory/prod/inventory.ini
|
||||||
echo "to deploy execute:"
|
gsed -i "s/kube_network_plugin: .*/kube_network_plugin: flannel/" ./kubespray/inventory/prod/group_vars/k8s-cluster/k8s-cluster.yml
|
||||||
echo "$ cd kubespray"
|
gsed -i "s/metrics_server_enabled: .*/metrics_server_enabled: true/" ./kubespray/inventory/prod/group_vars/k8s-cluster/addons.yml
|
||||||
echo "$ ansible-playbook -i inventory/prod/inventory.ini cluster.yml"
|
|
||||||
Loading…
Reference in New Issue