<p>Ref:
<a href="https://github.com/SeldonIO/seldon-core/blob/master/examples/models/sklearn_iris/sklearn_iris.ipynb" rel="nofollow noreferrer">https://github.com/SeldonIO/seldon-core/blob/master/examples/models/sklearn_iris/sklearn_iris.ipynb</a>
<a href="https://github.com/SeldonIO/seldon-core/tree/master/examples/models/sklearn_spacy_text" rel="nofollow noreferrer">https://github.com/SeldonIO/seldon-core/tree/master/examples/models/sklearn_spacy_text</a></p>
<p>#Steps Done</p>
<pre><code>1. kubectl port-forward $(kubectl get pods -l istio=ingressgateway -n istio-system -o jsonpath='{.items[0].metadata.name}') -n istio-system 8003:80
2.kubectl create namespace john
3.kubectl config set-context $(kubectl config current-context) --namespace=john
4.kubectl create -f sklearn_iris_deployment.yaml
</code></pre>
<pre><code>cat sklearn_iris_deployment.yaml
apiVersion: machinelearning.seldon.io/v1alpha2
kind: SeldonDeployment
metadata:
  name: seldon-deployment-example
  namespace: john
spec:
  name: sklearn-iris-deployment
  predictors:
  - componentSpecs:
    - spec:
        containers:
        - image: seldonio/sklearn-iris:0.1
          imagePullPolicy: IfNotPresent
          name: sklearn-iris-classifier
    graph:
      children: []
      endpoint:
        type: REST
      name: sklearn-iris-classifier
      type: MODEL
    name: sklearn-iris-predictor
    replicas: 1 
</code></pre>
<p>kubectl get sdep -n john seldon-deployment-example -o json | jq .status</p>
<pre><code>  &quot;deploymentStatus&quot;: {
    &quot;sklearn-iris-deployment-sklearn-iris-predictor-0e43a2c&quot;: {
      &quot;availableReplicas&quot;: 1,
      &quot;replicas&quot;: 1
    }
  },
  &quot;serviceStatus&quot;: {
    &quot;seldon-635d389a05411932517447289ce51cde&quot;: {
      &quot;httpEndpoint&quot;: &quot;seldon-635d389a05411932517447289ce51cde.john:9000&quot;,
      &quot;svcName&quot;: &quot;seldon-635d389a05411932517447289ce51cde&quot;
    },
    &quot;seldon-bb8b177b8ec556810898594b27b5ec16&quot;: {
      &quot;grpcEndpoint&quot;: &quot;seldon-bb8b177b8ec556810898594b27b5ec16.john:5001&quot;,
      &quot;httpEndpoint&quot;: &quot;seldon-bb8b177b8ec556810898594b27b5ec16.john:8000&quot;,
      &quot;svcName&quot;: &quot;seldon-bb8b177b8ec556810898594b27b5ec16&quot;
    }
  },
  &quot;state&quot;: &quot;Available&quot;
}
</code></pre>
<p>5.here iam using istio and as per this doc <a href="https://docs.seldon.io/projects/seldon-core/en/v1.1.0/workflow/serving.html" rel="nofollow noreferrer">https://docs.seldon.io/projects/seldon-core/en/v1.1.0/workflow/serving.html</a> i did the same</p>
<pre><code>Istio
Istio REST
Assuming the istio gateway is at &lt;istioGateway&gt; and with a Seldon deployment name &lt;deploymentName&gt; in namespace &lt;namespace&gt;:

