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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Expand Up @@ -411,6 +411,9 @@ kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/mast
- `SolrCloud.spec.solrPodPolicy` has been **DEPRECATED** in favor of the `SolrCloud.spec.customSolrKubeOptions.podOptions` option.
This option is backwards compatible, but will be removed in a future version (`v0.3.0`).

- `SolrPrometheusExporter.spec.solrPodPolicy` has been **DEPRECATED** in favor of the `SolrPrometheusExporter.spec.customKubeOptions.podOptions` option.
This option is backwards compatible, but will be removed in a future version (`v0.3.0`).

#### v0.2.1
- The zkConnectionString used for provided zookeepers changed from using the string provided in the `ZkCluster.Status`, which used an IP, to using the service name. This will cause a rolling restart of your solrs using the provided zookeeper option, but there will be no data loss.

Expand Down
11 changes: 11 additions & 0 deletions api/v1beta1/common_types.go
Expand Up @@ -32,6 +32,17 @@ type StatefulSetOptions struct {
Labels map[string]string `json:"labels,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 {
Expand Down
4 changes: 2 additions & 2 deletions api/v1beta1/solrcloud_types.go
Expand Up @@ -204,11 +204,11 @@ type CustomSolrKubeOptions struct {
// +optional
NodeServiceOptions *ServiceOptions `json:"nodeServiceOptions,omitempty"`

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

// IngressOptions defines the custom options for solrCloud Ingress.
// IngressOptions defines the custom options for the solrCloud Ingress.
// +optional
IngressOptions *IngressOptions `json:"ingressOptions,omitempty"`
}
Expand Down
24 changes: 24 additions & 0 deletions api/v1beta1/solrprometheusexporter_types.go
Expand Up @@ -34,11 +34,17 @@ type SolrPrometheusExporterSpec struct {
// +optional
Image *ContainerImage `json:"image,omitempty"`

// DEPRECATED: Please use the options provided in customKubeOptions.podOptions
//
// Pod defines the policy to create pod for the SolrCloud.
// Updating the Pod does not take effect on any existing pods.
// +optional
PodPolicy SolrPodPolicy `json:"podPolicy,omitempty"`

// Provide custom options for kubernetes objects created for the SolrPrometheusExporter.
// +optional
CustomKubeOptions CustomExporterKubeOptions `json:"customKubeOptions,omitempty"`

// The entrypoint into the exporter. Defaults to the official docker-solr location.
// +optional
ExporterEntrypoint string `json:"exporterEntrypoint,omitempty"`
Expand Down Expand Up @@ -130,6 +136,24 @@ type StandaloneSolrReference struct {
Address string `json:"address"`
}

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

// SolrPrometheusExporterStatus defines the observed state of SolrPrometheusExporter
type SolrPrometheusExporterStatus struct {
// An address the prometheus exporter can be connected to from within the Kube cluster
Expand Down
65 changes: 65 additions & 0 deletions api/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions config/crd/bases/solr.bloomberg.com_solrclouds.yaml
Expand Up @@ -1260,8 +1260,8 @@ spec:
type: object
type: object
configMapOptions:
description: ServiceOptions defines the custom options for solrCloud
Services.
description: ServiceOptions defines the custom options for the solrCloud
ConfigMap.
properties:
annotations:
additionalProperties:
Expand Down Expand Up @@ -1290,7 +1290,7 @@ spec:
type: object
type: object
ingressOptions:
description: IngressOptions defines the custom options for solrCloud
description: IngressOptions defines the custom options for the solrCloud
Ingress.
properties:
annotations:
Expand Down