{{- if .Values.ingress.enabled -}}
{{- $fullName := include "cla-public.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: {{ $fullName }}
  labels:
    {{- include "cla-public.labels" . | nindent 4 }}
  {{- with .Values.ingress.annotations }}
  annotations:
    {{- if .Values.ingress.redirectFrom -}}
    nginx.ingress.kubernetes.io/proxy-redirect-from: {{ .Values.ingress.redirectFrom }}
    nginx.ingress.kubernetes.io/proxy-redirect-to: {{ .Values.hostName }}
    {{- else -}}
    {{- toYaml . | nindent 4 }}
    {{- end }}
  {{- end }}
spec:
  tls:
    - hosts:
       - "{{ .Values.host }}"
      secretName: {{ .Values.ingress.secretName }}
  rules:
    - host: "{{ .Values.host }}"
      http:
        paths:
          - path: "/"
            backend:
              serviceName: {{ $fullName }}-app
              servicePort: {{ $svcPort }}
{{- end }}

{{- if .Values.ingress.enabled -}}
{{- $fullName := include "cla-public.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: {{ $fullName }}
  labels:
    {{- include "cla-public.labels" . | nindent 4 }}
  {{- with .Values.ingress.annotations }}
  annotations:
    {{- if .Values.ingress.redirectFrom -}}
    nginx.ingress.kubernetes.io/proxy-redirect-from: https://{{ .Values.ingress.redirectFrom }}
    nginx.ingress.kubernetes.io/proxy-redirect-to: https://{{ .Values.hostName }}
    {{- else -}}
    {{- toYaml . | nindent 4 }}
    {{- end }}
  {{- end }}
spec:
  tls:
    - hosts:
       - "{{ .Values.host }}"
      secretName: {{ .Values.ingress.secretName }}
  rules:
    - host: "{{ .Values.host }}"
      http:
        paths:
          - path: "/"
            backend:
              serviceName: {{ $fullName }}-app
              servicePort: {{ $svcPort }}
{{- end }}

Add https schema to redirect annotations
Add https schema to redirect annotations
