You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by ho...@apache.org on 2021/04/07 19:53:19 UTC

[solr-operator] branch main updated: Add more pod options in the Solr Operator helm chart. (#250)

This is an automated email from the ASF dual-hosted git repository.

houston pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr-operator.git


The following commit(s) were added to refs/heads/main by this push:
     new c750710  Add more pod options in the Solr Operator helm chart. (#250)
c750710 is described below

commit c75071009982d135098b7b5552e12dd5093cf2e4
Author: Houston Putman <ho...@apache.org>
AuthorDate: Wed Apr 7 15:51:34 2021 -0400

    Add more pod options in the Solr Operator helm chart. (#250)
    
    This adds the following options in the Solr Operator helm chart:
    - labels
    - annotations
    - nodeSelector
    - affinity
    - tolerations
    - priorityClassName
    - sidecarContainers
    
    The Solr Operator container resources also no longer have a default value.
---
 .gitignore                                   |  1 +
 helm/solr-operator/README.md                 | 21 +++++++++++++--------
 helm/solr-operator/templates/deployment.yaml | 27 ++++++++++++++++++++++++---
 helm/solr-operator/values.yaml               | 19 ++++++++++---------
 4 files changed, 48 insertions(+), 20 deletions(-)

diff --git a/.gitignore b/.gitignore
index f816073..d8162d7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,6 +7,7 @@
 *.dylib
 bin
 release-artifacts
+.DS_Store
 
 # Test binary, build with `go test -c`
 *.test
diff --git a/helm/solr-operator/README.md b/helm/solr-operator/README.md
index 82af33c..49f4573 100644
--- a/helm/solr-operator/README.md
+++ b/helm/solr-operator/README.md
@@ -168,14 +168,19 @@ The command removes all the Kubernetes components associated with the chart and
 | image.pullPolicy | string | `"IfNotPresent"` |  |
 | fullnameOverride | string | `""` | A custom name for the Solr Operator Deployment |
 | nameOverride | string | `""` |  |
-| replicaCount | int | `1` | The number of Solr Operator pods to run |
-| resources.limits.cpu | string | `"400m"` |  |
-| resources.limits.memory | string | `"500Mi"` |  |
-| resources.requests.cpu | string | `"100m"` |  |
-| resources.requests.memory | string | `"100Mi"` |  |
-| rbac.create | boolean | true | Create the necessary RBAC rules, whether cluster-wide or namespaced, for the Solr Operator. |
-| serviceAccount.create | boolean | true | Create a serviceAccount to be used for this operator. This serviceAccount will be given the permissions specified in the operator's RBAC rules. |
-| serviceAccount.name | string | "" | If `serviceAccount.create` is set to `false`, the name of an existing serviceAccount in the target namespace **must** be provided to run the Solr Operator with. This serviceAccount with be given the operator's RBAC rules. | 
+| replicaCount | int | `1` | The number of Solr Operator pods to run
+| rbac.create | boolean | `true` | Create the necessary RBAC rules, whether cluster-wide or namespaced, for the Solr Operator. |
+| serviceAccount.create | boolean | `true` | Create a serviceAccount to be used for this operator. This serviceAccount will be given the permissions specified in the operator's RBAC rules. |
+| serviceAccount.name | string | `""` | If `serviceAccount.create` is set to `false`, the name of an existing serviceAccount in the target namespace **must** be provided to run the Solr Operator with. This serviceAccount with be given the operator's RBAC rules. | |
+| resources.limits | map[string]string |  | Provide Resource limits for the Solr Operator container |
+| resources.limits | map[string]string |  | Provide Resource requests for the Solr Operator container |
+| labels | map[string]string |  | Custom labels to add to the Solr Operator pod |
+| annotations | map[string]string |  | Custom annotations to add to the Solr Operator pod |
+| nodeSelector | map[string]string |  | Add a node selector for the Solr Operator pod, to specify where it can be scheduled |
+| affinity | object |  | Add Kubernetes affinity information for the Solr Operator pod |
+| tolerations | []object |  | Specify a list of Kubernetes tolerations for the Solr Operator pod |
+| priorityClassName | string | `""` | Give a priorityClassName for the Solr Operator pod |
+| sidecarContainers | []object |  | An optional list of additional containers to run along side the Solr Operator in its pod |
 
 ### Configuring the Zookeeper Operator
 
diff --git a/helm/solr-operator/templates/deployment.yaml b/helm/solr-operator/templates/deployment.yaml
index 461fd8c..955a215 100644
--- a/helm/solr-operator/templates/deployment.yaml
+++ b/helm/solr-operator/templates/deployment.yaml
@@ -19,22 +19,28 @@ metadata:
   name: {{ include "solr-operator.fullname" . }}
   labels:
     control-plane: solr-operator
-    controller-tools.k8s.io: "1.0"
 spec:
   replicas: {{ .Values.replicaCount }}
   selector:
     matchLabels:
       control-plane: solr-operator
-      controller-tools.k8s.io: "1.0"
   template:
     metadata:
       annotations:
         prometheus.io/scrape: "true"
+        {{- if .Values.annotations }}
+        {{ toYaml .Values.annotations | nindent 8 }}
+        {{- end }}
       labels:
         control-plane: solr-operator
-        controller-tools.k8s.io: "1.0"
+        {{- if .Values.labels }}
+        {{ toYaml .Values.labels | nindent 8 }}
+        {{- end }}
     spec:
       serviceAccountName: {{ include "solr-operator.serviceAccountName" . }}
+      {{- if .Values.priorityClassName }}
+      priorityClassName: {{ .Values.priorityClassName }}
+      {{- end }}
       containers:
       - name: {{ .Chart.Name }}
         image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" 
@@ -61,4 +67,19 @@ spec:
           {{- end }}
         resources:
           {{- toYaml .Values.resources | nindent 10 }}
+      {{- if .Values.sidecarContainers }}
+      {{ toYaml .Values.sidecarContainers | nindent 6 }}
+      {{- end }}
+      {{- if .Values.nodeSelector }}
+      nodeSelector:
+        {{ toYaml .Values.nodeSelector | nindent 8 }}
+      {{- end }}
+      {{- if .Values.affinity }}
+      affinity:
+        {{ toYaml .Values.affinity | nindent 8 }}
+      {{- end }}
+      {{- if .Values.tolerations }}
+      tolerations:
+        {{ toYaml .Values.tolerations | nindent 8 }}
+      {{- end }}
       terminationGracePeriodSeconds: 10
diff --git a/helm/solr-operator/values.yaml b/helm/solr-operator/values.yaml
index 5f6a198..4318b5e 100644
--- a/helm/solr-operator/values.yaml
+++ b/helm/solr-operator/values.yaml
@@ -21,7 +21,7 @@ replicaCount: 1
 
 image:
   repository: apache/solr-operator
-  tag: v0.3.0
+  tag: v0.3.0-prerelease
   pullPolicy: IfNotPresent
 
 nameOverride: ""
@@ -62,12 +62,13 @@ serviceAccount:
   # If not set and create is true, a name is generated using the fullname template
   name:
 
-resources:
-  limits:
-    cpu: 400m
-    memory: 500Mi
-  requests:
-    cpu: 100m
-    memory: 100Mi
-
+# Various Pod Options to customize the runtime of the operator
+resources: {}
 envVars: []
+labels: {}
+annotations: {}
+nodeSelector: {}
+affinity: {}
+tolerations: []
+priorityClassName: ""
+sidecarContainers: []