Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDDS-11966. Add recon support #16

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions charts/ozone/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,10 @@ Datanode
S3 Gateway
To access S3 Gateway from a local environment, use the following command and specify localhost:{{ .Values.s3g.service.port }} as S3 endpoint
$ kubectl port-forward svc/{{ .Release.Name }}-s3g {{ .Values.s3g.service.port }}:{{ .Values.s3g.service.port }}

{{- if .Values.recon.enabled }}

Recon
To access Recon from a local environment, use the following command and specify localhost:{{ .Values.recon.service.port }} as Recon endpoint
$ kubectl port-forward svc/{{ .Release.Name }}-recon {{ .Values.recon.service.port }}:{{ .Values.recon.service.port }}
{{- end }}
4 changes: 4 additions & 0 deletions charts/ozone/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,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: "{{- printf "%s-recon.%s.svc.cluster.local" $.Release.Name $.Release.Namespace }}:9891"
{{- end }}
{{- end }}
100 changes: 100 additions & 0 deletions charts/ozone/templates/recon/recon-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
{{/*
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: Deployment
metadata:
name: {{ .Release.Name }}-recon
labels:
{{- include "ozone.labels" . | nindent 4 }}
app.kubernetes.io/component: recon
spec:
replicas: 1
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 }}
{{- 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
readinessProbe:
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 }}
{{- end }}
46 changes: 46 additions & 0 deletions charts/ozone/templates/recon/recon-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{{/*
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
fraochan marked this conversation as resolved.
Show resolved Hide resolved
metadata:
name: {{ .Release.Name }}-recon
labels:
{{- include "ozone.labels" . | nindent 4 }}
app.kubernetes.io/component: recon
{{- with .Values.recon.service.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.recon.service.annotations }}
annotations: {{- toYaml . | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.recon.service.type }}
ports:
- name: ui
port: {{ .Values.recon.service.port }}
{{- if and (eq .Values.recon.service.type "NodePort") (.Values.recon.service.nodePort) }}
nodePort: {{ .Values.recon.service.nodePort }}
{{- end }}
- name: tcp
port: 9891
selector:
{{- include "ozone.selectorLabels" . | nindent 4 }}
app.kubernetes.io/component: recon
{{- end }}
27 changes: 27 additions & 0 deletions charts/ozone/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -230,3 +230,30 @@ scm:
size: 10Gi
# The name of a specific storage class name to use
storageClassName: ~

# Recon configuration
recon:
enabled: false
# Command to launch Recon (templated)
command: ~
# Arguments to launch Recon (templated)
args: ["ozone", "recon"]
# Additional Recon environment variables (templated)
env: []
# Additional Recon envFrom items to set up environment variables (templated)
envFrom: []
# Constrain Recon pods to nodes with specific node labels
nodeSelector: {}
# Constrain Recon pods to nodes by affinity/anti-affinity rules
affinity: {}
# Allow to schedule Recon pods on nodes with matching taints
tolerations: []
# Recon security context (overwrites common security context)
securityContext: {}
# Recon service configuration
service:
type: ClusterIP
port: 9888
nodePort: ~
labels: {}
annotations: {}