Current state
This commit is contained in:
+40
-4
@@ -2,10 +2,15 @@
|
||||
|
||||
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.
|
||||
|
||||
Use [kubespray tag](https://github.com/kubernetes-sigs/kubespray/releases) as parameter
|
||||
|
||||
```sh
|
||||
./init.sh "release-2.12"
|
||||
```
|
||||
|
||||
## Vagrant
|
||||
|
||||
```sh
|
||||
./init.sh
|
||||
cd kubespray
|
||||
vagrant up
|
||||
# up and abkle to ssh
|
||||
@@ -22,10 +27,11 @@ ssh centos@<ip>
|
||||
sudo su - root
|
||||
adduser moritz
|
||||
visudo # add as sudo user
|
||||
su - moritz
|
||||
sudo yum -y install vim python3
|
||||
ssh-keygen
|
||||
vim .ssh/authorized_users # paste key
|
||||
chmod 644 .ssh/authorized_users
|
||||
chmod 644 .ssh/authorized_keys
|
||||
# check whether login works with ssh key
|
||||
sudo vim /etc/ssh/sshd_config # remove pw auth & root login
|
||||
sudo yum upgrade -y && sudo reboot
|
||||
@@ -37,7 +43,7 @@ Install Kubernetes:
|
||||
$ ./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
|
||||
$ ansible-playbook -i inventory/prod/inventory.ini cluster.yml
|
||||
```
|
||||
|
||||
And get credentials:
|
||||
@@ -54,4 +60,34 @@ kubectl get ns # test connection
|
||||
scp haumdaucher.de:/home/moritz/.kube/config .kube/config
|
||||
```
|
||||
|
||||
Foreward in k8s-directory.
|
||||
Foreward in k8s-directory.
|
||||
|
||||
## Upgrade cluster
|
||||
|
||||
Check the current default value of `kube_version` in cloned repository.
|
||||
|
||||
```sh
|
||||
cd kubespray
|
||||
ansible-playbook -i inventory/prod/inventory.ini -e kube_version=v1.16.8 -e upgrade_cluster_setup=true cluster.yml
|
||||
```
|
||||
|
||||
History:
|
||||
|
||||
* 2020-04-18 kube_version=v1.16.8 kubespray_branch=release-2.12
|
||||
|
||||
## Add node
|
||||
|
||||
See [documentation](https://github.com/kubernetes-sigs/kubespray/blob/master/docs/nodes.md).
|
||||
|
||||
Note: This was more or less a trial and error approach. Running different playbooks over and over again got it right at some point.
|
||||
|
||||
```sh
|
||||
ansible-playbook -i inventory/prod/inventory.ini --limit=ns3088070.ip-37-59-40.eu,ns3100058.ip-37-59-61.eu scale.yml
|
||||
ansible-playbook -i inventory/prod/inventory.ini --limit=etcd,kube-master -e ignore_assert_errors=yes cluster.yml
|
||||
```
|
||||
|
||||
This runs everything and is kind of idempotent:
|
||||
|
||||
```sh
|
||||
ansible-playbook -i inventory/prod/inventory.ini cluster.yml
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user