Skip to content

Commit

Permalink
Merge branch 'main' into horizon-files
Browse files Browse the repository at this point in the history
  • Loading branch information
travertischio committed Oct 23, 2024
2 parents b657a3e + 0d7e6ce commit b5dfa3f
Show file tree
Hide file tree
Showing 12 changed files with 165 additions and 161 deletions.
4 changes: 2 additions & 2 deletions charts/horizon/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@

{{- define "core.config" -}}
{{- if eq .Values.global.network "testnet" -}}
{{- template "core.testnetConfig" }}
{{- include "core.testnetConfig" . }}
{{- else if eq .Values.global.network "pubnet" -}}
{{- template "core.pubnetConfig" }}
{{- include "core.pubnetConfig" . }}
{{- else -}}
{{- .Values.ingest.coreConfig }}
{{- end -}}
Expand Down
9 changes: 4 additions & 5 deletions charts/horizon/templates/core-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "common.fullname" . }}-core
name: {{ include "common.fullname" . }}-core
namespace: {{ .Release.Namespace }}
labels:
app: {{ template "common.fullname" . }}-core
chart: {{ template "common.chart" . }}
app: {{ include "common.fullname" . }}-core
chart: {{ include "common.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
data:
stellar-core.cfg: |
{{ include "core.config" . | indent 4 }}
stellar-core.cfg: | {{ include "core.config" . | nindent 4 }}
{{- end }}
40 changes: 19 additions & 21 deletions charts/horizon/templates/ingest-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,41 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "common.fullname" . }}-ingest-env
name: {{ include "common.fullname" . }}-ingest-env
namespace: {{ .Release.Namespace }}
labels:
app: {{ template "common.fullname" . }}-ingest
chart: {{ template "common.chart" . }}
app: {{ include "common.fullname" . }}-ingest
chart: {{ include "common.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
data:
ADMIN_PORT: {{ .Values.ingest.horizonConfig.adminPort | default "6000" | quote}}
APPLY_MIGRATIONS: {{ .Values.ingest.horizonConfig.applyMigrations | default "false" | quote}}
ALLOW_EMPTY_LEDGER_DATA_RESPONSES: {{ .Values.ingest.horizonConfig.allowEmptyLedgerDataResponses | default "true" | quote}}
ADMIN_PORT: {{ .Values.ingest.horizonConfig.adminPort | quote}}
APPLY_MIGRATIONS: {{ .Values.ingest.horizonConfig.applyMigrations | quote}}
ALLOW_EMPTY_LEDGER_DATA_RESPONSES: {{ .Values.ingest.horizonConfig.allowEmptyLedgerDataResponses | quote}}
CAPTIVE_CORE_CONFIG_APPEND_PATH: "/config/stellar-core.cfg"
CAPTIVE_CORE_REUSE_STORAGE_PATH: "True"
CAPTIVE_CORE_REUSE_STORAGE_DIR: "True"
CAPTIVE_CORE_STORAGE_PATH: "/var/lib/stellar"
CAPTIVE_CORE_USE_DB: {{ .Values.ingest.horizonConfig.captiveCoreUseDb | default "False" | quote}}
CONNECTION_TIMEOUT: {{ .Values.ingest.horizonConfig.connectionTimeout | default "10" | quote}}
{{- if .Values.ingest.horizonConfig.disablePathFinding }}
DISABLE_PATH_FINDING: {{ .Values.ingest.horizonConfig.disablePathFinding | default "False" | quote}}
{{- end }}
ENABLE_ACCOUNTS_FOR_SIGNER: {{ .Values.ingest.horizonConfig.enableAccountsForSigner | default "false" | quote}}
ENABLE_ASSET_STATS: {{ .Values.ingest.horizonConfig.enableAssetStats | default "true" | quote}}
CAPTIVE_CORE_USE_DB: {{ .Values.ingest.horizonConfig.captiveCoreUseDb | quote}}
CONNECTION_TIMEOUT: {{ .Values.ingest.horizonConfig.connectionTimeout | quote}}
DISABLE_PATH_FINDING: {{ .Values.ingest.horizonConfig.disablePathFinding | quote}}
ENABLE_ACCOUNTS_FOR_SIGNER: {{ .Values.ingest.horizonConfig.enableAccountsForSigner | quote}}
ENABLE_ASSET_STATS: {{ .Values.ingest.horizonConfig.enableAssetStats | quote}}
ENABLE_CAPTIVE_CORE_INGESTION: "true"
ENABLE_EXPERIMENTAL_INGESTION: "false"
{{- if .Values.ingest.horizonConfig.friendbotUrl }}
FRIENDBOT_URL: {{ .Values.ingest.horizonConfig.friendbotUrl | default "https://friendbot.stellar.org" | quote}}
FRIENDBOT_URL: {{ .Values.ingest.horizonConfig.friendbotUrl | quote}}
{{- end }}
HISTORY_ARCHIVE_URLS: {{ include "horizon.historyArchiveUrls" . | quote }}
HISTORY_RETENTION_COUNT: {{ .Values.ingest.horizonConfig.historyRetentionCount | default "34560" | quote}}
INGEST_FAILED_TRANSACTIONS: {{ .Values.ingest.horizonConfig.ingestFailedTransactions | default "true" | quote}}
HISTORY_RETENTION_COUNT: {{ .Values.ingest.horizonConfig.historyRetentionCount | quote}}
INGEST_FAILED_TRANSACTIONS: {{ .Values.ingest.horizonConfig.ingestFailedTransactions | quote}}
INGEST: "true"
MAX_DB_CONNECTIONS: {{ .Values.ingest.horizonConfig.maxDBConnections | default "20" | quote}}
MAX_DB_CONNECTIONS: {{ .Values.ingest.horizonConfig.maxDBConnections | quote}}
NETWORK_PASSPHRASE: {{ include "horizon.networkPassphrase" . | quote }}
PER_HOUR_RATE_LIMIT: {{ .Values.ingest.horizonConfig.perHourRateLimit | default "3600" | quote}}
PORT: {{ .Values.ingest.horizonConfig.port | default "8000" | quote}}
SSE_UPDATE_FREQUENCY: {{ .Values.ingest.horizonConfig.SseUpdateFrequency | default "4" | quote}}
PER_HOUR_RATE_LIMIT: {{ .Values.ingest.horizonConfig.perHourRateLimit | quote}}
PORT: {{ .Values.ingest.horizonConfig.port | quote}}
SSE_UPDATE_FREQUENCY: {{ .Values.ingest.horizonConfig.sseUpdateFrequency | quote}}
STELLAR_CORE_BINARY_PATH: "/usr/bin/stellar-core"
STELLAR_CORE_URL: {{ .Values.ingest.horizonConfig.stellarCoreUrl | default "http://127.0.0.1:11626" | quote}}
STELLAR_CORE_URL: {{ .Values.ingest.horizonConfig.stellarCoreUrl | quote}}
TMPDIR: "/var/lib/stellar"
{{- end }}
8 changes: 4 additions & 4 deletions charts/horizon/templates/ingest-core-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "common.fullname" . }}-ingest-core
name: {{ include "common.fullname" . }}-ingest-core
namespace: {{ .Release.Namespace }}
labels:
app: {{ template "common.fullname" . }}-ingest-core
chart: {{ template "common.chart" . }}
app: {{ include "common.fullname" . }}-ingest-core
chart: {{ include "common.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
Expand All @@ -17,5 +17,5 @@ spec:
port: 11626
targetPort: 11626
selector:
app: {{ template "common.fullname" . }}-ingest
app: {{ include "common.fullname" . }}-ingest
{{- end }}
10 changes: 5 additions & 5 deletions charts/horizon/templates/ingest-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ template "common.fullname" . }}-ingest
name: {{ include "common.fullname" . }}-ingest
namespace: {{ .Release.Namespace }}
{{- if .Values.ingest.ingress.annotations }}
annotations:
{{- range $key, $value := .Values.ingest.ingress.annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
spec:
tls:
- secretName: {{ template "common.fullname" . }}-ingest-cert
- secretName: {{ include "common.fullname" . }}-ingest-cert
hosts:
- {{ .Values.ingest.ingress.host }}
rules:
Expand All @@ -24,7 +24,7 @@ spec:
pathType: Prefix
backend:
service:
name: {{ template "common.fullname" . }}-ingest
name: {{ include "common.fullname" . }}-ingest
port:
number: 80
{{- end }}
10 changes: 5 additions & 5 deletions charts/horizon/templates/ingest-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "common.fullname" . }}-ingest
name: {{ include "common.fullname" . }}-ingest
namespace: {{ .Release.Namespace }}
labels:
app: {{ template "common.fullname" . }}-ingest
chart: {{ template "common.chart" . }}
app: {{ include "common.fullname" . }}-ingest
chart: {{ include "common.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
type: ClusterIP
ports:
- name: horizon
port: 80
targetPort: {{ .Values.ingest.config.port }}
targetPort: {{ .Values.ingest.horizonConfig.port }}
selector:
app: {{ template "common.fullname" . }}-ingest
app: {{ include "common.fullname" . }}-ingest
{{- end }}
53 changes: 24 additions & 29 deletions charts/horizon/templates/ingest-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,82 +3,78 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ template "common.fullname" . }}-ingest
name: {{ include "common.fullname" . }}-ingest
namespace: {{ .Release.Namespace }}
labels:
app: {{ template "common.fullname" . }}-ingest
chart: {{ template "common.chart" . }}
app: {{ include "common.fullname" . }}-ingest
chart: {{ include "common.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
replicas: {{ .Values.ingest.replicaCount }}
serviceName: {{ template "common.fullname" . }}-ingest
serviceName: {{ include "common.fullname" . }}-ingest
selector:
matchLabels:
app: {{ template "common.fullname" . }}-ingest
app: {{ include "common.fullname" . }}-ingest
template:
metadata:
labels:
app: {{ template "common.fullname" . }}-ingest
app: {{ include "common.fullname" . }}-ingest
release: {{ .Release.Name }}
horizon_network: {{ .Values.global.network }}
{{- if .Values.ingest.labels }}
{{- if .Values.ingest.labels }}
{{- range $key, $value := .Values.ingest.labels }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.ingest.annotations }}
annotations:
{{- range $key, $value := .Values.ingest.annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
spec:
{{- if .Values.ingest.serviceAccountName }}
serviceAccountName: {{ .Values.ingest.serviceAccountName | default "default" }}
{{- end }}
serviceAccountName: {{ .Values.ingest.serviceAccountName }}
{{- if .Values.global.imagePullSecrets }}
imagePullSecrets:
{{ toYaml .Values.global.imagePullSecrets | indent 8 }}
imagePullSecrets: {{ toYaml .Values.global.imagePullSecrets | nindent 6 }}
{{- end }}
containers:
- name: horizon
image: {{ include "common.horizonImage" . | quote }}
{{- if .Values.ingest.cliArgs }}
args:
{{- range $flag := .Values.ingest.cliArgs }}
- {{ $flag | quote }}
{{- end }}
{{- range $flag := .Values.ingest.cliArgs }}
- {{ $flag | quote }}
{{- end }}
{{- end }}
imagePullPolicy: {{ .Values.global.image.horizon.pullPolicy }}
ports:
- containerPort: {{ .Values.ingest.horizonConfig.port | default 8000 }}
- containerPort: {{ .Values.ingest.horizonConfig.port }}
name: horizon
- containerPort: {{ .Values.ingest.horizonConfig.adminPort | default 6000 }}
- containerPort: {{ .Values.ingest.horizonConfig.adminPort }}
name: metrics
- containerPort: 11626
name: core
envFrom:
- secretRef:
name: {{ .Values.ingest.existingSecret }}
- configMapRef:
name: {{ template "common.fullname" . }}-ingest-env
name: {{ include "common.fullname" . }}-ingest-env
readinessProbe:
httpGet:
port: {{ .Values.ingest.horizonConfig.port | default 8000 }}
port: {{ .Values.ingest.horizonConfig.port }}
path: /health
initialDelaySeconds: 5
timeoutSeconds: 5
{{- if .Values.ingest.resources }}
resources:
{{ toYaml .Values.ingest.resources | indent 10 }}
resources: {{ toYaml .Values.ingest.resources | nindent 10 }}
{{- end }}
volumeMounts:
- mountPath: /config
name: core-config
{{- if .Values.ingest.persistence.enabled }}
- mountPath: /var/lib/stellar
name: {{ template "common.fullname" . }}-ingest-var-lib-stellar
name: {{ include "common.fullname" . }}-ingest-var-lib-stellar
{{- end }}
{{- if .Values.ingest.coreExporter.enabled }}
- name: stellar-core-prometheus-exporter
Expand All @@ -88,18 +84,17 @@ spec:
- containerPort: 9473
name: metrics
{{- if .Values.ingest.coreExporter.resources }}
resources:
{{ toYaml .Values.ingest.coreExporter.resources | indent 10 }}
resources: {{ toYaml .Values.ingest.coreExporter.resources | nindent 10 }}
{{- end }}
{{- end }}
volumes:
- name: core-config
configMap:
name: {{ template "common.fullname" . }}-core
name: {{ include "common.fullname" . }}-core
{{- if .Values.ingest.persistence.enabled }}
volumeClaimTemplates:
- metadata:
name: {{ template "common.fullname" . }}-ingest-var-lib-stellar
name: {{ include "common.fullname" . }}-ingest-var-lib-stellar
spec:
accessModes: ["ReadWriteOnce"]
storageClassName: {{ .Values.ingest.persistence.storageClass }}
Expand Down
34 changes: 17 additions & 17 deletions charts/horizon/templates/web-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,30 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "common.fullname" . }}-web-env
name: {{ include "common.fullname" . }}-web-env
namespace: {{ .Release.Namespace }}
labels:
app: {{ template "common.fullname" . }}-web
chart: {{ template "common.chart" . }}
app: {{ include "common.fullname" . }}-web
chart: {{ include "common.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
data:
ADMIN_PORT: {{ .Values.web.horizonConfig.adminPort | quote}}
ALLOW_EMPTY_LEDGER_DATA_RESPONSES: {{ .Values.web.horizonConfig.allowEmptyLedgerDataResponses | quote}}
CONNECTION_TIMEOUT: {{ .Values.web.horizonConfig.connectionTimeout | quote}}
ENABLE_ACCOUNTS_FOR_SIGNER: {{ .Values.web.horizonConfig.enableAccountsForSigner | quote}}
ENABLE_ASSET_STATS: {{ .Values.web.horizonConfig.enableAssetStats | quote}}
HISTORY_ARCHIVE_URLS: {{ include "horizon.historyArchiveUrls" . | quote }}
INGEST: "false"
PORT: {{ .Values.web.horizonConfig.port | default "8000" | quote}}
ADMIN_PORT: {{ .Values.web.horizonConfig.adminPort | default "6000" | quote}}
{{ if .Values.web.horizonConfig.stellarCoreUrl -}}
MAX_DB_CONNECTIONS: {{ .Values.web.horizonConfig.maxDBConnections | quote}}
MAX_PATH_LENGTH: {{ .Values.web.horizonConfig.maxPathLength | quote}}
NETWORK_PASSPHRASE: {{ include "horizon.networkPassphrase" . | quote }}
PER_HOUR_RATE_LIMIT: {{ .Values.web.horizonConfig.perHourRateLimit | quote}}
PORT: {{ .Values.web.horizonConfig.port | quote}}
SSE_UPDATE_FREQUENCY: {{ .Values.web.horizonConfig.sseUpdateFrequency | quote}}
{{- if .Values.web.horizonConfig.stellarCoreUrl -}}
STELLAR_CORE_URL: {{ .Values.web.horizonConfig.stellarCoreUrl | quote}}
{{- else }}
STELLAR_CORE_URL: http://{{ template "common.fullname" . }}-ingest-core:11626
STELLAR_CORE_URL: http://{{ include "common.fullname" . }}-ingest-core:11626
{{- end }}
PER_HOUR_RATE_LIMIT: {{ .Values.web.horizonConfig.perHourRateLimit | default "8000" | quote}}
MAX_DB_CONNECTIONS: {{ .Values.web.horizonConfig.maxDBConnections | default "20" | quote}}
SSE_UPDATE_FREQUENCY: {{ .Values.web.horizonConfig.SseUpdateFrequency | default "4" | quote}}
CONNECTION_TIMEOUT: {{ .Values.web.horizonConfig.connectionTimeout | default "10" | quote}}
ALLOW_EMPTY_LEDGER_DATA_RESPONSES: {{ .Values.web.horizonConfig.allowEmptyLedgerDataResponses | default "true" | quote}}
ENABLE_ASSET_STATS: {{ .Values.web.horizonConfig.enableAssetStats | default "true" | quote}}
ENABLE_ACCOUNTS_FOR_SIGNER: {{ .Values.web.horizonConfig.enableAccountsForSigner | default "false" | quote}}
MAX_PATH_LENGTH: {{ .Values.web.horizonConfig.maxPathLength | default "3" | quote}}
HISTORY_ARCHIVE_URLS: {{ include "horizon.historyArchiveUrls" . | quote }}
NETWORK_PASSPHRASE: {{ include "horizon.networkPassphrase" . | quote }}
{{- end }}
Loading

0 comments on commit b5dfa3f

Please sign in to comment.