Skip to content
Merged
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
42 changes: 42 additions & 0 deletions helm/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# 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: iotdb-cluster
description: The distribution of Apache IoTDB

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.0.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.16.0"
1 change: 1 addition & 0 deletions helm/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This is Apache IoTDB Distribution
81 changes: 81 additions & 0 deletions helm/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{{/*
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.
*/}}

{{/*
Expand the name of the chart.
*/}}
{{- define "iotdb-cluster.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "iotdb-cluster.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "iotdb-cluster.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "iotdb-cluster.labels" -}}
helm.sh/chart: {{ include "iotdb-cluster.chart" . }}
{{ include "iotdb-cluster.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

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

{{/*
Create the name of the service account to use
*/}}
{{- define "iotdb-cluster.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "iotdb-cluster.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
35 changes: 35 additions & 0 deletions helm/templates/confignode-cm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# 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: ConfigMap
metadata:
name: {{ .Values.confignode.name }}-cm
namespace: {{ .Release.Namespace }}
data:
iotdb-system.properties: |
cn_internal_address=<HOSTNAME>.{{ .Values.confignode.name }}-svc.{{ .Release.Namespace }}
cn_seed_config_node={{ .Values.confignode.name }}-0.{{ .Values.confignode.name }}-svc.{{ .Release.Namespace }}:10710
config_node_consensus_protocol_class={{ .Values.confignode.configNodeConsensusProtocolClass }}
schema_replication_factor={{ .Values.confignode.schemaReplicationFactor }}
schema_region_consensus_protocol_class={{ .Values.confignode.schemaRegionConsensusProtocolClass }}
data_replication_factor={{ .Values.confignode.dataReplicationFactor }}
data_region_consensus_protocol_class={{ .Values.confignode.dataRegionConsensusProtocolClass }}
enable_last_cache={{ .Values.confignode.enableLastCache }}
data_region_group_extension_policy={{ .Values.confignode.dataRegionGroupExtensionPolicy }}
default_data_region_group_num_per_database={{ .Values.confignode.dataRegionGroupNumPerDatabase }}
105 changes: 105 additions & 0 deletions helm/templates/confignode.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# 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: {{ .Values.confignode.name }}-svc
namespace: {{ .Release.Namespace }}
labels:
app: {{ .Values.confignode.name }}
spec:
type: NodePort
ports:
- port: 80
targetPort: 80
name: rpc
selector:
app: {{ .Values.confignode.name }}
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ .Values.confignode.name }}
namespace: {{ .Release.Namespace }}
spec:
selector:
matchLabels:
app: {{ .Values.confignode.name }}
serviceName: {{ .Values.confignode.name }}-svc
replicas: {{ .Values.confignode.nodeCount }}
template:
metadata:
labels:
app: {{ .Values.confignode.name }}
spec:
terminationGracePeriodSeconds: 10
initContainers:
- name: init-confignode
image: busybox
command: [ 'sh', '-c', 'mkdir -p /iotdb/ && touch /iotdb/.env' ]
volumeMounts:
- name: map-confignode
mountPath: /iotdb
containers:
- name: confignode
image: {{ printf "%s:%s" .Values.image.repository .Values.image.tag }}
command: ["/bin/bash", "-c", "/iotdb/sbin/entrypoint.sh confignode"]
envFrom:
- configMapRef:
name: {{ .Values.confignode.name }}-cm
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: cn_internal_address
value: "$(POD_NAME).{{ .Values.confignode.name }}-svc.{{ .Release.Namespace }}"
ports:
- containerPort: 80
name: web
- containerPort: 10710
name: internal
- containerPort: 10720
name: consensus
volumeMounts:
- name: map-confignode
mountPath: /iotdb/data
subPath: data
- name: map-confignode
mountPath: /iotdb/ext
subPath: ext
- name: map-confignode
mountPath: /iotdb/logs
subPath: logs
- name: map-confignode
mountPath: /iotdb/.env
subPath: .env
resources:
requests:
cpu: {{ .Values.confignode.resources.requests.cpu }}
memory: {{ .Values.confignode.resources.requests.memory }}
volumeClaimTemplates:
- metadata:
name: map-confignode
spec:
accessModes: [ "ReadWriteOnce" ]
storageClassName: {{ .Values.storage.className }}
resources:
requests:
storage: {{ .Values.confignode.storageCapacity }}
29 changes: 29 additions & 0 deletions helm/templates/datanode-cm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# 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: ConfigMap
metadata:
name: {{ .Values.datanode.name }}-cm
namespace: {{ .Release.Namespace }}
data:
iotdb-system.properties: |
dn_rpc_address=<HOSTNAME>.{{ .Values.datanode.name }}-svc.{{ .Release.Namespace }}
dn_internal_address=<HOSTNAME>.{{ .Values.datanode.name }}-svc.{{ .Release.Namespace }}
dn_seed_config_node={{ .Values.confignode.name }}-0.{{ .Values.confignode.name }}-svc.{{ .Release.Namespace }}:10710
enable_rest_service={{ .Values.datanode.enableRestService }}
Loading