################################################################################
# Copyright (c) 2019 AT&T Intellectual Property. #
-# Copyright (c) 2019 Nokia. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
# you may not use this file except in compliance with the License. #
# limitations under the License. #
################################################################################
-apiVersion: v1
-kind: Service
+{{- if .Values.ingress.enabled -}}
+{{- $fullName := include "fullname" . -}}
+{{- $servicePort := .Values.service.port -}}
+{{- $ingressPath := .Values.ingress.path -}}
+apiVersion: networking.k8s.io/v1beta1
+kind: Ingress
metadata:
- name: {{ include "ricxapp.servicename.rmr" . }}
- namespace: {{ include "ricxapp.namespace" . }}
+ name: {{ $fullName }}
labels:
- app: {{ include "ricxapp.namespace" . }}-{{ include "ricxapp.name" . }}
- chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
+ app: {{ .Chart.Name }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
+{{- with .Values.ingress.annotations }}
+ annotations:
+{{ toYaml . | indent 4 }}
+{{- end }}
spec:
- type: ClusterIP
- ports:
- - port: {{ .Values.ricxapp.service.rmr.data.port }}
- targetPort: rmrdata
- protocol: TCP
- name: rmrdata
- - port: {{ .Values.ricxapp.service.rmr.route.port }}
- targetPort: rmrroute
- protocol: TCP
- name: rmrroute
- selector:
- app: {{ include "ricxapp.namespace" . }}-{{ include "ricxapp.name" . }}
- release: {{ .Release.Name }}
+{{- if .Values.ingress.tls }}
+ tls:
+{{ toYaml .Values.ingress.tls | indent 4 }}
+{{- end }}
+ rules:
+ {{- range .Values.ingress.hosts }}
+ - host: {{ . }}
+ http:
+ paths:
+ - path: {{ $ingressPath }}
+ backend:
+ serviceName: {{ $fullName }}
+ servicePort: {{ $servicePort }}
+ {{- end }}
+{{- end }}