seldon-core icon indicating copy to clipboard operation
seldon-core copied to clipboard

enpoint config `endpoint.httpPort` in graph does'n take effect.

Open cnfatal opened this issue 3 years ago • 1 comments

Describe the bug

Configuration httpPort and grpcPort in .spec.predictors[].graph.endpoint do not take effect.

To reproduce

apiVersion: machinelearning.seldon.io/v1
kind: SeldonDeployment
metadata:
  name: sklearn-iris
spec:
  predictors:
    - name: default
      replicas: 1
      annotations:
        seldon.io/no-engine: "true"
      graph:
        name: classifier
        endpoint:
          type: REST
          httpPort: 80  # <--- here
      componentSpecs:
        - spec:
            containers:
              - name: classifier
                image: nginx:1.13
                securityContext:
                  privileged: true
$ kubectl -n seldon get svc sklearn-iris-default -oyaml
apiVersion: v1
kind: Service
metadata:
  ...
  ports:
  - name: http
    port: 9000
    protocol: TCP
    targetPort: 9000
  - name: grpc
    port: 9500
    protocol: TCP
    targetPort: 9500
  selector:
    seldon-app: sklearn-iris-default
...

But it works if :

apiVersion: machinelearning.seldon.io/v1
kind: SeldonDeployment
metadata:
  name: sklearn-iris
spec:
  predictors:
    - name: default
      replicas: 1
      annotations:
        seldon.io/no-engine: "true"
      graph:
        name: classifier
        # endpoint:
        #   type: REST
        #   httpPort: 80
      componentSpecs:
        - spec:
            containers:
              - name: classifier
                image: nginx:1.13
                securityContext:
                  privileged: true
                ports:
                  - containerPort: 80
                    protocol: TCP
                    name: http
$ kubectl -n seldon get svc sklearn-iris-default -oyaml
apiVersion: v1
kind: Service
...
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: 80
  - name: grpc
    port: 9500
    protocol: TCP
    targetPort: 9500
  selector:
    seldon-app: sklearn-iris-default
...

Expected behaviour

Environment

Model Details

  • Images of your model: [Output of: kubectl get seldondeployment -n <yourmodelnamespace> <seldondepname> -o yaml | grep image: where <yourmodelnamespace>]
  • Logs of your model: [You can get the logs of your model by running kubectl logs -n <yourmodelnamespace> <seldonpodname> <container>]

cnfatal avatar Aug 04 '22 05:08 cnfatal

This is the code that needs to be looked at

ukclivecox avatar Aug 15 '22 06:08 ukclivecox

Yes at present you need to override this in the container spec. Will close this for now. If others need more configurability please add to the issue.

ukclivecox avatar Mar 19 '23 11:03 ukclivecox