A REST endpoint will be exposed at : http://&lt;istioGateway&gt;/seldon/&lt;namespace&gt;/&lt;deploymentName&gt;/api/v1.0/predictions
</code></pre>
<ol start="6">
<li></li>
</ol>
<p>curl  -s http://localhost:8003/seldon/john/sklearn-iris-deployment-sklearn-iris-predictor-0e43a2c/api/v0.1/predictions -H &quot;Content-Type: application/json&quot; -d '{&quot;data&quot;:{&quot;ndarray&quot;:[[5.964,4.006,2.081,1.031]]}}' -v</p>
<pre><code>*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 8003 (#0)
&gt; POST /seldon/johnson-az-videspan/sklearn-iris-deployment-sklearn-iris-predictor-0e43a2c/api/v0.1/predictions HTTP/1.1
&gt; Host: localhost:8003
&gt; User-Agent: curl/7.58.0
&gt; Accept: */*
&gt; Content-Type: application/json
&gt; Content-Length: 48
&gt; 
* upload completely sent off: 48 out of 48 bytes
&lt; HTTP/1.1 301 Moved Permanently
&lt; location: https://localhost:8003/seldon/john/sklearn-iris-deployment-sklearn-iris-predictor-0e43a2c/api/v0.1/predictions
&lt; date: Fri, 23 Oct 2020 13:09:46 GMT
&lt; server: istio-envoy
&lt; connection: close
&lt; content-length: 0
&lt; 
* Closing connection 0
</code></pre>
<p>the same thing happen in <strong>sklearn_spacy_text</strong> model too but i wonder the same models working perfectly while running it on docker.</p>
<p>please find the sample responce from docker</p>
<pre><code>curl  -s http://localhost:5000/predict -H &quot;Content-Type: application/json&quot; -d '{&quot;data&quot;:{&quot;ndarray&quot;:[[5.964,4.006,2.081,1.031]]}}' -v
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 5000 (#0)
&gt; POST /predict HTTP/1.1
&gt; Host: localhost:5000
&gt; User-Agent: curl/7.61.1
&gt; Accept: */*
&gt; Content-Type: application/json
&gt; Content-Length: 48
&gt; 
* upload completely sent off: 48 out of 48 bytes
* HTTP 1.0, assume close after body
&lt; HTTP/1.0 200 OK
&lt; Content-Type: application/json
&lt; Content-Length: 125
&lt; Access-Control-Allow-Origin: *
&lt; Server: Werkzeug/1.0.0 Python/3.7.4
&lt; Date: Fri, 23 Oct 2020 11:18:31 GMT
&lt; 
{&quot;data&quot;:{&quot;names&quot;:[&quot;t:0&quot;,&quot;t:1&quot;,&quot;t:2&quot;],&quot;ndarray&quot;:[[0.9548873249364169,0.04505474761561406,5.7927447968952436e-05]]},&quot;meta&quot;:{}}
* Closing connection 0
</code></pre>
<pre><code>curl  -s http://localhost:5001/predict -H &quot;Content-Type: application/json&quot; -d '{&quot;data&quot;: {&quot;names&quot;: [&quot;text&quot;], &quot;ndarray&quot;: [&quot;Hello world this is a test&quot;]}}'
{&quot;data&quot;:{&quot;names&quot;:[&quot;t:0&quot;,&quot;t:1&quot;],&quot;ndarray&quot;:[[0.6811839197596743,0.3188160802403257]]},&quot;meta&quot;:{}}
</code></pre>
<p>can any one help to resolve this issue</p>

<h2>Issue</h2>
<p>It appears that the request you make incorrectly tries to re-direct to an https protocol (port 443)</p>
<h2>Solution</h2>
<p><strong>Use</strong> https instead of http</p>
<pre><code>curl -s https://localhost:8003/seldon/john/sklearn-iris-deployment-sklearn-iris-predictor-0e43a2c/api/v0.1/predictions -H &quot;Content-Type: application/json&quot; -d '{&quot;data&quot;:{&quot;ndarray&quot;:[[5.964,4.006,2.081,1.031]]}}' -v
</code></pre>
<hr />
<p><strong>Use</strong> curl with -L flag, which instructs curl to follow redirects. In this case, the server returned a redirect response (301 Moved Permanently) for the HTTP request to <code>http://localhost:8003</code>. The redirect response instructs the client to send an additional request, this time using HTTPS, to <code>https://localhost:8003</code>.</p>
<p>More about it <a href="https://curl.haxx.se/docs/manpage.html" rel="nofollow noreferrer">here</a>.</p>
