Skip to content

Commit

Permalink
HDDS-11035. Implement initial version of the Helm chart (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
dnskr authored Jul 4, 2024
1 parent d2953d7 commit ab64e97
Show file tree
Hide file tree
Showing 22 changed files with 1,294 additions and 0 deletions.
32 changes: 32 additions & 0 deletions charts/ozone/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# 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.

apiVersion: v2
name: ozone
description: The official Helm chart for Apache Ozone
type: application
version: 0.1.0
appVersion: "1.4.0"
home: https://ozone.apache.org
icon: https://ozone.apache.org/ozone-logo.png
sources:
- https://github.com/apache/ozone
keywords:
- apache
- ozone
- object-storage
- S3
- storage
39 changes: 39 additions & 0 deletions charts/ozone/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!--
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.
-->

# Helm Chart for Apache Ozone

[Apache Ozone](https://ozone.apache.org) is a highly scalable, distributed storage for Analytics, Big data and Cloud Native applications.


## Introduction

This chart bootstraps an [Ozone](https://ozone.apache.org) deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.

## Requirements

- Kubernetes cluster 1.27+
- Helm 3.0+

## Documentation

Documentation lives on the Apache Ozone [website](https://ozone.apache.org/docs/).

## Contributing

Want to help build Apache Ozone? Check out our [Contribution guidelines](https://github.com/apache/ozone/blob/master/CONTRIBUTING.md).
47 changes: 47 additions & 0 deletions charts/ozone/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{{/*
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.
*/}}

The chart has been installed!

In order to check the release status, use:
helm status {{ .Release.Name }} -n {{ .Release.Namespace }}
or for more detailed info
helm get all {{ .Release.Name }} -n {{ .Release.Namespace }}

****************
* Services *
****************

Ozone Manager
To access Ozone Manager from a browser, use the following command and visit localhost:{{ .Values.om.service.port }}
$ kubectl port-forward svc/{{ .Release.Name }}-om {{ .Values.om.service.port }}:{{ .Values.om.service.port }}

Storage Container Manager
To access Storage Container Manager from a browser, use the following command and visit localhost:{{ .Values.scm.service.port }}
$ kubectl port-forward svc/{{ .Release.Name }}-scm {{ .Values.scm.service.port }}:{{ .Values.scm.service.port }}

Datanode
To access Datanode instances from a browser, use one of the following commands and visit localhost:{{ .Values.datanode.service.port }}
{{- $replicas := .Values.datanode.replicas | int }}
{{- range $i := until $replicas }}
$ kubectl port-forward pod/{{ $.Release.Name }}-datanode-{{ $i }} {{ $.Values.datanode.service.port }}:{{ $.Values.datanode.service.port }}
{{- end }}

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 }}
76 changes: 76 additions & 0 deletions charts/ozone/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{{/*
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.
*/}}

{{/* Common labels */}}
{{- define "ozone.labels" -}}
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }}
app.kubernetes.io/name: {{ .Chart.Name }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Values.image.tag | default .Chart.AppVersion | quote }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/* Selector labels */}}
{{- define "ozone.selectorLabels" -}}
app.kubernetes.io/name: {{ .Chart.Name }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/* List of comma separated SCM pod names */}}
{{- define "ozone.scm.pods" -}}
{{- $pods := list }}
{{- $replicas := .Values.scm.replicas | int }}
{{- range $i := until $replicas }}
{{- $pods = append $pods (printf "%s-scm-%d.%s-scm-headless" $.Release.Name $i $.Release.Name) }}
{{- end }}
{{- $pods | join "," }}
{{- end }}

{{/* List of comma separated OM pod names */}}
{{- define "ozone.om.pods" -}}
{{- $pods := list }}
{{- $replicas := .Values.om.replicas | int }}
{{- range $i := until $replicas }}
{{- $pods = append $pods (printf "%s-om-%d.%s-om-headless" $.Release.Name $i $.Release.Name) }}
{{- end }}
{{- $pods | join "," }}
{{- end }}

{{/* Common configuration environment variables */}}
{{- define "ozone.configuration.env" -}}
- name: OZONE-SITE.XML_hdds.datanode.dir
value: /data/storage
- name: OZONE-SITE.XML_ozone.scm.datanode.id.dir
value: /data
- name: OZONE-SITE.XML_ozone.metadata.dirs
value: /data/metadata
- name: OZONE-SITE.XML_ozone.scm.block.client.address
value: {{ include "ozone.scm.pods" . }}
- name: OZONE-SITE.XML_ozone.scm.client.address
value: {{ include "ozone.scm.pods" . }}
- name: OZONE-SITE.XML_ozone.scm.names
value: {{ include "ozone.scm.pods" . }}
- name: OZONE-SITE.XML_ozone.om.address
value: {{ include "ozone.om.pods" . }}
- name: OZONE-SITE.XML_hdds.scm.safemode.min.datanode
value: "3"
- name: OZONE-SITE.XML_ozone.datanode.pipeline.limit
value: "1"
- name: OZONE-SITE.XML_dfs.datanode.use.datanode.hostname
value: "true"
{{- end }}
34 changes: 34 additions & 0 deletions charts/ozone/templates/datanode/datanode-pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{{/*
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 and .Values.datanode.persistence.enabled (not .Values.datanode.persistence.existingClaim) }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ .Release.Name }}-datanode
labels:
{{- include "ozone.labels" . | nindent 4 }}
app.kubernetes.io/component: datanode
spec:
resources:
requests:
storage: {{ .Values.datanode.persistence.size }}
{{- with .Values.datanode.persistence.storageClassName }}
storageClassName: {{ . }}
{{- end }}
{{- end }}
33 changes: 33 additions & 0 deletions charts/ozone/templates/datanode/datanode-service-headless.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{{/*
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.
*/}}

apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}-datanode-headless
labels:
{{- include "ozone.labels" . | nindent 4 }}
app.kubernetes.io/component: datanode
spec:
clusterIP: None
ports:
- name: ui
port: {{ .Values.datanode.service.port }}
selector:
{{- include "ozone.selectorLabels" . | nindent 4 }}
app.kubernetes.io/component: datanode
36 changes: 36 additions & 0 deletions charts/ozone/templates/datanode/datanode-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{{/*
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.
*/}}

apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}-datanode
labels:
{{- include "ozone.labels" . | nindent 4 }}
app.kubernetes.io/component: datanode
spec:
type: {{ .Values.datanode.service.type }}
ports:
- name: ui
port: {{ .Values.datanode.service.port }}
{{- if and (eq .Values.datanode.service.type "NodePort") (.Values.datanode.service.nodePort) }}
nodePort: {{ .Values.datanode.service.nodePort }}
{{- end }}
selector:
{{- include "ozone.selectorLabels" . | nindent 4 }}
app.kubernetes.io/component: datanode
Loading

0 comments on commit ab64e97

Please sign in to comment.