{{- if .Values.ingress.enabled }} apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: {{ include "cloudhost-platform.fullname" . }} namespace: {{ include "cloudhost-platform.namespace" . }} labels: {{- include "cloudhost-platform.labels" . | nindent 4 }} annotations: {{- if and .Values.ingress.tls.enabled (not .Values.ingress.tls.secretName) }} cert-manager.io/cluster-issuer: {{ .Values.ingress.tls.clusterIssuer | quote }} {{- end }} {{- if and .Values.ingress.singleHost.enabled .Values.ingress.singleHost.apiPath }} nginx.ingress.kubernetes.io/use-regex: "true" {{- end }} {{- with .Values.ingress.annotations }} {{- toYaml . | nindent 4 }} {{- end }} spec: ingressClassName: {{ .Values.ingress.className }} {{- if .Values.ingress.tls.enabled }} tls: - hosts: {{- if .Values.ingress.singleHost.enabled }} - {{ .Values.ingress.singleHost.host | quote }} {{- else }} - {{ .Values.ingress.frontend.host | quote }} {{- if .Values.ingress.panel.host }} - {{ .Values.ingress.panel.host | quote }} {{- end }} - {{ .Values.ingress.api.host | quote }} {{- end }} secretName: {{ include "cloudhost-platform.tlsSecretName" . }} {{- end }} rules: {{- if .Values.ingress.singleHost.enabled }} - host: {{ .Values.ingress.singleHost.host | quote }} http: paths: - path: {{ .Values.ingress.singleHost.apiPath }} pathType: Prefix backend: service: name: {{ include "cloudhost-platform.backend.fullname" . }} port: number: 4000 - path: / pathType: Prefix backend: service: name: {{ include "cloudhost-platform.frontend.fullname" . }} port: number: 3000 {{- else }} - host: {{ .Values.ingress.frontend.host | quote }} http: paths: - path: / pathType: Prefix backend: service: name: {{ include "cloudhost-platform.frontend.fullname" . }} port: number: 3000 {{- if .Values.ingress.panel.host }} - host: {{ .Values.ingress.panel.host | quote }} http: paths: - path: / pathType: Prefix backend: service: name: {{ include "cloudhost-platform.frontend.fullname" . }} port: number: 3000 {{- end }} - host: {{ .Values.ingress.api.host | quote }} http: paths: - path: / pathType: Prefix backend: service: name: {{ include "cloudhost-platform.backend.fullname" . }} port: number: 4000 {{- end }} {{- end }}