Skip to content

Commit 48f6329

Browse files
Adding custom kube options for PrometheusExporter. (#83)
1 parent 5b380dc commit 48f6329

15 files changed

+5143
-225
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,9 @@ kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/mast
411411
- `SolrCloud.spec.solrPodPolicy` has been **DEPRECATED** in favor of the `SolrCloud.spec.customSolrKubeOptions.podOptions` option.
412412
This option is backwards compatible, but will be removed in a future version (`v0.3.0`).
413413

414+
- `SolrPrometheusExporter.spec.solrPodPolicy` has been **DEPRECATED** in favor of the `SolrPrometheusExporter.spec.customKubeOptions.podOptions` option.
415+
This option is backwards compatible, but will be removed in a future version (`v0.3.0`).
416+
414417
#### v0.2.1
415418
- 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.
416419

api/v1beta1/common_types.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,17 @@ type StatefulSetOptions struct {
3232
Labels map[string]string `json:"labels,omitempty"`
3333
}
3434

35+
// DeploymentOptions defines custom options for Deployments
36+
type DeploymentOptions struct {
37+
// Annotations to be added for the Deployment.
38+
// +optional
39+
Annotations map[string]string `json:"annotations,omitempty"`
40+
41+
// Labels to be added for the Deployment.
42+
// +optional
43+
Labels map[string]string `json:"labels,omitempty"`
44+
}
45+
3546
// PodOptions defines the common pod configuration for Pods, including when used
3647
// in deployments, stateful-sets, etc.
3748
type PodOptions struct {

api/v1beta1/solrcloud_types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,11 @@ type CustomSolrKubeOptions struct {
204204
// +optional
205205
NodeServiceOptions *ServiceOptions `json:"nodeServiceOptions,omitempty"`
206206

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

211-
// IngressOptions defines the custom options for solrCloud Ingress.
211+
// IngressOptions defines the custom options for the solrCloud Ingress.
212212
// +optional
213213
IngressOptions *IngressOptions `json:"ingressOptions,omitempty"`
214214
}

api/v1beta1/solrprometheusexporter_types.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,17 @@ type SolrPrometheusExporterSpec struct {
3434
// +optional
3535
Image *ContainerImage `json:"image,omitempty"`
3636

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

44+
// Provide custom options for kubernetes objects created for the SolrPrometheusExporter.
45+
// +optional
46+
CustomKubeOptions CustomExporterKubeOptions `json:"customKubeOptions,omitempty"`
47+
4248
// The entrypoint into the exporter. Defaults to the official docker-solr location.
4349
// +optional
4450
ExporterEntrypoint string `json:"exporterEntrypoint,omitempty"`
@@ -130,6 +136,24 @@ type StandaloneSolrReference struct {
130136
Address string `json:"address"`
131137
}
132138

139+
type CustomExporterKubeOptions struct {
140+
// SolrPodOptions defines the custom options for the solrPrometheusExporter pods.
141+
// +optional
142+
PodOptions *PodOptions `json:"podOptions,omitempty"`
143+
144+
// DeploymentOptions defines the custom options for the solrPrometheusExporter Deployment.
145+
// +optional
146+
DeploymentOptions *DeploymentOptions `json:"deploymentOptions,omitempty"`
147+
148+
// ServiceOptions defines the custom options for the solrPrometheusExporter Service.
149+
// +optional
150+
ServiceOptions *ServiceOptions `json:"serviceOptions,omitempty"`
151+
152+
// ServiceOptions defines the custom options for the solrPrometheusExporter ConfigMap.
153+
// +optional
154+
ConfigMapOptions *ConfigMapOptions `json:"configMapOptions,omitempty"`
155+
}
156+
133157
// SolrPrometheusExporterStatus defines the observed state of SolrPrometheusExporter
134158
type SolrPrometheusExporterStatus struct {
135159
// An address the prometheus exporter can be connected to from within the Kube cluster

api/v1beta1/zz_generated.deepcopy.go

Lines changed: 65 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/solr.bloomberg.com_solrclouds.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,8 +1260,8 @@ spec:
12601260
type: object
12611261
type: object
12621262
configMapOptions:
1263-
description: ServiceOptions defines the custom options for solrCloud
1264-
Services.
1263+
description: ServiceOptions defines the custom options for the solrCloud
1264+
ConfigMap.
12651265
properties:
12661266
annotations:
12671267
additionalProperties:
@@ -1290,7 +1290,7 @@ spec:
12901290
type: object
12911291
type: object
12921292
ingressOptions:
1293-
description: IngressOptions defines the custom options for solrCloud
1293+
description: IngressOptions defines the custom options for the solrCloud
12941294
Ingress.
12951295
properties:
12961296
annotations:

0 commit comments

Comments
 (0)