Skip to content

Commit

Permalink
[digital ocean] Separate elasticsearch related deployment configurati…
Browse files Browse the repository at this point in the history
…on into different files
  • Loading branch information
welbon committed Dec 9, 2024
1 parent 0df6e41 commit c14e367
Show file tree
Hide file tree
Showing 6 changed files with 103 additions and 58 deletions.
16 changes: 16 additions & 0 deletions kube/elasticsearch/elasticsearch-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Elasticsearch Configuration
apiVersion: v1
kind: ConfigMap
metadata:
name: elasticsearch-config
data:
elasticsearch.yml: |
xpack.security.enabled: true
xpack.license.self_generated.type: basic
network.host: 0.0.0.0
path.repo: ["/data/es_snapshot_repository"]
s3.client.default.endpoint: "s3.ap-northeast-1.amazonaws.com"
s3.client.default.protocol: https
s3.client.default.read_timeout: 50s
s3.client.default.max_retries: 3
s3.client.default.use_throttle_retries: true
Original file line number Diff line number Diff line change
Expand Up @@ -90,61 +90,4 @@ spec:
configMap:
name: elasticsearch-config
# - name: s3-mount-point
# emptyDir: {}

---
# Elasticsearch Configuration
apiVersion: v1
kind: ConfigMap
metadata:
name: elasticsearch-config
data:
elasticsearch.yml: |
xpack.security.enabled: true
xpack.license.self_generated.type: basic
network.host: 0.0.0.0
path.repo: ["/data/es_snapshot_repository"]
s3.client.default.endpoint: "s3.ap-northeast-1.amazonaws.com"
s3.client.default.protocol: https
s3.client.default.read_timeout: 50s
s3.client.default.max_retries: 3
s3.client.default.use_throttle_retries: true
---
# Elasticsearch Persistent Volume Claim
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: es-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 500Gi
storageClassName: do-block-storage-retain

---
# Elasticsearch Snapshot Repository Persistent Volume Claim
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: es-backup-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 500Gi
storageClassName: do-block-storage-retain

---
# Elasticsearch Service
apiVersion: v1
kind: Service
metadata:
name: elasticsearch
spec:
ports:
- port: 9200
selector:
app: elasticsearch
# emptyDir: {}
21 changes: 21 additions & 0 deletions kube/elasticsearch/elasticsearch-pv-snapshot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# The PV of ElasticSearch is created with the following configuration

# VolumeSnapshotClass
apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshotClass
metadata:
name: do-snapshot-class
driver: dobs.csi.digitalocean.com
deletionPolicy: Retain

---

# VolumeSnapshot
apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshot
metadata:
name: es-pv-snapshot
spec:
volumeSnapshotClassName: do-snapshot-class
source:
persistentVolumeClaimName: es-pvc
11 changes: 11 additions & 0 deletions kube/elasticsearch/elasticsearch-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
# Elasticsearch Service
apiVersion: v1
kind: Service
metadata:
name: elasticsearch
spec:
ports:
- port: 9200
selector:
app: elasticsearch
28 changes: 28 additions & 0 deletions kube/elasticsearch/elasticsearch-storage-snapshot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# elasticsearch-snapshot-pv.yaml
apiVersion: v1
kind: PersistentVolume
metadata:
name: es-snapshot-pv
spec:
capacity:
storage: 1Ti
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
storageClassName: do-block-storage-retain
hostPath:
path: /data/elasticsearch-snapshots

---
# elasticsearch-snapshot-pvc.yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: es-snapshot-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Ti
storageClassName: do-block-storage-retain
26 changes: 26 additions & 0 deletions kube/elasticsearch/elasticsearch-storage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Elasticsearch Persistent Volume Claim
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: es-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 500Gi
storageClassName: do-block-storage-retain

---
# Elasticsearch Snapshot Repository Persistent Volume Claim
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: es-backup-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 500Gi
storageClassName: do-block-storage-retain

0 comments on commit c14e367

Please sign in to comment.