ptlrs commented on code in PR #16:
URL: https://github.com/apache/ozone-helm-charts/pull/16#discussion_r1890733000
##########
charts/ozone/templates/recon/recon-service.yaml:
##########
@@ -0,0 +1,44 @@
+{{/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/}}
+
+{{- if .Values.recon.enabled }}
+apiVersion: v1
+kind: Service
Review Comment:
Since we are adding a service, there should be a corresponding
`readinessProbe` to control access to the pod via this service.
##########
charts/ozone/templates/recon/recon-statefulset.yaml:
##########
@@ -0,0 +1,101 @@
+{{/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/}}
+
+{{- if .Values.recon.enabled }}
+{{- $env := concat .Values.env .Values.recon.env }}
+{{- $envFrom := concat .Values.envFrom .Values.recon.envFrom }}
+{{- $nodeSelector := or .Values.recon.nodeSelector .Values.nodeSelector }}
+{{- $affinity := or .Values.recon.affinity .Values.affinity }}
+{{- $tolerations := or .Values.recon.tolerations .Values.tolerations }}
+{{- $securityContext := or .Values.recon.securityContext
.Values.securityContext }}
+apiVersion: apps/v1
+kind: StatefulSet
Review Comment:
We should consider making this pod stateless by using a Deployment.
##########
charts/ozone/templates/recon/recon-statefulset.yaml:
##########
@@ -0,0 +1,101 @@
+{{/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/}}
+
+{{- if .Values.recon.enabled }}
+{{- $env := concat .Values.env .Values.recon.env }}
+{{- $envFrom := concat .Values.envFrom .Values.recon.envFrom }}
+{{- $nodeSelector := or .Values.recon.nodeSelector .Values.nodeSelector }}
+{{- $affinity := or .Values.recon.affinity .Values.affinity }}
+{{- $tolerations := or .Values.recon.tolerations .Values.tolerations }}
+{{- $securityContext := or .Values.recon.securityContext
.Values.securityContext }}
+apiVersion: apps/v1
+kind: StatefulSet
+metadata:
+ name: {{ .Release.Name }}-recon
+ labels:
+ {{- include "ozone.labels" . | nindent 4 }}
+ app.kubernetes.io/component: recon
+spec:
+ replicas: 1
+ serviceName: {{ .Release.Name }}-recon
+ selector:
+ matchLabels:
+ {{- include "ozone.selectorLabels" . | nindent 6 }}
+ app.kubernetes.io/component: recon
+ template:
+ metadata:
+ annotations:
+ checksum/config: {{ include (print $.Template.BasePath
"/ozone-configmap.yaml") . | sha256sum }}
+ labels:
+ {{- include "ozone.selectorLabels" . | nindent 8 }}
+ app.kubernetes.io/component: recon
+ spec:
+ containers:
+ - name: recon
+ image: "{{ .Values.image.repository }}:{{ .Values.image.tag |
default .Chart.AppVersion }}"
+ imagePullPolicy: {{ .Values.image.pullPolicy }}
+ {{- with .Values.recon.command }}
+ command: {{- tpl (toYaml .) $ | nindent 12 }}
+ {{- end }}
+ {{- with .Values.recon.args }}
+ args: {{- tpl (toYaml .) $ | nindent 12 }}
+ {{- end }}
+ env:
+ {{- include "ozone.configuration.env" . | nindent 12 }}
+ - name: WAITFOR
+ value: {{ $.Release.Name }}-scm-0.{{ $.Release.Name
}}-scm-headless:{{ .Values.scm.service.port }}
+ {{- with $env }}
+ {{- tpl (toYaml .) $ | nindent 12 }}
+ {{- end }}
+ {{- with $envFrom }}
+ envFrom: {{- tpl (toYaml .) $ | nindent 12 }}
+ {{- end }}
+ ports:
+ - name: ui
+ containerPort: {{ .Values.recon.service.port }}
+ livenessProbe:
+ tcpSocket:
+ port: 9891
+ initialDelaySeconds: 30
+ volumeMounts:
+ - name: config
+ mountPath: {{ .Values.configuration.dir }}
+ {{- with $nodeSelector }}
+ nodeSelector: {{- toYaml . | nindent 8 }}
+ {{- end }}
+ {{- with $affinity }}
+ affinity: {{- toYaml . | nindent 8 }}
+ {{- end }}
+ {{- with $tolerations }}
+ tolerations: {{- toYaml . | nindent 8 }}
+ {{- end }}
+ {{- with $securityContext }}
+ securityContext: {{- toYaml . | nindent 8 }}
+ {{- end }}
+ volumes:
+ - name: config
+ projected:
+ sources:
+ - configMap:
+ name: {{ .Release.Name }}-ozone
+ {{- with .Values.configuration.filesFrom }}
+ {{- tpl (toYaml .) $ | nindent 14 }}
+ {{- end }}
+ - name: {{ .Release.Name }}-recon
+ emptyDir: {}
Review Comment:
This volume is not mounted. Is it required?
##########
charts/ozone/templates/_helpers.tpl:
##########
@@ -73,4 +78,8 @@ app.kubernetes.io/instance: {{ .Release.Name }}
value: "1"
- name: OZONE-SITE.XML_dfs.datanode.use.datanode.hostname
value: "true"
+{{- if .Values.recon.enabled }}
+- name: OZONE-SITE.XML_ozone.recon.address
+ value: {{ include "ozone.recon.pod" . }}
Review Comment:
This should point to the Recon service name instead of the pod.
We should be able to refer to the recon pod without specifying the type of
the pod. This is where the service comes into the picture.
`ozone.recon.pod` defined in this file above can be removed if not needed
elsewhere.
##########
charts/ozone/templates/recon/recon-statefulset.yaml:
##########
@@ -0,0 +1,101 @@
+{{/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/}}
+
+{{- if .Values.recon.enabled }}
+{{- $env := concat .Values.env .Values.recon.env }}
+{{- $envFrom := concat .Values.envFrom .Values.recon.envFrom }}
+{{- $nodeSelector := or .Values.recon.nodeSelector .Values.nodeSelector }}
+{{- $affinity := or .Values.recon.affinity .Values.affinity }}
+{{- $tolerations := or .Values.recon.tolerations .Values.tolerations }}
+{{- $securityContext := or .Values.recon.securityContext
.Values.securityContext }}
+apiVersion: apps/v1
+kind: StatefulSet
+metadata:
+ name: {{ .Release.Name }}-recon
+ labels:
+ {{- include "ozone.labels" . | nindent 4 }}
+ app.kubernetes.io/component: recon
+spec:
+ replicas: 1
+ serviceName: {{ .Release.Name }}-recon
+ selector:
+ matchLabels:
+ {{- include "ozone.selectorLabels" . | nindent 6 }}
+ app.kubernetes.io/component: recon
+ template:
+ metadata:
+ annotations:
+ checksum/config: {{ include (print $.Template.BasePath
"/ozone-configmap.yaml") . | sha256sum }}
+ labels:
+ {{- include "ozone.selectorLabels" . | nindent 8 }}
+ app.kubernetes.io/component: recon
+ spec:
+ containers:
+ - name: recon
+ image: "{{ .Values.image.repository }}:{{ .Values.image.tag |
default .Chart.AppVersion }}"
+ imagePullPolicy: {{ .Values.image.pullPolicy }}
+ {{- with .Values.recon.command }}
+ command: {{- tpl (toYaml .) $ | nindent 12 }}
+ {{- end }}
+ {{- with .Values.recon.args }}
+ args: {{- tpl (toYaml .) $ | nindent 12 }}
+ {{- end }}
+ env:
+ {{- include "ozone.configuration.env" . | nindent 12 }}
+ - name: WAITFOR
+ value: {{ $.Release.Name }}-scm-0.{{ $.Release.Name
}}-scm-headless:{{ .Values.scm.service.port }}
Review Comment:
We should consider if waiting for another pod is strictly necessary.
If we do have to wait then we should do it in an initcontainer.
Also, we should use the SCM service instead of addressing the pod directly.
At any point we have to consider the pod `-scm-0` being down and should instead
rely on other SCM pods (if any in HA mode) by using the SCM service.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]