kubernetes-elasticsearch-cluster icon indicating copy to clipboard operation
kubernetes-elasticsearch-cluster copied to clipboard

ConfigMap example

Open shaneog opened this issue 9 years ago • 7 comments

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?

shaneog avatar Oct 09 '16 18:10 shaneog

That would be cool.

pires avatar Oct 09 '16 19:10 pires

@puja108 another one for you, maybe? 👍

pires avatar Nov 22 '16 11:11 pires

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

@shaneog ping me if you do a PR

puja108 avatar Nov 22 '16 12:11 puja108

@puja108 want to own this?

pires avatar Jan 10 '17 10:01 pires

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

  • 1 for each deployment (master, data, client)
  • 1 shared one (with cluster name etc in it) + 1 additional for the differences in envs for each deployment

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?

puja108 avatar Jan 11 '17 08:01 puja108

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

pires avatar Jan 11 '17 09:01 pires

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>

dev-e avatar Aug 17 '17 15:08 dev-e