123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- 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_elasticsearch_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_elasticsearch_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_elasticsearch_recover_after_time}}"
- -
- name: "IS_MASTER"
- value: "{% if deploy_type in ['data-master', 'master'] %}true{% else %}false{% endif %}"
- -
- name: "HAS_DATA"
- value: "{% if deploy_type in ['data-master', 'data-client'] %}true{% else %}false{% endif %}"
- 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
- {% if openshift_logging_elasticsearch_storage_type == 'pvc' %}
- persistentVolumeClaim:
- claimName: {{ openshift_logging_elasticsearch_pvc_name }}
- {% elif openshift_logging_elasticsearch_storage_type == 'hostmount' %}
- hostPath:
- path: {{ openshift_logging_elasticsearch_hostmount_path }}
- {% else %}
- emptydir: {}
- {% endif %}
|