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 custom kube options for PrometheusExporter. #83

Merged
merged 6 commits into from Feb 27, 2020

Conversation

HoustonPutman
Copy link
Contributor

Issue number of the reported bug or feature request: #82

Describe your changes
Adding the ability for users to customize options for the Service, Deployment, ConfigMap and Pods used by the SolrPrometheusExporter.

Testing performed
Many unit tests have been added. Manual testing will also be done.

New Configurations
This configuration can be found at SolrPrometheusExporter.Spec.customKubeOptions:

type CustomExporterKubeOptions struct {
	// SolrPodOptions defines the custom options for the solrPrometheusExporter pods.
	// +optional
	PodOptions *PodOptions `json:"podOptions,omitempty"`

	// DeploymentOptions defines the custom options for the solrPrometheusExporter Deployment.
	// +optional
	DeploymentOptions *DeploymentOptions `json:"deploymentOptions,omitempty"`

	// ServiceOptions defines the custom options for the solrPrometheusExporter Service.
	// +optional
	ServiceOptions *ServiceOptions `json:"serviceOptions,omitempty"`

	// ServiceOptions defines the custom options for the solrPrometheusExporter ConfigMap.
	// +optional
	ConfigMapOptions *ConfigMapOptions `json:"configMapOptions,omitempty"`
}

// DeploymentOptions defines custom options for Deployments
type DeploymentOptions struct {
	// Annotations to be added for the Deployment.
	// +optional
	Annotations map[string]string `json:"annotations,omitempty"`

	// Labels to be added for the Deployment.
	// +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"`
}

// ServiceOptions defines custom options for services
type ServiceOptions struct {
	// Annotations to be added for the Service.
	// +optional
	Annotations map[string]string `json:"annotations,omitempty"`

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

// ConfigMapOptions defines custom options for configMaps
type ConfigMapOptions struct {
	// Annotations to be added for the ConfigMap.
	// +optional
	Annotations map[string]string `json:"annotations,omitempty"`

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

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

Still need to add unit tests for the other podOptions (non-annotation/label)

Signed-off-by: Houston Putman <houstonputman@gmail.com>
Signed-off-by: Houston Putman <houstonputman@gmail.com>
Signed-off-by: Houston Putman <houstonputman@gmail.com>
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

1 participant