Skip to content

Instantly share code, notes, and snippets.

@uhhc
Forked from dovys/elastic.yaml
Created November 2, 2020 06:20
Show Gist options
  • Select an option

  • Save uhhc/7923d597b630a0ffde3763f756bce28e to your computer and use it in GitHub Desktop.

Select an option

Save uhhc/7923d597b630a0ffde3763f756bce28e to your computer and use it in GitHub Desktop.

Revisions

  1. @dovys dovys created this gist Nov 18, 2017.
    62 changes: 62 additions & 0 deletions elastic.yaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,62 @@
    apiVersion: v1
    kind: ConfigMap
    metadata:
    labels:
    product: k8s-elastic
    name: elastic-config
    data:
    elasticsearch.yaml: |
    discovery.type: single-node
    ---
    apiVersion: extensions/v1beta1
    kind: Deployment
    metadata:
    name: elasticsearch
    spec:
    selector:
    matchLabels:
    run: elasticsearch
    template:
    metadata:
    labels:
    name: elasticsearch
    run: elasticsearch
    spec:
    initContainers:
    - name: set-vm-sync-limit
    image: busybox
    imagePullPolicy: IfNotPresent
    command: ["sysctl", "-w", "vm.max_map_count=262144"]
    securityContext:
    privileged: true
    containers:
    - image: docker.elastic.co/elasticsearch/elasticsearch:6.0.0
    name: elasticsearch
    imagePullPolicy: IfNotPresent
    ports:
    - containerPort: 9200
    protocol: TCP
    volumeMounts:
    - name: elastic-config
    mountPath: /etc/elasticsearch/elasticsearch.yaml
    subPath: elasticsearch.yaml
    volumes:
    - name: elastic-config
    configMap:
    name: elastic-config
    ---
    apiVersion: v1
    kind: Service
    metadata:
    name: elasticsearch
    labels:
    run: elasticsearch
    spec:
    ports:
    - port: 9200
    targetPort: 9200
    protocol: TCP
    selector:
    run: elasticsearch
    type: LoadBalancer