diff --git a/.github/workflows/testcharts.yaml b/.github/workflows/testcharts.yaml index d29ddb9b4..b43039e65 100644 --- a/.github/workflows/testcharts.yaml +++ b/.github/workflows/testcharts.yaml @@ -81,6 +81,7 @@ jobs: kubectl wait --for=condition=available --timeout=60s deploy/httpbin - name: Install controller + if: steps.modified-files.outputs.any_modified == 'true' run: | helm install iter8 charts/controller --set logLevel=trace kubectl rollout status --watch --timeout=60s statefulset/iter8 @@ -97,6 +98,7 @@ jobs: kubectl wait --for=condition=complete --timeout=180s job/default-1-job - name: Get Kubernetes status + if: steps.modified-files.outputs.any_modified == 'true' run: | kubectl get all @@ -107,10 +109,12 @@ jobs: iter8 k delete - name: Expose metrics service + if: steps.modified-files.outputs.any_modified == 'true' run: | kubectl port-forward service/iter8 8080:8080 & - name: Check GET /httpDashboard + if: steps.modified-files.outputs.any_modified == 'true' run: | curl "http://localhost:8080/httpDashboard?namespace=default&experiment=default" -f @@ -151,6 +155,7 @@ jobs: kubectl wait --for=condition=available --timeout=60s deploy/httpbin - name: Install controller + if: steps.modified-files.outputs.any_modified == 'true' run: | helm install iter8 charts/controller --set logLevel=trace kubectl rollout status --watch --timeout=60s statefulset/iter8 @@ -168,6 +173,7 @@ jobs: kubectl wait --for=condition=complete --timeout=180s job/default-1-job - name: Get Kubernetes status + if: steps.modified-files.outputs.any_modified == 'true' run: | kubectl get all @@ -178,10 +184,12 @@ jobs: iter8 k delete - name: Expose metrics service + if: steps.modified-files.outputs.any_modified == 'true' run: | kubectl port-forward service/iter8 8080:8080 & - name: Check GET /httpDashboard + if: steps.modified-files.outputs.any_modified == 'true' run: | curl "http://localhost:8080/httpDashboard?namespace=default&experiment=default" -f @@ -222,6 +230,7 @@ jobs: kubectl wait --for=condition=available --timeout=60s deploy/httpbin - name: Install controller + if: steps.modified-files.outputs.any_modified == 'true' run: | helm install iter8 charts/controller --set logLevel=trace kubectl rollout status --watch --timeout=60s statefulset/iter8 @@ -241,6 +250,7 @@ jobs: kubectl wait --for=condition=complete --timeout=180s job/default-1-job - name: Get Kubernetes status + if: steps.modified-files.outputs.any_modified == 'true' run: | kubectl get all @@ -251,10 +261,12 @@ jobs: iter8 k delete - name: Expose metrics service + if: steps.modified-files.outputs.any_modified == 'true' run: | kubectl port-forward service/iter8 8080:8080 & - name: Check GET /httpDashboard + if: steps.modified-files.outputs.any_modified == 'true' run: | curl "http://localhost:8080/httpDashboard?namespace=default&experiment=default" -f @@ -304,6 +316,7 @@ jobs: kubectl logs deploy/sleep - name: Install controller + if: steps.modified-files.outputs.any_modified == 'true' run: | helm install iter8 charts/controller --set logLevel=trace kubectl rollout status --watch --timeout=60s statefulset/iter8 @@ -326,6 +339,7 @@ jobs: kubectl wait --for=condition=complete --timeout=180s job/default-1-job - name: Get Kubernetes status + if: steps.modified-files.outputs.any_modified == 'true' run: | kubectl get all @@ -336,10 +350,12 @@ jobs: iter8 k delete - name: Expose metrics service + if: steps.modified-files.outputs.any_modified == 'true' run: | kubectl port-forward service/iter8 8080:8080 & - name: Check GET /grpcDashboard + if: steps.modified-files.outputs.any_modified == 'true' run: | curl "http://localhost:8080/grpcDashboard?namespace=default&experiment=default" -f @@ -389,6 +405,7 @@ jobs: kubectl logs deploy/sleep - name: Install controller + if: steps.modified-files.outputs.any_modified == 'true' run: | helm install iter8 charts/controller --set logLevel=trace kubectl rollout status --watch --timeout=60s statefulset/iter8 @@ -413,6 +430,7 @@ jobs: kubectl wait --for=condition=complete --timeout=180s job/default-1-job - name: Get Kubernetes status + if: steps.modified-files.outputs.any_modified == 'true' run: | kubectl get all @@ -423,10 +441,12 @@ jobs: iter8 k delete - name: Expose metrics service + if: steps.modified-files.outputs.any_modified == 'true' run: | kubectl port-forward service/iter8 8080:8080 & - name: Check GET /grpcDashboard + if: steps.modified-files.outputs.any_modified == 'true' run: | curl "http://localhost:8080/grpcDashboard?namespace=default&experiment=default" -f @@ -467,6 +487,7 @@ jobs: kubectl wait --for=condition=available --timeout=60s deploy/hello - name: Install controller + if: steps.modified-files.outputs.any_modified == 'true' run: | helm install iter8 charts/controller --set logLevel=trace kubectl rollout status --watch --timeout=60s statefulset/iter8 @@ -485,6 +506,7 @@ jobs: kubectl wait --for=condition=complete --timeout=180s job/default-1-job - name: Get Kubernetes status + if: steps.modified-files.outputs.any_modified == 'true' run: | kubectl get all @@ -495,9 +517,11 @@ jobs: iter8 k delete - name: Expose metrics service + if: steps.modified-files.outputs.any_modified == 'true' run: | kubectl port-forward service/iter8 8080:8080 & - name: Check GET /grpcDashboard + if: steps.modified-files.outputs.any_modified == 'true' run: | curl "http://localhost:8080/grpcDashboard?namespace=default&experiment=default" -f \ No newline at end of file diff --git a/charts/routing-actions/Chart.yaml b/charts/routing-actions/Chart.yaml index 5d6eb544a..ac823da39 100644 --- a/charts/routing-actions/Chart.yaml +++ b/charts/routing-actions/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: routing-actions -version: 0.1.3 +version: 0.1.4 description: Iter8 routing actions type: application keywords: diff --git a/charts/routing-actions/templates/_helpers.tpl b/charts/routing-actions/templates/_helpers.tpl index 30b999b9a..c7e0a14b1 100644 --- a/charts/routing-actions/templates/_helpers.tpl +++ b/charts/routing-actions/templates/_helpers.tpl @@ -31,3 +31,11 @@ {{- end }} {{- mustToJson $mV }} {{- end }} + +{{- define "kserve.host" }} +{{- if eq "kserve-0.10" .Values.appType -}} +predictor-default.{{ .Release.Namespace }}.svc.cluster.local +{{- else }} {{- /* kserve-0.11 or kserve */ -}} +predictor.{{ .Release.Namespace }}.svc.cluster.local +{{- end }} +{{- end }} {{- /* define "kserve.host" */ -}} diff --git a/charts/routing-actions/templates/_kserve.routemap-bg.tpl b/charts/routing-actions/templates/_kserve.routemap-bg.tpl index ab870e0d9..9e5570a0e 100644 --- a/charts/routing-actions/templates/_kserve.routemap-bg.tpl +++ b/charts/routing-actions/templates/_kserve.routemap-bg.tpl @@ -53,7 +53,7 @@ data: headers: request: set: - Host: {{ (index $versions 0).name }}-predictor-default.{{ .Release.Namespace }}.svc.cluster.local + Host: {{ (index $versions 0).name }}-{{ template "kserve.host" $ }} remove: - branch response: @@ -76,7 +76,7 @@ data: headers: request: set: - Host: {{ (index $versions (add1 $i)).name }}-predictor-default.{{ $.Release.Namespace }}.svc.cluster.local + Host: {{ (index $versions (add1 $i)).name }}-{{ template "kserve.host" $ }} remove: - branch response: diff --git a/charts/routing-actions/templates/_kserve.routemap-canary.tpl b/charts/routing-actions/templates/_kserve.routemap-canary.tpl index 111619dda..b492c1b9e 100644 --- a/charts/routing-actions/templates/_kserve.routemap-canary.tpl +++ b/charts/routing-actions/templates/_kserve.routemap-canary.tpl @@ -61,7 +61,7 @@ data: headers: request: set: - Host: {{ (index $versions (add1 $i)).name }}-predictor-default.{{ $.Release.Namespace }}.svc.cluster.local + Host: {{ (index $versions (add1 $i)).name }}-{{ template "kserve.host" $ }} response: add: app-version: "{{ (index $versions (add1 $i)).name }}" @@ -76,7 +76,7 @@ data: headers: request: set: - Host: {{ (index $versions 0).name }}-predictor-default.{{ .Release.Namespace }}.svc.cluster.local + Host: {{ (index $versions 0).name }}-{{ template "kserve.host" $ }} response: add: app-version: "{{ (index $versions 0).name }}" diff --git a/charts/routing-actions/templates/_kserve.virtualservice-bg.tpl b/charts/routing-actions/templates/_kserve.virtualservice-bg.tpl index 3d203cabb..b3ad2f69c 100644 --- a/charts/routing-actions/templates/_kserve.virtualservice-bg.tpl +++ b/charts/routing-actions/templates/_kserve.virtualservice-bg.tpl @@ -28,7 +28,7 @@ spec: headers: request: set: - Host: {{ (index $versions 0).name }}-predictor-default.{{ .Release.Namespace }}.svc.cluster.local + Host: {{ (index $versions 0).name }}-{{ template "kserve.host" $ }} remove: - branch response: diff --git a/charts/routing-actions/templates/_kserve.virtualservice-canary.tpl b/charts/routing-actions/templates/_kserve.virtualservice-canary.tpl index 002314b99..005bc1a25 100644 --- a/charts/routing-actions/templates/_kserve.virtualservice-canary.tpl +++ b/charts/routing-actions/templates/_kserve.virtualservice-canary.tpl @@ -23,7 +23,7 @@ spec: headers: request: set: - Host: {{ (index $versions 0).name }}-predictor-default.{{ .Release.Namespace }}.svc.cluster.local + Host: {{ (index $versions 0).name }}-{{ template "kserve.host" $ }} response: add: app-version: {{ (index $versions 0).name }} diff --git a/charts/routing-actions/templates/traffic.yaml b/charts/routing-actions/templates/traffic.yaml index b8e7ac713..948e1b389 100644 --- a/charts/routing-actions/templates/traffic.yaml +++ b/charts/routing-actions/templates/traffic.yaml @@ -6,7 +6,7 @@ {{- end }} {{- /* validate values for appType */}} -{{- if not (has .Values.appType (list "kserve-modelmesh" "kserve" "deployment")) }} +{{- if not (has .Values.appType (list "kserve-modelmesh" "kserve" "kserve=0.11" "kserve-0.10" "deployment")) }} {{- printf "Unknown appType: '%s'" .Values.appType | fail }} {{- end }} diff --git a/charts/routing-actions/values.yaml b/charts/routing-actions/values.yaml index 7bbbdd472..9c6bd3558 100644 --- a/charts/routing-actions/values.yaml +++ b/charts/routing-actions/values.yaml @@ -23,7 +23,8 @@ externalGateway: mm-gateway ### required fields are: -# Application type. Valid values are 'deployment', 'kserve' and 'kserve-modelmesh' +# Application type. Valid values are 'deployment', 'kserve-modelmesh', 'kserve', 'kserver-0.11', 'kserve-0.10' +# The value 'kserve' refers to the most recent version, 'kserve-0.11' # appType: # Traffic strategy. Valid values are 'blue-green' or 'canary' # strategy: @@ -53,7 +54,8 @@ externalGateway: mm-gateway ### required fields are: -# Application type. Valid values are 'kserve' and 'kserve-modelmesh' +# Application type. Valid values are 'deployment', 'kserve-modelmesh', 'kserve', 'kserver-0.11', 'kserve-0.10' +# The value 'kserve' refers to the most recent version, 'kserve-0.11' # appType: # Traffic strategy. Valid values are 'blue-green' or 'canary' # strategy: