Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Solr StatefulSet/Pod custom options #74

Merged
merged 8 commits into from
Feb 18, 2020

Conversation

HoustonPutman
Copy link
Contributor

Addresses feature requests in: #63, #55

Describe your changes
Adding many configuration options for the Solr StatefulSet and Pods.

These options are flexible and should be able to be easily extended in the future for new options.

Options being added:

// StatefulSetOptions defines custom options for StatefulSets
type StatefulSetOptions struct {
	// Annotations to be added for the solrCloud Services.
	// +optional
	Annotations map[string]string `json:"annotations,omitempty"`

	// Labels to be added for the solrCloud Services.
	// +optional
	Labels map[string]string `json:"labels,omitempty"`
}

// PodOptions defines the common pod configuration for Pods, including when used
// in deployments, stateful-sets, etc.
type PodOptions struct {
	// The scheduling constraints on pods.
	// +optional
	Affinity *corev1.Affinity `json:"affinity,omitempty"`

	// Resources is the resource requirements for the container.
	// This field cannot be updated once the cluster is created.
	// +optional
	Resources corev1.ResourceRequirements `json:"resources,omitempty"`

	// Additional non-data volumes to load into the default container.
	// +optional
	Volumes []AdditionalVolume `json:"volumes,omitempty"`

	// PodSecurityContext is the security context for the pod.
	// +optional
	PodSecurityContext *corev1.PodSecurityContext `json:"podSecurityContext,omitempty"`

	// Additional environment variables to pass to the default container.
	// +optional
	EnvVariables []corev1.EnvVar `json:"envVars,omitempty"`

	// Annotations to be added for pods.
	// +optional
	Annotations map[string]string `json:"annotations,omitempty"`

	// Labels to be added for pods.
	// +optional
	Labels map[string]string `json:"labels,omitempty"`
}

Deprecation

Because of this change, we are moving Spec.solrPodOptions to a new location: Spec.customSolrKubeOptions.podOptions. The old location will still be available until the release of v0.3.0

@HoustonPutman
Copy link
Contributor Author

Still need to add unit tests for the non label/annotation options. But the label/annotation options are well tested.

HoustonPutman and others added 4 commits February 14, 2020 16:08
Signed-off-by: Houston Putman <hputman1@bloomberg.net>
Signed-off-by: Houston Putman <houstonputman@gmail.com>
Signed-off-by: Houston Putman <houstonputman@gmail.com>
Signed-off-by: Houston Putman <houstonputman@gmail.com>
@sepulworld
Copy link
Contributor

Awesome!!

Signed-off-by: Houston Putman <houstonputman@gmail.com>
Signed-off-by: Houston Putman <houstonputman@gmail.com>
Signed-off-by: Houston Putman <houstonputman@gmail.com>
@HoustonPutman
Copy link
Contributor Author

I tested this locally and it worked fairly well for me

Signed-off-by: Houston Putman <houstonputman@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants