rivernews / iriversland2-kubernetes

Terraform provisioning K8 infra for iriversland2, my personal website, as well as other projects.
0 stars 1 forks source link

Deploy & host elasticsearch service to support app use #9

Closed rivernews closed 4 years ago

rivernews commented 5 years ago

Items

A branch elastic-stack is created for this issue.

Target resources

Reference

rivernews commented 5 years ago

Provisioning Elasticsearch instance

Kickstart

. ./my-kubectl.sh logs  elasticsearch-master-0 -n kube-system -c file-permissions
chown: /usr/share/elasticsearch/data/lost+found: Operation not permitted
chown: /usr/share/elasticsearch/data/lost+found: Operation not permitted
chown: /usr/share/elasticsearch/data: Operation not permitted
chown: /usr/share/elasticsearch/data: Operation not permitted
chown: /usr/share/elasticsearch/: Operation not permitted
chown: /usr/share/elasticsearch/: Operation not permitted

// describe the pod elasticsearch-master-0 -n kube-system
file-permissions:
  Command:
      chown
      -R
      1000:1000
      /usr/share/elasticsearch/
python release.py -f

. ./my-kubectl.sh get pods --namespace=kube-system -l app=elasticsearch-master -w
# see if the pod can go through the initial containers successfully, if not, try to figure out why
. ./my-kubectl.sh logs  elasticsearch-master-0 -n kube-system -c file-permissions
# then start over by following below code

python release.py -d -t helm_release.elasticsearch
. ./my-helm.sh delete elasticsearch-release
. ./my-helm.sh  del --purge elasticsearch-release
. ./my-kubectl.sh delete   pvc -n kube-system  elasticsearch-master-elasticsearch-master-0
rivernews commented 4 years ago

Provisioning Kibana

Issue We observed that Kibana has been in READY 0/1 for a very long time (more than 6 minutes), yet no error has been surfaced. Inspecting the pod's log shows that it is installing a 3rd plugin.

Cause Potentially due to computation resources running low and gets super slow. The memory usage in DO dashboard shows a 91% load.

Solution or Next Step Decreasing the Kibana resources request might do, or enlarging DO K8 cluster's resource.

Debug workflow

python release.py -f

. ./my-kubectl.sh get pods --namespace=kube-system -l app=kibana -w
# see if the pod can go through the initial containers successfully, if not, try to figure out why
. ./my-kubectl.sh logs --follow  <kibana pod name> -n kube-system
# then start over by following below code

# start over
python release.py -d -t helm_release.kibana
. ./my-helm.sh delete kibana-release
. ./my-helm.sh  del --purge kibana-release
python release.py -f

Debug log


A lot of things happened here.

sh-4.2$ curl -v http://elasticsearch-master:9200
* About to connect() to elasticsearch-master port 9200 (#0)
*   Trying 10.245.114.47...

* Connection timed out
* Failed connect to elasticsearch-master:9200; Connection timed out
* Closing connection 0