From b657a3ec3cc3724e3bccd6becb0a131efc6bdb35 Mon Sep 17 00:00:00 2001 From: Traver Tischio Date: Tue, 22 Oct 2024 15:09:54 -0400 Subject: [PATCH] Break horizon resources into separate files --- charts/horizon/templates/core-configmap.yaml | 2 + .../templates/ingest-core-service.yaml | 21 ++++++++++ .../{ingress.yaml => ingest-ingress.yaml} | 30 --------------- charts/horizon/templates/ingest-service.yaml | 21 ++++++++++ .../horizon/templates/ingest-statefulset.yaml | 38 ------------------- charts/horizon/templates/web-deployment.yaml | 19 ---------- charts/horizon/templates/web-ingress.yaml | 30 +++++++++++++++ charts/horizon/templates/web-service.yaml | 21 ++++++++++ 8 files changed, 95 insertions(+), 87 deletions(-) create mode 100644 charts/horizon/templates/ingest-core-service.yaml rename charts/horizon/templates/{ingress.yaml => ingest-ingress.yaml} (50%) create mode 100644 charts/horizon/templates/ingest-service.yaml create mode 100644 charts/horizon/templates/web-ingress.yaml create mode 100644 charts/horizon/templates/web-service.yaml diff --git a/charts/horizon/templates/core-configmap.yaml b/charts/horizon/templates/core-configmap.yaml index 8595757..20cb91b 100644 --- a/charts/horizon/templates/core-configmap.yaml +++ b/charts/horizon/templates/core-configmap.yaml @@ -1,3 +1,4 @@ +{{- if .Values.ingest.enabled }} --- apiVersion: v1 kind: ConfigMap @@ -12,3 +13,4 @@ metadata: data: stellar-core.cfg: | {{ include "core.config" . | indent 4 }} +{{- end }} diff --git a/charts/horizon/templates/ingest-core-service.yaml b/charts/horizon/templates/ingest-core-service.yaml new file mode 100644 index 0000000..e31237a --- /dev/null +++ b/charts/horizon/templates/ingest-core-service.yaml @@ -0,0 +1,21 @@ +{{- if .Values.ingest.enabled }} +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ template "common.fullname" . }}-ingest-core + namespace: {{ .Release.Namespace }} + labels: + app: {{ template "common.fullname" . }}-ingest-core + chart: {{ template "common.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + type: ClusterIP + ports: + - name: core + port: 11626 + targetPort: 11626 + selector: + app: {{ template "common.fullname" . }}-ingest +{{- end }} diff --git a/charts/horizon/templates/ingress.yaml b/charts/horizon/templates/ingest-ingress.yaml similarity index 50% rename from charts/horizon/templates/ingress.yaml rename to charts/horizon/templates/ingest-ingress.yaml index 8992435..e876778 100644 --- a/charts/horizon/templates/ingress.yaml +++ b/charts/horizon/templates/ingest-ingress.yaml @@ -28,33 +28,3 @@ spec: port: number: 80 {{- end }} -{{- if and .Values.web.enabled .Values.web.ingress.enabled }} ---- -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: {{ template "common.fullname" . }}-web - namespace: {{ .Release.Namespace }} - {{- if .Values.web.ingress.annotations }} - annotations: - {{- range $key, $value := .Values.web.ingress.annotations }} - {{ $key }}: {{ $value | quote }} - {{- end }} - {{- end }} -spec: - tls: - - secretName: {{ template "common.fullname" . }}-web-cert - hosts: - - {{ .Values.web.ingress.host }} - rules: - - host: {{ .Values.web.ingress.host }} - http: - paths: - - path: / - pathType: Prefix - backend: - service: - name: {{ template "common.fullname" . }}-web - port: - number: 80 -{{- end }} diff --git a/charts/horizon/templates/ingest-service.yaml b/charts/horizon/templates/ingest-service.yaml new file mode 100644 index 0000000..a85139e --- /dev/null +++ b/charts/horizon/templates/ingest-service.yaml @@ -0,0 +1,21 @@ +{{- if .Values.ingest.enabled }} +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ template "common.fullname" . }}-ingest + namespace: {{ .Release.Namespace }} + labels: + app: {{ template "common.fullname" . }}-ingest + chart: {{ template "common.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + type: ClusterIP + ports: + - name: horizon + port: 80 + targetPort: {{ .Values.ingest.config.port }} + selector: + app: {{ template "common.fullname" . }}-ingest +{{- end }} diff --git a/charts/horizon/templates/ingest-statefulset.yaml b/charts/horizon/templates/ingest-statefulset.yaml index 6c1fdb8..decc611 100644 --- a/charts/horizon/templates/ingest-statefulset.yaml +++ b/charts/horizon/templates/ingest-statefulset.yaml @@ -107,42 +107,4 @@ spec: requests: storage: {{ .Values.ingest.persistence.size | quote }} {{- end }} ---- -apiVersion: v1 -kind: Service -metadata: - name: {{ template "common.fullname" . }}-ingest-core - namespace: {{ .Release.Namespace }} - labels: - app: {{ template "common.fullname" . }}-ingest-core - chart: {{ template "common.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -spec: - type: ClusterIP - ports: - - name: core - port: 11626 - targetPort: 11626 - selector: - app: {{ template "common.fullname" . }}-ingest ---- -apiVersion: v1 -kind: Service -metadata: - name: {{ template "common.fullname" . }}-ingest - namespace: {{ .Release.Namespace }} - labels: - app: {{ template "common.fullname" . }}-ingest - chart: {{ template "common.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -spec: - type: ClusterIP - ports: - - name: horizon - port: 80 - targetPort: {{ .Values.ingest.horizonConfig.port | default 8000 }} - selector: - app: {{ template "common.fullname" . }}-ingest {{- end }} diff --git a/charts/horizon/templates/web-deployment.yaml b/charts/horizon/templates/web-deployment.yaml index b6dc6e2..f104418 100644 --- a/charts/horizon/templates/web-deployment.yaml +++ b/charts/horizon/templates/web-deployment.yaml @@ -70,23 +70,4 @@ spec: resources: {{ toYaml .Values.web.resources | indent 10 }} {{- end }} ---- -apiVersion: v1 -kind: Service -metadata: - name: {{ template "common.fullname" . }}-web - namespace: {{ .Release.Namespace }} - labels: - app: {{ template "common.fullname" . }}-web - chart: {{ template "common.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -spec: - type: ClusterIP - ports: - - name: core - port: 80 - targetPort: {{ .Values.web.horizonConfig.port | default 8000 }} - selector: - app: {{ template "common.fullname" . }}-web {{- end }} diff --git a/charts/horizon/templates/web-ingress.yaml b/charts/horizon/templates/web-ingress.yaml new file mode 100644 index 0000000..7483580 --- /dev/null +++ b/charts/horizon/templates/web-ingress.yaml @@ -0,0 +1,30 @@ +{{- if and .Values.web.enabled .Values.web.ingress.enabled }} +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ template "common.fullname" . }}-web + namespace: {{ .Release.Namespace }} + {{- if .Values.web.ingress.annotations }} + annotations: + {{- range $key, $value := .Values.web.ingress.annotations }} + {{ $key }}: {{ $value | quote }} + {{- end }} + {{- end }} +spec: + tls: + - secretName: {{ template "common.fullname" . }}-web-cert + hosts: + - {{ .Values.web.ingress.host }} + rules: + - host: {{ .Values.web.ingress.host }} + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: {{ template "common.fullname" . }}-web + port: + number: 80 +{{- end }} diff --git a/charts/horizon/templates/web-service.yaml b/charts/horizon/templates/web-service.yaml new file mode 100644 index 0000000..89ba726 --- /dev/null +++ b/charts/horizon/templates/web-service.yaml @@ -0,0 +1,21 @@ +{{- if .Values.web.enabled }} +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ template "common.fullname" . }}-web + namespace: {{ .Release.Namespace }} + labels: + app: {{ template "common.fullname" . }}-web + chart: {{ template "common.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + type: ClusterIP + ports: + - name: core + port: 80 + targetPort: {{ .Values.web.config.port }} + selector: + app: {{ template "common.fullname" . }}-web +{{- end }}