Elasticsearch OSS Image and X-Pack Plugin

Hi All,

I am trying to deploy following Elasticsearch OSS image and facing issue while using x-pack security. Is there any possibility that this plugin can be deployed explicitly ? Thanks

"docker.elastic.co/elasticsearch/elasticsearch-oss:7.10.1"

`stacktrace": ["org.elasticsearch.bootstrap.StartupException: java.lang.IllegalArgumentException: unknown setting [xpack.security.enabled] please check that any required plugins are installed, or check the breaking changes documentation for removed settings",
    "at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:174) ~[elasticsearch-7.10.1.jar:7.10.1]",
    "at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:161) ~[elasticsearch-7.10.1.jar:7.10.1]",
    "at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-7.10.1.jar:7.10.1]",
    "at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:127) ~[elasticsearch-cli-7.10.1.jar:7.10.1]",
    "at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-7.10.1.jar:7.10.1]",
    "at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:126) ~[elasticsearch-7.10.1.jar:7.10.1]",
    "at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) ~[elasticsearch-7.10.1.jar:7.10.1]",`

What does your Elasticsearch config look like?

The OSS distribution does not include x-pack so you need to use the default distribution if you want security.

1 Like

Something like this

    apiVersion: v1
    kind: ConfigMap
    metadata:
      name: elasticsearch-master-config
      labels:
        heritage: "Helm"
        chart: "elasticsearch"
        app: "elasticsearch-master"
    data:
      elasticsearch.yml: |
        xpack.security.enabled: true

    ---

    apiVersion: apps/v1
    kind: StatefulSet
    metadata:
      name: elasticsearch-master
      labels:
        heritage: "Helm"
        chart: "elasticsearch"
        app: "elasticsearch-master"
      annotations:
        esMajorVersion: "7"
    spec:
      serviceName: elasticsearch-master-headless
      selector:
        matchLabels:
          app: "elasticsearch-master"
      replicas: 3
      podManagementPolicy: Parallel
      updateStrategy:
        type: RollingUpdate
      volumeClaimTemplates:
      - metadata:
          name: elasticsearch-master
        spec:
          accessModes:
          - ReadWriteOnce
          resources:
            requests:
              storage: 2Gi
      template:
        metadata:
          name: "elasticsearch-master"
          labels:
            chart: "elasticsearch"
            app: "elasticsearch-master"

        spec:

          volumes:

            - name: esconfig
              configMap:
                name: elasticsearch-master-config

          containers:
          - name: "elasticsearch"
            image: "docker.elastic.co/elasticsearch/elasticsearch-oss:7.10.1"
            imagePullPolicy: "Always"
            ports:
            - name: http
              containerPort: 9200
            - name: transport
              containerPort: 9300
            resources:
              limits:
                cpu: 500m
                memory: 512m
              requests:
                cpu: 500m
                memory: 512m
            env:
              - name: node.name
                valueFrom:
                  fieldRef:
                    fieldPath: metadata.name
              - name: cluster.initial_master_nodes
                value: "elasticsearch-master-0,elasticsearch-master-1,elasticsearch-master-2,"
              - name: discovery.seed_hosts
                value: "elasticsearch-master-headless"
              - name: cluster.name
                value: "elasticsearch"
              - name: network.host
                value: "0.0.0.0"
              - name: ES_JAVA_OPTS
                value: "-Xms512m -Xmx512m"
              - name: node.data
                value: "true"
              - name: node.ingest
                value: "true"
              - name: node.master
                value: "true"
              - name: node.remote_cluster_client
                value: "true"
              - name: ELASTIC_PASSWORD
                value: "xxxxxxxxxxx"
              - name: ELASTIC_USERNAME
                value: elastic
            volumeMounts:
              - name: "elasticsearch-master"
                mountPath: /usr/share/elasticsearch/data

              - name: esconfig
                mountPath: /usr/share/elasticsearch/config/elasticsearch.yml
                subPath: elasticsearch.yml
    ---

Thanks. Is there any other way we can achieve this ?

As Christian pointed out, you need to use the default distribution if you want this.

1 Like

Thanks a lot @warkolm . Is there any other way we can achieve this via deploying this plugin explicitly ?

Nope.

Ok. Thanks a lot @warkolm

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.