Skip to content

Commit

Permalink
Adding custom kube options for PrometheusExporter. (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
HoustonPutman authored Feb 27, 2020
1 parent 5b380dc commit 48f6329
Show file tree
Hide file tree
Showing 15 changed files with 5,143 additions and 225 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Loading

0 comments on commit 48f6329

Please sign in to comment.