74 lines
1.7 KiB
YAML
74 lines
1.7 KiB
YAML
|
|
apiVersion: apps/v1
|
||
|
|
kind: Deployment
|
||
|
|
metadata:
|
||
|
|
name: elasticsearch
|
||
|
|
namespace: default
|
||
|
|
labels:
|
||
|
|
app: elasticsearch
|
||
|
|
spec:
|
||
|
|
replicas: 1
|
||
|
|
selector:
|
||
|
|
matchLabels:
|
||
|
|
app: elasticsearch
|
||
|
|
template:
|
||
|
|
metadata:
|
||
|
|
labels:
|
||
|
|
app: elasticsearch
|
||
|
|
spec:
|
||
|
|
nodeSelector:
|
||
|
|
node-role.kubernetes.io/control-plane: "true"
|
||
|
|
containers:
|
||
|
|
- name: elasticsearch
|
||
|
|
image: registry.t-aaron.com/elasticsearch:7.9.0
|
||
|
|
ports:
|
||
|
|
- containerPort: 9200
|
||
|
|
name: http
|
||
|
|
- containerPort: 9300
|
||
|
|
name: transport
|
||
|
|
env:
|
||
|
|
- name: discovery.type
|
||
|
|
value: "single-node"
|
||
|
|
- name: bootstrap.memory_lock
|
||
|
|
value: "true"
|
||
|
|
- name: TZ
|
||
|
|
value: "Asia/Shanghai"
|
||
|
|
- name: "ES_JAVA_OPTS"
|
||
|
|
value: "-Xms512m -Xmx512m"
|
||
|
|
resources:
|
||
|
|
requests:
|
||
|
|
memory: "1Gi"
|
||
|
|
cpu: "500m"
|
||
|
|
limits:
|
||
|
|
memory: "2Gi"
|
||
|
|
cpu: "1000m"
|
||
|
|
livenessProbe:
|
||
|
|
httpGet:
|
||
|
|
path: /_cluster/health
|
||
|
|
port: 9200
|
||
|
|
initialDelaySeconds: 30
|
||
|
|
periodSeconds: 30
|
||
|
|
timeoutSeconds: 10
|
||
|
|
failureThreshold: 3
|
||
|
|
readinessProbe:
|
||
|
|
httpGet:
|
||
|
|
path: /_cluster/health
|
||
|
|
port: 9200
|
||
|
|
initialDelaySeconds: 10
|
||
|
|
periodSeconds: 30
|
||
|
|
timeoutSeconds: 10
|
||
|
|
failureThreshold: 3
|
||
|
|
securityContext:
|
||
|
|
capabilities:
|
||
|
|
add:
|
||
|
|
- IPC_LOCK
|
||
|
|
volumeMounts:
|
||
|
|
- name: data
|
||
|
|
mountPath: /usr/share/elasticsearch/data
|
||
|
|
volumes:
|
||
|
|
- name: data
|
||
|
|
hostPath:
|
||
|
|
path: /opt/elasticsearch
|
||
|
|
type: DirectoryOrCreate
|
||
|
|
securityContext:
|
||
|
|
fsGroup: 1000
|