Skip to content

Commit

Permalink
Improvements related to elasticsearch. Made it better :-)
Browse files Browse the repository at this point in the history
  • Loading branch information
geosp committed Oct 4, 2020
1 parent 6c7c43a commit 4a480c4
Show file tree
Hide file tree
Showing 13 changed files with 49,577 additions and 93 deletions.
19 changes: 10 additions & 9 deletions elk/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,19 @@ microk8s kubectl config set-context --current --namespace=elk
microk8s kubectl apply -f ../shared-storageclass.yaml
microk8s kubectl apply -f logstash-persistentvolume.yaml
microk8s kubectl apply -f logstash-persistentvolumeclaim.yaml
microk8s kubectl apply -f logstash-deployment.yaml
microk8s kubectl expose deployment logstash --type=LoadBalancer --name=logstash
microk8s kubectl apply -f logstash-claim0-persistentvolumeclaim.yaml
microk8s kubectl apply -f logstash-claim1-persistentvolumeclaim.yaml
microk8s kubectl apply -f elasticsearch-data-persistentvolume.yaml
microk8s kubectl apply -f elasticsearch-data-persistentvolumeclaim.yaml
microk8s kubectl apply -f elasticsearch-hunspell-persistentvolume.yaml
microk8s kubectl apply -f elasticsearch-hunspell-persistentvolumeclaim.yaml
microk8s kubectl create configmap elasticsearch-config --from-file=elasticsearch/elasticsearch.yml
microk8s kubectl apply -f elasticsearch-deployment.yaml
microk8s kubectl apply -f elasticsearch-replicaset.yaml
microk8s kubectl apply -f logstash-deployment.yaml
microk8s kubectl apply -f kibana-deployment.yaml
microk8s kubectl expose deployment logstash --type=LoadBalancer --name=logstash
microk8s kubectl expose deployment kibana --type=LoadBalancer --name=kibana
microk8s kubectl expose replicaset elasticsearch --type=LoadBalancer --name=elasticsearch
microk8s kubectl expose deployment elasticsearch --type=LoadBalancer --name=elasticsearch
logstashSettingsPath=$(getVolumePath 'logstash-pv-claim')
logstashConfigurationPath=$(getVolumePath 'logstash-pv-claim')
echo "Copying configuration to path: ${logstashConfigurationPath}"
cp -r ./logstash/custom.conf $logstashConfigurationPath
echo "Copying configuration to path: ${logstashSettingsPath}"
cp -r ./logstash/custom.conf $logstashSettingsPath
echo "Copying settings to path: ${logstashSettingsPath}"
cp -r ./logstash/logstash.yml $logstashSettingsPath
14 changes: 14 additions & 0 deletions elk/elasticsearch-data-persistentvolume.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: elasticsearch-data-pv-volume
labels:
type: local
spec:
storageClassName: shared-storage
capacity:
storage: 10Gi
accessModes:
- ReadWriteOnce
hostPath:
path: /storage/data/elasticsearch/data
11 changes: 11 additions & 0 deletions elk/elasticsearch-data-persistentvolumeclaim.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: elasticsearch-data-pv-claim
spec:
storageClassName: shared-storage
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 3Gi
26 changes: 20 additions & 6 deletions elk/elasticsearch-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ metadata:
annotations:
kompose.cmd: kompose convert
kompose.version: 1.21.0 (992df58d8)
creationTimestamp: null
labels:
io.kompose.service: elasticsearch
name: elasticsearch
spec:
replicas: 0
replicas: 1
selector:
matchLabels:
io.kompose.service: elasticsearch
Expand All @@ -19,7 +18,6 @@ spec:
annotations:
kompose.cmd: kompose convert
kompose.version: 1.21.0 (992df58d8)
creationTimestamp: null
labels:
io.kompose.network/elk.net: "true"
io.kompose.service: elasticsearch
Expand All @@ -30,8 +28,6 @@ spec:
value: -Xms1000m -Xmx1000m
- name: bootstrap.memory_lock
value: "true"
- name: cluster.name
value: docker-cluster
- name: discovery.type
value: single-node
- name: xpack.monitoring.enabled
Expand All @@ -53,9 +49,27 @@ spec:
ports:
- containerPort: 9200
resources: {}
volumeMounts:
- mountPath: /usr/share/elasticsearch/data
name: elasticsearch-data-pv-claim
- mountPath: /usr/share/elasticsearch/config/hunspell
name: elasticsearch-hunspell-pv-claim
- mountPath: /usr/share/elasticsearch/config/elasticsearch.yml
name: elasticsearch-config
subPath: elasticsearch.yml
readOnly: true
volumes:
- name: elasticsearch-data-pv-claim
persistentVolumeClaim:
claimName: elasticsearch-data-pv-claim
- name: elasticsearch-hunspell-pv-claim
persistentVolumeClaim:
claimName: elasticsearch-hunspell-pv-claim
- name: elasticsearch-config
configMap:
name: elasticsearch-config
restartPolicy: Always
serviceAccountName: ""
volumes: null
nodeSelector:
kubernetes.io/hostname: ubuntu01
status: {}
14 changes: 14 additions & 0 deletions elk/elasticsearch-hunspell-persistentvolume.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: elasticsearch-hunspell-pv-volume
labels:
type: local
spec:
storageClassName: shared-storage
capacity:
storage: 10Gi
accessModes:
- ReadWriteOnce
hostPath:
path: /storage/data/elasticsearch/config/hunspell
11 changes: 11 additions & 0 deletions elk/elasticsearch-hunspell-persistentvolumeclaim.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: elasticsearch-hunspell-pv-claim
spec:
storageClassName: shared-storage
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 3Gi
72 changes: 0 additions & 72 deletions elk/elasticsearch-replicaset.yaml

This file was deleted.

3 changes: 3 additions & 0 deletions elk/elasticsearch/elasticsearch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
cluster.name: "mxes-cluster"
network.host: 0.0.0.0
indices.analysis.hunspell.dictionary.lazy: false
Loading

0 comments on commit 4a480c4

Please sign in to comment.