kocolosk commented on a change in pull request #66:
URL: https://github.com/apache/couchdb-helm/pull/66#discussion_r793207450
##########
File path: couchdb/README.md
##########
@@ -214,6 +214,12 @@ A variety of other parameters are also configurable. See
the comments in the
| `prometheusPort.enabled` | false
|
| `prometheusPort.port` | 17896
|
| `prometheusPort.bind_address` | 0.0.0.0
|
+| `placementConfig.enabled` | false
|
+| `placementConfig.namespace` | couchdb
|
+| `placementConfig.couchdbPort` | 5984
|
Review comment:
Would this value ever be different than `service.externalPort`?
##########
File path: couchdb/templates/placementmanager.yaml
##########
@@ -0,0 +1,45 @@
+{{- if .Values.placementConfig.enabled -}}
+apiVersion: batch/v1
+kind: Job
+metadata:
+ name: {{ template "couchdb.fullname" . }}
+ labels:
+ app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
+ app.kubernetes.io/instance: {{ .Release.Name | quote }}
+ app.kubernetes.io/version: {{ .Chart.AppVersion }}
+ helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
+ annotations:
+ # This is what defines this resource as a hook. Without this line, the
+ # job is considered part of the release.
+ "helm.sh/hook": post-install
+ "helm.sh/hook-weight": "-5"
+ "helm.sh/hook-delete-policy": before-hook-creation
+spec:
+ template:
+ metadata:
+ name: "{{ .Release.Name }}"
+ labels:
+ app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
+ app.kubernetes.io/instance: {{ .Release.Name | quote }}
+ helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
+ spec:
+ restartPolicy: OnFailure
+ containers:
+ - name: placement-tagging-job
+ image: {{ .Values.placementConfig.image.repository }}:{{
.Values.placementConfig.image.tag }}
+ imagePullPolicy: Always
+ args: ["--placement-manager"]
+ envFrom:
+ - secretRef:
+ name: couchdb-couchdb
+ - configMapRef:
+ name: {{ template "couchdb.fullname" . }}
+ env:
+ - name: EKS_NAMESPACE
Review comment:
If this is just the Kubernetes namespace I'd prefer an environment
variable name that's not vendor-specific.
##########
File path: couchdb/values.yaml
##########
@@ -221,3 +221,16 @@ sidecars: {}
# volumeMounts:
# - name: database-storage
# mountPath: /opt/couchdb/data/
+
+
+# Placement manager to annotate each document in the nodes DB with "zone"
attribute
+# recording the zone where node has been scheduled
+# Ref:
https://docs.couchdb.org/en/stable/cluster/sharding.html#specifying-database-placement
+placementConfig:
+ enabled: false
+ namespace: couchdb # kubernetes namespace
+ couchdbPort: 5984 # CouchDB Port
+ image:
+ repository: caligrafix/couchdb-autoscaler-placement-manager
+ tag: latest
Review comment:
Ideally we'd have a versioned tag for your image.
##########
File path: couchdb/templates/placementmanager.yaml
##########
@@ -0,0 +1,45 @@
+{{- if .Values.placementConfig.enabled -}}
+apiVersion: batch/v1
+kind: Job
+metadata:
+ name: {{ template "couchdb.fullname" . }}
+ labels:
+ app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
+ app.kubernetes.io/instance: {{ .Release.Name | quote }}
+ app.kubernetes.io/version: {{ .Chart.AppVersion }}
+ helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
+ annotations:
+ # This is what defines this resource as a hook. Without this line, the
+ # job is considered part of the release.
+ "helm.sh/hook": post-install
+ "helm.sh/hook-weight": "-5"
+ "helm.sh/hook-delete-policy": before-hook-creation
+spec:
+ template:
+ metadata:
+ name: "{{ .Release.Name }}"
+ labels:
+ app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
+ app.kubernetes.io/instance: {{ .Release.Name | quote }}
+ helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
+ spec:
+ restartPolicy: OnFailure
+ containers:
+ - name: placement-tagging-job
+ image: {{ .Values.placementConfig.image.repository }}:{{
.Values.placementConfig.image.tag }}
+ imagePullPolicy: Always
+ args: ["--placement-manager"]
+ envFrom:
+ - secretRef:
+ name: couchdb-couchdb
+ - configMapRef:
+ name: {{ template "couchdb.fullname" . }}
+ env:
+ - name: EKS_NAMESPACE
+ value: {{ .Values.placementConfig.namespace }}
+ - name: COUCHDB_SVC
+ value: {{ template "couchdb.svcname" . }}
+ - name: COUCHDB_PORT
+ value: {{ .Values.placementConfig.couchdbPort | quote }}
+
Review comment:
Couple of small whitespace errors here with a missing newline at the end
of the file.
##########
File path: couchdb/README.md
##########
@@ -214,6 +214,12 @@ A variety of other parameters are also configurable. See
the comments in the
| `prometheusPort.enabled` | false
|
| `prometheusPort.port` | 17896
|
| `prometheusPort.bind_address` | 0.0.0.0
|
+| `placementConfig.enabled` | false
|
+| `placementConfig.namespace` | couchdb
|
Review comment:
I guess this is just passed to your script so it can query for pods in
the namespace in which CouchDB was deployed. Can you see if it's possible to
inject that dynamically? I think some parts of the chart rely on `{{
.Release.Namespace }}`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]