Adding Kubernetes Node labels to Solr nodes. (WIP) #90
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
initContainer
, the Kubernetes API is queried to get the information for the node the pod resides on.jq
is used to parse this information and generate a sh script to update$SOLR_OPTS
to contain-d<kube-node-label>=<value>
.$SOLR_INCLUDES
envVar. This is an option that Solr reads when it starts up.-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.