|
10 | 10 | {{- printf "Unknown appType: '%s'" .Values.appType | fail }}
|
11 | 11 | {{- end }}
|
12 | 12 |
|
| 13 | +{{- /* set strategy using default value if needed */}} |
| 14 | +{{- $strategy := (.Values.strategy | default "none" ) }} |
| 15 | + |
13 | 16 | {{- /* validate values for strategy */}}
|
14 |
| -{{- if not (has .Values.strategy (list "blue-green" "canary")) }} |
15 |
| - {{- printf "Unknown strategy: '%s'" .Values.strategy | fail }} |
| 17 | +{{- if not (has $strategy (list "blue-green" "canary" "none")) }} |
| 18 | + {{- printf "Unknown strategy: '%s'" $strategy | fail }} |
16 | 19 | {{- end }}
|
17 | 20 |
|
18 | 21 | {{- /* handle initialize */}}
|
19 | 22 | {{- if eq "initialize" .Values.action }}
|
20 | 23 |
|
21 | 24 | {{- /* gateway needed for kserve-modelmesh, deployment */}}
|
| 25 | + {{- if ne "none" $strategy }} |
22 | 26 | {{- if has .Values.appType (list "kserve-modelmesh" "deployment") }}
|
23 | 27 | {{ include "initial.gateway" . }}
|
24 | 28 | {{- end }}
|
| 29 | + {{- end }} |
25 | 30 | ---
|
| 31 | + {{- if ne "none" $strategy }} |
26 | 32 | {{- if eq "deployment" .Values.appType }}
|
27 | 33 | {{ include "deployment.virtualservice" . }}
|
28 | 34 | {{- else if eq "kserve-modelmesh" .Values.appType }}
|
29 | 35 | {{ include "mm.virtualservice" . }}
|
30 | 36 | {{- else }} {{- /* eq "kserve" .Values.appType */}}
|
31 |
| - {{- if eq "blue-green" .Values.strategy }} |
| 37 | + {{- if eq "blue-green" $strategy }} |
32 | 38 | {{ include "kserve.virtualservice-bluegreen" . }}
|
33 |
| - {{- else }} {{- /* eq "canary" .Values.strategy */}} |
| 39 | + {{- else }} {{- /* eq "canary" $strategy */}} |
34 | 40 | {{ include "kserve.virtualservice-canary" . }}
|
35 | 41 | {{- end }}
|
36 | 42 | {{- end }}
|
| 43 | + {{- end }} |
37 | 44 | ---
|
| 45 | + {{- if ne "none" $strategy }} |
38 | 46 | {{- if eq "deployment" .Values.appType }}
|
39 | 47 | {{ include "deployment.service" . }}
|
40 | 48 | {{- else if eq "kserve-modelmesh" .Values.appType }}
|
41 | 49 | {{ include "mm.serviceentry" . }}
|
42 | 50 | {{- else }} {{- /* eq "kserve" .Values.appType */}}
|
43 | 51 | {{ include "kserve.service" . }}
|
44 | 52 | {{- end }}
|
| 53 | + {{- end }} |
45 | 54 | ---
|
46 | 55 | {{- if eq "deployment" .Values.appType }}
|
47 |
| - {{- if eq "blue-green" .Values.strategy }} |
| 56 | + {{- if eq "none" $strategy }} |
| 57 | + {{ include "deployment.routemap-none" . }} |
| 58 | + {{- else if eq "blue-green" $strategy }} |
48 | 59 | {{ include "deployment.routemap-bluegreen" . }}
|
49 |
| - {{- else }} {{- /* eq "canary" .Values.strategy */}} |
| 60 | + {{- else }} {{- /* eq "canary" $strategy */}} |
50 | 61 | {{ include "deployment.routemap-canary" . }}
|
51 | 62 | {{- end }}
|
52 | 63 | {{- else if eq "kserve-modelmesh" .Values.appType }}
|
53 |
| - {{- if eq "blue-green" .Values.strategy }} |
| 64 | + {{- if eq "none" $strategy }} |
| 65 | + {{ include "mm.routemap-none" . }} |
| 66 | + {{- else if eq "blue-green" $strategy }} |
54 | 67 | {{ include "mm.routemap-bluegreen" . }}
|
55 |
| - {{- else }} {{- /* eq "canary" .Values.strategy */}} |
| 68 | + {{- else }} {{- /* eq "canary" $strategy */}} |
56 | 69 | {{ include "mm.routemap-canary" . }}
|
57 | 70 | {{- end }}
|
58 | 71 | {{- else }} {{- /* eq "kserve" .Values.appType */}}
|
59 |
| - {{- if eq "blue-green" .Values.strategy }} |
| 72 | + {{- if eq "none" $strategy }} |
| 73 | + {{ include "kserve.routemap-none" . }} |
| 74 | + {{- else if eq "blue-green" $strategy }} |
60 | 75 | {{ include "kserve.routemap-bluegreen" . }}
|
61 |
| - {{- else }} {{- /* eq "canary" .Values.strategy */}} |
| 76 | + {{- else }} {{- /* eq "canary" $strategy */}} |
62 | 77 | {{ include "kserve.routemap-canary" . }}
|
63 | 78 | {{- end }}
|
64 | 79 | {{- end }}
|
65 | 80 | ---
|
66 |
| - {{- if eq "blue-green" .Values.strategy }} |
| 81 | + {{- if eq "blue-green" $strategy }} |
67 | 82 | {{- range $i, $v := $versions }}
|
68 | 83 | {{ include "create.weight-config" (unset $v "weight") }}
|
69 | 84 | ---
|
70 | 85 | {{- end }}
|
71 |
| - {{- else if eq "mirror" .Values.strategy }} |
| 86 | + {{- else if eq "mirror" $strategy }} |
72 | 87 | {{- range $i, $v := (rest $versions) }}
|
73 | 88 | {{ include "create.weight-config" (unset $v "weight") }}
|
74 | 89 | ---
|
75 | 90 | {{- end }}
|
76 | 91 | {{- end }}
|
77 | 92 |
|
78 | 93 | {{- else if eq "modify-weights" .Values.action }}
|
79 |
| - {{- if eq "blue-green" .Values.strategy }} |
| 94 | + {{- if eq "blue-green" $strategy }} |
80 | 95 | {{- range $i, $v := .Values.appVersions }}
|
81 | 96 | {{ include "create.weight-config" $v }}
|
82 | 97 | ---
|
83 | 98 | {{- end }}
|
84 |
| - {{- else if eq "mirror" .Values.strategy }} |
| 99 | + {{- else if eq "mirror" $strategy }} |
85 | 100 | {{- range $i, $v := (rest $versions) }}
|
86 | 101 | {{ include "create.weight-config" (set $v "weight" $.Values.mirrorPercentage) }}
|
87 | 102 | ---
|
|
0 commit comments