pokusio / k3s-topgun

The best I can do with k3s
0 stars 0 forks source link

K3S_RESILIENCY #6

Open Jean-Baptiste-Lasselle opened 4 years ago

Jean-Baptiste-Lasselle commented 4 years ago

This is coherent with what Kubernetes recommends in HA : etcd must be a clusterized one, for resiliency

Jean-Baptiste-Lasselle commented 4 years ago
git clone https://github.com/dwilbraham/docker-compose-etcd
cd docker-compose-etcd/
git clone https://github.com/henszey/etcd-browser/ etcd-browser/
dcoker-compose up -d

etcd_all="{$(bin/service_address.sh etcd0 2379),$(bin/service_address.sh etcd1 2379),$(bin/service_address.sh etcd2 2379)}" curl $etcd_all/v2/keys curl $etcd_all/v2/stats/leader

* then I have : 

```bash
~/docker-compose-etcd$ docker ps -a
CONTAINER ID        IMAGE                              COMMAND                  CREATED              STATUS              PORTS                               NAMES
e09a9d2a0a62        docker-compose-etcd_etcd-browser   "nodejs server.js"       About a minute ago   Up About a minute   0.0.0.0:32771->8000/tcp             docker-compose-etcd_etcd-browser_1
de95c862f160        quay.io/coreos/etcd                "/usr/local/bin/etcd…"   About a minute ago   Up About a minute   2380/tcp, 0.0.0.0:32770->2379/tcp   docker-compose-etcd_etcd2_1
3e601e6829c5        quay.io/coreos/etcd                "/usr/local/bin/etcd…"   About a minute ago   Up About a minute   2380/tcp, 0.0.0.0:32768->2379/tcp   docker-compose-etcd_etcd1_1
2d6cb298369c        quay.io/coreos/etcd                "/usr/local/bin/etcd…"   About a minute ago   Up About a minute   2380/tcp, 0.0.0.0:32769->2379/tcp   docker-compose-etcd_etcd0_1

[1/3]: localhost:32769/v2/keys --> --curl--localhost:32769/v2/keys {"action":"get","node":{"dir":true,"nodes":[{"key":"/foo","value":"bar","modifiedIndex":8,"createdIndex":8}]}}

[2/3]: localhost:32768/v2/keys --> --curl--localhost:32768/v2/keys {"action":"get","node":{"dir":true,"nodes":[{"key":"/foo","value":"bar","modifiedIndex":8,"createdIndex":8}]}}

[3/3]: localhost:32770/v2/keys --> --curl--localhost:32770/v2/keys {"action":"get","node":{"dir":true,"nodes":[{"key":"/foo","value":"bar","modifiedIndex":8,"createdIndex":8}]}} jbl@poste-devops-jbl-16gbram:~/docker-compose-etcd$ jbl@poste-devops-jbl-16gbram:~/docker-compose-etcd$ curl $etcd_all/v2/stats/leader

[1/3]: localhost:32769/v2/stats/leader --> --curl--localhost:32769/v2/stats/leader {"message":"not current leader"} [2/3]: localhost:32768/v2/stats/leader --> --curl--localhost:32768/v2/stats/leader {"leader":"ade526d28b1f92f7","followers":{"cf1d15c5d194b5c9":{"latency":{"current":0.003147,"average":0.006053428571428571,"standardDeviation":0.005520999000107108,"minimum":0.001863,"maximum":0.017602},"counts":{"fail":0,"success":7}},"d282ac2ce600c1ce":{"latency":{"current":0.002747,"average":0.0036824285714285717,"standardDeviation":0.002598938566697833,"minimum":0.001163,"maximum":0.009535},"counts":{"fail":0,"success":7}}}} [3/3]: localhost:32770/v2/stats/leader --> --curl--localhost:32770/v2/stats/leader {"message":"not current leader"}jbl@poste-devops-jbl-16gbram:~/docker-compose-etcd$ jbl@poste-devops-jbl-16gbram:~/docker-compose-etcd$

Jean-Baptiste-Lasselle commented 4 years ago

next step : https://rancher.com/docs/k3s/latest/en/installation/ha/