New version of the common template. It unifies the naming convention between platform...
[it/dep.git] / ric-common / Common-Template / helm / ric-common / templates / _ingresscontroller.tpl
1 ################################################################################
2 #   Copyright (c) 2019 AT&T Intellectual Property.                             #
3 #   Copyright (c) 2019 Nokia.                                                  #
4 #                                                                              #
5 #   Licensed under the Apache License, Version 2.0 (the "License");            #
6 #   you may not use this file except in compliance with the License.           #
7 #   You may obtain a copy of the License at                                    #
8 #                                                                              #
9 #       http://www.apache.org/licenses/LICENSE-2.0                             #
10 #                                                                              #
11 #   Unless required by applicable law or agreed to in writing, software        #
12 #   distributed under the License is distributed on an "AS IS" BASIS,          #
13 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
14 #   See the License for the specific language governing permissions and        #
15 #   limitations under the License.                                             #
16 ################################################################################
17
18 {{/*
19   Resolve the ingress controller addresses.
20 */}}
21
22 ####################### Service URL #####################################
23 {{- define "common.ingressurl.ricplt" -}}
24   {{- if .Values.global -}}
25     {{- if .Values.global.ingressurl -}}
26       {{- if .Values.global.ingressurl.platform -}}
27         {{- printf "%s" .Values.global.ingressurl.platform -}}
28       {{- else -}}
29         {{- printf "ricplt-entry" -}}
30       {{- end -}}
31     {{- else -}}
32       {{- printf "ricplt-entry" -}}
33     {{- end -}}
34   {{- else -}}
35     {{- printf "ricplt-entry" -}}
36   {{- end -}}
37 {{- end -}}
38
39 {{- define "common.ingressurl.ricxapp" -}}
40   {{- if .Values.global -}}
41     {{- if .Values.global.ingressurl -}}
42       {{- if .Values.global.ingressurl.xapp -}}
43         {{- printf "%s" .Values.global.ingressurl.xapp -}}
44       {{- else -}}
45         {{- printf "ricxapp-entry" -}}
46       {{- end -}}
47     {{- else -}}
48       {{- printf "ricxapp-entry" -}}
49     {{- end -}}
50   {{- else -}}
51     {{- printf "ricxapp-entry" -}}
52   {{- end -}}
53 {{- end -}}
54
55 {{- define "common.ingressurl.ricaux" -}}
56   {{- if .Values.global -}}
57     {{- if .Values.global.ingressurl -}}
58       {{- if .Values.global.ingressurl.aux -}}
59         {{- printf "%s" .Values.global.ingressurl.aux -}}
60       {{- else -}}
61         {{- printf "ricaux-entry" -}}
62       {{- end -}}
63     {{- else -}}
64       {{- printf "ricaux-entry" -}}
65     {{- end -}}
66   {{- else -}}
67     {{- printf "ricaux-entry" -}}
68   {{- end -}}
69 {{- end -}}
70
71 {{- define "common.ingressurl.ricinfra" -}}
72   {{- if .Values.global -}}
73     {{- if .Values.global.ingressurl -}}
74       {{- if .Values.global.ingressurl.infra -}}
75         {{- printf "%s" .Values.global.ingressurl.infra -}}
76       {{- else -}}
77         {{- printf "ricinfra-entry" -}}
78       {{- end -}}
79     {{- else -}}
80       {{- printf "ricinfra-entry" -}}
81     {{- end -}}
82   {{- else -}}
83     {{- printf "ricinfra-entry" -}}
84   {{- end -}}
85 {{- end -}}
86
87 {{- define "common.ingressurl.localdocker" -}}
88   {{- if .Values.global -}}
89     {{- if .Values.global.ingressurl -}}
90       {{- if .Values.global.ingressurl.localdocker -}}
91         {{- printf "%s" .Values.global.ingressurl.localdocker -}}
92       {{- else -}}
93         {{- printf "docker-entry" -}}
94       {{- end -}}
95     {{- else -}}
96       {{- printf "docker-entry" -}}
97     {{- end -}}
98   {{- else -}}
99     {{- printf "docker-entry" -}}
100   {{- end -}}
101 {{- end -}}
102
103 {{- define "common.ingressurl.localhelm" -}}
104   {{- if .Values.global -}}
105     {{- if .Values.global.ingressurl -}}
106       {{- if .Values.global.ingressurl.localhelm -}}
107         {{- printf "%s" .Values.global.ingressurl.localhelm -}}
108       {{- else -}}
109         {{- printf "helm-entry" -}}
110       {{- end -}}
111     {{- else -}}
112       {{- printf "helm-entry" -}}
113     {{- end -}}
114   {{- else -}}
115     {{- printf "helm-entry" -}}
116   {{- end -}}
117 {{- end -}}
118
119
120 {{- define "common.ingressurl.localnexus" -}}
121   {{- if .Values.global -}}
122     {{- if .Values.global.ingressurl -}}
123       {{- if .Values.global.ingressurl.localnexus -}}
124         {{- printf "%s" .Values.global.ingressurl.localnexus -}}
125       {{- else -}}
126         {{- printf "nexus-entry" -}}
127       {{- end -}}
128     {{- else -}}
129       {{- printf "nexus-entry" -}}
130     {{- end -}}
131   {{- else -}}
132     {{- printf "nexus-entry" -}}
133   {{- end -}}
134 {{- end -}}
135
136
137
138
139
140
141 ####################### Ingress Controller Ports ###########################################
142 ## Currently the below values are hard-coded due to the fact that kong ingress controller  #
143 ## helm charts are not using this common template. We need to make sure that these values  #
144 ## agree with the values in the kong helm charts values.yaml files.                        #
145 ############################################################################################  
146 {{- define "common.ingresshttpport.ricplt" -}}
147   {{- printf "30080" -}}
148 {{- end -}}
149
150 {{- define "common.ingresshttpsport.ricplt" -}}
151   {{- printf "30443" -}}
152 {{- end -}}
153
154
155 {{- define "common.ingresshttpport.ricxapp" -}}
156   {{- printf "31080" -}}
157 {{- end -}}
158
159
160 {{- define "common.ingresshttpsport.ricxapp" -}}
161   {{- printf "31443" -}}
162 {{- end -}}
163
164
165 {{- define "common.ingresshttpport.ricaux" -}}
166   {{- printf "32080" -}}
167 {{- end -}}
168
169 {{- define "common.ingresshttpsport.ricaux" -}}
170   {{- printf "32443" -}}
171 {{- end -}}
172
173
174 {{- define "common.ingresshttpport.ricinfra" -}}
175   {{- printf "33080" -}}
176 {{- end -}}
177
178
179
180 {{- define "common.ingresshttpsport.ricinfra" -}}
181   {{- printf "33443" -}}
182 {{- end -}}
183