solr-operator icon indicating copy to clipboard operation
solr-operator copied to clipboard

Adding Kubernetes Node labels to Solr nodes. (WIP)

Open HoustonPutman opened this issue 4 years ago • 3 comments

Issue number of the reported bug or feature request: Resolves #53

Describe your changes This PR adds Kubernetes Node labels as sysProps for Solr Nodes, thus allowing for them to be used within Solr autoscaling policies.

Kubernetes Node labels are added in the following steps:

  1. In an initContainer, the Kubernetes API is queried to get the information for the node the pod resides on.
  2. jq is used to parse this information and generate a sh script to update $SOLR_OPTS to contain -d<kube-node-label>=<value>.
  3. This bash file is shared via a volume between the initContainer and the solr container.
  4. Solr is provided this sh script via the $SOLR_INCLUDES envVar. This is an option that Solr reads when it starts up.
  5. When Solr starts, the SOLR_OPTS will contain the -D options that specify all of the Kubernetes node labels.

Testing performed Tested locally.

This is a WIP and the feature has not been finalized yet.

HoustonPutman avatar Mar 05 '20 17:03 HoustonPutman

Any update?

AceHack avatar Apr 01 '20 21:04 AceHack

No update other than it worked in my tests. We probably want to add this as an optional feature, at least at first. I can probably do some work on it next week or the next one.

I wanted to get some feedback before moving forward with it

HoustonPutman avatar Apr 03 '20 16:04 HoustonPutman

I'm going to try and get #95 merged in, then cut the v0.2.4 release. After that I'll try to get this merged, as it's quite a large change to how Solr is "run".

HoustonPutman avatar Apr 09 '20 18:04 HoustonPutman