pires / kubernetes-elasticsearch-cluster

Elasticsearch cluster on top of Kubernetes made easy.
Apache License 2.0
1.51k stars 690 forks source link

ConfigMap example #58

Open shaneog opened 7 years ago

shaneog commented 7 years ago

I've just set up this with a ConfigMap so as to be able to add more settings than permitted in the default configuration. Would you like a PR to add an example of this to the repo?

pires commented 7 years ago

That would be cool.

pires commented 7 years ago

@puja108 another one for you, maybe? 👍

puja108 commented 7 years ago

Yeah, I was also thinking of making the ES config a Config Map.

@shaneog ping me if you do a PR

pires commented 7 years ago

@puja108 want to own this?

puja108 commented 7 years ago

@pires I can take it. Was looking through the yamls to see how to slice the Config Maps. There's two options:

First option is easier and maybe adds clarity. Second option removes redundancy and reduces the chance to have typos in e.g. cluster names. WDYT?

pires commented 7 years ago

@puja108 the second one as it will make things easier for me when implementing the operator.

dev-e commented 7 years ago

Hi! I am trying to set up with a ConfigMap and instantly getting the error:

2017-08-17 15:04:56,039 main ERROR Could not register mbeans java.security.AccessControlException: access denied ("javax.management.MBeanTrustPermission" "register") at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472) at java.lang.SecurityManager.checkPermission(SecurityManager.java:585) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.checkMBeanTrustPermission(DefaultMBeanServerInterceptor.java:1848) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:322) at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:522) at org.apache.logging.log4j.core.jmx.Server.register(Server.java:389) at org.apache.logging.log4j.core.jmx.Server.reregisterMBeansAfterReconfigure(Server.java:167) at org.apache.logging.log4j.core.jmx.Server.reregisterMBeansAfterReconfigure(Server.java:140) at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:556) at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:261) at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:206) at org.apache.logging.log4j.core.config.Configurator.initialize(Configurator.java:221) at org.apache.logging.log4j.core.config.Configurator.initialize(Configurator.java:197) at org.elasticsearch.common.logging.LogConfigurator.configureStatusLogger(LogConfigurator.java:175) at org.elasticsearch.common.logging.LogConfigurator.configureWithoutConfig(LogConfigurator.java:99) at org.elasticsearch.cli.Command.main(Command.java:85) at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91) at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84) Exception in thread "main" java.lang.IllegalStateException: status logger logged an error before logging was configured at org.elasticsearch.common.logging.LogConfigurator.checkErrorListener(LogConfigurator.java:128) at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:117) at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:316) at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:123) at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:114) at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:67) at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:122) at org.elasticsearch.cli.Command.main(Command.java:88) at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91) at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84) Refer to the log for complete error details.

Part of elasticsearch RC:

        volumeMounts:
        - name: data
          mountPath: /usr/share/elasticsearch/data
        - name: config
          mountPath: /usr/share/elasticsearch/config
      volumes:
      - name: data
        persistentVolumeClaim:
          claimName: elasticsearch-data
      - name: config
        configMap:
          name: elasticsearch
          defaultMode: 0777
➜ kubectl describe configmap elasticsearch 
Name:       elasticsearch
Namespace:  default
Labels:     <none>
Annotations:    <none>

Data
====
elasticsearch.yml:
----
cluster.name: "k8s-cluster"
network.host: 0.0.0.0

# minimum_master_nodes need to be explicitly set when bound on a public IP
# set to 1 to allow single node clusters
# Details: https://github.com/elastic/elasticsearch/pull/17288
discovery.zen.minimum_master_nodes: 1
Events: <none>