ELASTICSEARCH, KIBANA, FILEBEAT INSTALLATION ON KUBERNETES

tarafından
227
ELASTICSEARCH, KIBANA, FILEBEAT INSTALLATION ON KUBERNETES

You can get a lot of information about site title, in this url. And Elasticsearch, Kibana and Filebeat installation will explain under this topic.To do this you should follow steps below.

ELASTICSEARCH INSTALLATION

Step1:
Create mount folder under the your specific worker node and then create pv and pvc kubernetes resources.  This installation tried the which has a one worker node cluster. And I created the new mount folder under the worker node.  If you have mulltiple worker node you must create mount folder under the on each node. This way not good for pratically. You can use the node selector to run your application under the sepecific node. 

mkdir -p /opt/elasticsearch/es01 /opt/elasticsearch/es01
vim elkpvpvc.yaml
apiVersion: v1
kind: PersistentVolume
metadata:
  name: es01pv
  labels:
    type: local
spec:
  capacity:
    storage: 1Gi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: "/opt/elasticsearch/es01"
--- 
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: es01pvc
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi
--- 
apiVersion: v1
kind: PersistentVolume
metadata:
  name: es02pv
  labels:
    type: local
spec:
  capacity:
    storage: 1Gi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: "/opt/elasticsearch/es02"
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: es02pvc
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi
kubectl create -f elkpvpvc.yaml

Step2:
Create service yaml file to access the elasticsearch nodes.

vim elksvc.yaml
apiVersion: v1
kind: Service
metadata:
  name: es01
  labels:
    app: es01
spec:
  ports:
  - name: rest
    port: 9200
    protocol: TCP
  - name: internode
    port: 9300
    protocol: TCP
  selector:
    app: es01 
  type: NodePort
---
apiVersion: v1
kind: Service
metadata:
  name: es02
  labels:
    app: es02
spec:
  ports:
  - name: rest
    port: 9200
    protocol: TCP
  selector:
    app: es01 
  type: NodePort
kubectl create -f elksvc.yaml