Skip to content

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"`
}

@HoustonPutman
Copy link
Contributor Author

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

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.

1 participant