-
Notifications
You must be signed in to change notification settings - Fork 2.3k
/
Copy pathes.j2
106 lines (106 loc) · 3.19 KB
/
es.j2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
apiVersion: "v1"
kind: "DeploymentConfig"
metadata:
name: "{{deploy_name}}"
labels:
provider: openshift
component: "{{component}}"
deployment: "{{deploy_name}}"
logging-infra: "{{logging_component}}"
spec:
replicas: {{replicas|default(0)}}
selector:
provider: openshift
component: "{{component}}"
deployment: "{{deploy_name}}"
logging-infra: "{{logging_component}}"
strategy:
type: Recreate
template:
metadata:
name: "{{deploy_name}}"
labels:
logging-infra: "{{logging_component}}"
provider: openshift
component: "{{component}}"
deployment: "{{deploy_name}}"
spec:
terminationGracePeriod: 600
serviceAccountName: aggregated-logging-elasticsearch
securityContext:
supplementalGroups:
- {{openshift_logging_es_storage_group}}
{% if es_node_selector is iterable and es_node_selector | length > 0 %}
nodeSelector:
{% for key, value in es_node_selector.iteritems() %}
{{key}}: "{{value}}"
{% endfor %}
{% endif %}
containers:
-
name: "elasticsearch"
image: {{image}}
imagePullPolicy: Always
resources:
limits:
memory: "{{es_memory_limit}}"
{% if es_cpu_limit is defined and es_cpu_limit is not none %}
cpu: "{{es_cpu_limit}}"
{% endif %}
requests:
memory: "512Mi"
ports:
-
containerPort: 9200
name: "restapi"
-
containerPort: 9300
name: "cluster"
env:
-
name: "NAMESPACE"
valueFrom:
fieldRef:
fieldPath: metadata.namespace
-
name: "KUBERNETES_TRUST_CERT"
value: "true"
-
name: "SERVICE_DNS"
value: "logging-{{es_cluster_name}}-cluster"
-
name: "CLUSTER_NAME"
value: "logging-{{es_cluster_name}}"
-
name: "INSTANCE_RAM"
value: "{{openshift_logging_es_memory_limit}}"
-
name: "NODE_QUORUM"
value: "{{es_node_quorum | int}}"
-
name: "RECOVER_AFTER_NODES"
value: "{{es_recover_after_nodes}}"
-
name: "RECOVER_EXPECTED_NODES"
value: "{{es_recover_expected_nodes}}"
-
name: "RECOVER_AFTER_TIME"
value: "{{openshift_logging_es_recover_after_time}}"
volumeMounts:
- name: elasticsearch
mountPath: /etc/elasticsearch/secret
readOnly: true
- name: elasticsearch-config
mountPath: /usr/share/java/elasticsearch/config
readOnly: true
- name: elasticsearch-storage
mountPath: /elasticsearch/persistent
volumes:
- name: elasticsearch
secret:
secretName: logging-elasticsearch
- name: elasticsearch-config
configMap:
name: logging-elasticsearch
- name: elasticsearch-storage
{% include 'es-storage-'+ es_storage['kind'] + '.partial' %}