diff --git a/charts/galexie/Chart.yaml b/charts/galexie/Chart.yaml new file mode 100644 index 0000000..2968cf8 --- /dev/null +++ b/charts/galexie/Chart.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +name: galexie +version: 0.1.0 +appVersion: "24.0.0" +description: Stellar Galexie Helm Chart. This chart will install Stellar Galexie +maintainers: + - name: Stellar Development Foundation +sources: + - https://github.com/stellar/helm-charts + - https://github.com/stellar/stellar-galexie diff --git a/charts/galexie/README.md b/charts/galexie/README.md new file mode 100644 index 0000000..e6e5da2 --- /dev/null +++ b/charts/galexie/README.md @@ -0,0 +1,17 @@ +# Galexie Helm Chart + +A helm chart for installing [Galexie](https://github.com/stellar/stellar-galexie) into a Kubernetes cluster. + +## Installing the Chart + +In order to install the chart into a target Kubernetes cluster run the following commands + +``` +helm repo add stellar https://helm.stellar.org/charts && helm repo update + +helm install my-galexie stellar/galexie +``` + +## Dependencies + +1. A datasource bucket to push ledger data from Galexie. This can be either an S3 bucket or GCS bucket diff --git a/charts/galexie/templates/_helpers.tpl b/charts/galexie/templates/_helpers.tpl new file mode 100644 index 0000000..ac5593d --- /dev/null +++ b/charts/galexie/templates/_helpers.tpl @@ -0,0 +1,20 @@ +{{- define "common.name" -}} +{{- default .Chart.Name (.Values.global).nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "common.fullname" -}} +{{- if (.Values.global).fullnameOverride -}} +{{- .Values.global.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Chart.Name (.Values.global).nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{- define "common.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} diff --git a/charts/galexie/templates/configmap.yaml b/charts/galexie/templates/configmap.yaml new file mode 100644 index 0000000..8785290 --- /dev/null +++ b/charts/galexie/templates/configmap.yaml @@ -0,0 +1,28 @@ +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.fullname" . | quote }} + namespace: {{ .Release.Namespace | quote }} + labels: + app: {{ include "common.fullname" . | quote }} + chart: {{ include "common.chart" . | quote }} + release: {{ .Release.Name | quote }} + heritage: {{ .Release.Service | quote }} +data: + config.toml: | + admin_port = {{ .Values.adminPort }} + + [datastore_config] + type = {{ .Values.datastore.type | quote }} + + [datastore_config.params] + destination_bucket_path = {{ .Values.datastore.path | quote }} + + [datastore_config.schema] + ledgers_per_file = {{ .Values.datastore.ledgersPerFile }} + files_per_partition = {{ .Values.datastore.filesPerPartition }} + + [stellar_core_config] + network = {{ .Values.network | quote }} + storage_path = "/var/lib/stellar/captive-core" diff --git a/charts/galexie/templates/deployment.yaml b/charts/galexie/templates/deployment.yaml new file mode 100644 index 0000000..11392f2 --- /dev/null +++ b/charts/galexie/templates/deployment.yaml @@ -0,0 +1,64 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "common.fullname" . | quote }} + namespace: {{ .Release.Namespace | quote }} + labels: + app: {{ include "common.fullname" . | quote }} + chart: {{ include "common.chart" . | quote }} + release: {{ .Release.Name | quote }} + heritage: {{ .Release.Service | quote }} + {{- with .Values.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} + spec: + replicas: 1 # Galexie can not currently support multiple pods pushing data to the same place + selector: + matchLabels: + app.kubernetes.io/name: {{ .Values.fullName | quote }} + template: + metadata: + labels: + app.kubernetes.io/name: {{ .Values.fullName | quote }} + app.kubernetes.io/instance: {{ .Release.Name | quote }} + spec: + {{- if .Values.serviceAccount.create }} + serviceAccountName: {{ .Values.serviceAccount.name | default (include "common.fullname" .) | quote }} + {{- end }} + containers: + - name: {{ .Chart.Name | quote }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy | quote }} + command: [ + "galexie", "append", + "--config-file", "/galexie-config/config.toml", + "--start", "{{ .Values.startLedger }}" + ] + ports: + - containerPort: {{ .Values.adminPort }} + {{- with .Values.env }} + env: + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.envFrom }} + envFrom: + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.resources }} + resources: + {{- toYaml . | nindent 12 }} + {{- end }} + volumeMounts: + - name: galexie-config-volume + mountPath: /galexie-config + - name: captive-core + mountPath: /var/lib/stellar + volumes: + - name: galexie-config-volume + configMap: + name: {{ include "common.fullname" . | quote }} + - name: captive-core + persistentVolumeClaim: + claimName: {{ print (include "common.fullname" .) "-captive-core" | quote }} diff --git a/charts/galexie/templates/persistentvolumeclaim.yaml b/charts/galexie/templates/persistentvolumeclaim.yaml new file mode 100644 index 0000000..7da89ee --- /dev/null +++ b/charts/galexie/templates/persistentvolumeclaim.yaml @@ -0,0 +1,21 @@ +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ print (include "common.fullname" .) "-captive-core" | quote }} + namespace: {{ .Release.Namespace | quote }} + labels: + app: {{ include "common.fullname" . | quote }} + chart: {{ include "common.chart" . | quote }} + release: {{ .Release.Name | quote }} + heritage: {{ .Release.Service | quote }} +spec: + storageClassName: {{ .Values.persistentVolumeClaim.storageClassName | quote }} + {{- if .Values.persistentVolumeClaim.volumeName }} + volumeName: {{ .Values.persistentVolumeClaim.volumeName | quote }} + {{- end }} + accessModes: + - ReadWriteOnce + resources: + requests: + storage: {{ .Values.persistentVolumeClaim.storage | quote }} diff --git a/charts/galexie/templates/serviceaccount.yaml b/charts/galexie/templates/serviceaccount.yaml new file mode 100644 index 0000000..2f62a5c --- /dev/null +++ b/charts/galexie/templates/serviceaccount.yaml @@ -0,0 +1,17 @@ +{{- if .Values.serviceAccount.create -}} +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ .Values.serviceAccount.name | default (include "common.fullname" .) | quote }} + namespace: {{ .Release.Namespace | quote }} + labels: + app: {{ include "common.fullname" . | quote }} + chart: {{ include "common.chart" . | quote }} + release: {{ .Release.Name | quote }} + heritage: {{ .Release.Service | quote }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end -}} diff --git a/charts/galexie/values.yaml b/charts/galexie/values.yaml new file mode 100644 index 0000000..53a87e9 --- /dev/null +++ b/charts/galexie/values.yaml @@ -0,0 +1,57 @@ +# Admin port where metrics are served +adminPort: 6061 + +# Which stellar network to use. The options are "pubnet" or "testnet" +network: "pubnet" + +# The earliest ledger to create data for in the datastore. For quicker catchup, +# choose a ledger closer to the most recent ledger in the network +startLedger: "59000000" + +# Datastore configuration for files created by Galexie +datastore: + # The options are "GCS" or "S3" + type: "GCS" + # The full path including the bucket name of where to create data + path: "" + # Number of ledgers per file + ledgersPerFile: 1 + # Number of files per partition created in the destination folder + filesPerPartition: 64000 + +# Image used by the Galexie deployment +image: + repository: stellar/stellar-galexie + tag: 24.0.0 + pullPolicy: IfNotPresent + +# Annotations on the Galexie deployment +annotations: {} + +# Environment variables for the Galexie deployment +env: [] +# EnvFrom for the Galexie deployment +envFrom: [] + +# Resources for the Galexie deployment +resources: + limits: + cpu: 3 + memory: 16Gi + requests: + cpu: 1.5 + memory: 8Gi + +# Service account used by the Galexie deployment +serviceAccount: + create: true + name: "" + annotations: [] + +# Persistent volume claim for stellar core data used by Galexie +persistentVolumeClaim: + storageClassName: default + # 100Gi is recommended for "pubnet". 10Gi is recommended for "testnet" + storage: 100Gi + volumeName: "" + annotations: []