canonical / kserve-operators

Charmed KServe
4 stars 2 forks source link

(cherry-pick to track/0.11) fix: configure proxy env vars storage init container (#257) #267

Closed NohaIhab closed 3 months ago

NohaIhab commented 3 months ago

Testing the upgrade

  1. Deploy the following bundle:
    bundle: kubernetes
    name: kubeflow
    docs: https://discourse.charmhub.io/t/3749
    applications:
    istio-ingressgateway:
    charm: istio-gateway
    channel: 1.17/stable
    scale: 1
    trust: true
    _github_repo_name: istio-operators
    _github_repo_branch: track/1.17
    options:
      kind: ingress
    istio-pilot:
    charm: istio-pilot
    channel: 1.17/stable
    scale: 1
    trust: true
    _github_repo_name: istio-operators
    _github_repo_branch: track/1.17
    options:
      default-gateway: kubeflow-gateway
    knative-eventing:
    charm: knative-eventing
    channel: 1.10/stable
    scale: 1
    trust: true
    options:
      namespace: knative-eventing
    _github_repo_name: knative-operators
    _github_repo_branch: track/1.10
    knative-operator:
    charm: knative-operator
    channel: 1.10/stable
    scale: 1
    trust: true
    _github_repo_name: knative-operators
    _github_repo_branch: track/1.10
    knative-serving:
    charm: knative-serving
    channel: 1.10/stable
    scale: 1
    trust: true
    options:
      namespace: knative-serving
      istio.gateway.namespace: kubeflow
      istio.gateway.name: kubeflow-gateway
    _github_repo_name: knative-operators
    _github_repo_branch: track/1.10
    kserve-controller:
    charm: kserve-controller
    channel: 0.11/stable
    scale: 1
    trust: true
    _github_repo_name: kserve-operators
    _github_repo_branch: track/0.11
    relations:
    - [istio-pilot:istio-pilot, istio-ingressgateway:istio-pilot]
    - [kserve-controller:ingress-gateway, istio-pilot:gateway-info]
    - [kserve-controller:local-gateway, knative-serving:local-gateway]
  2. Create a namespace to test with
    kubectl create namespace testing
  3. Apply the following sklearn-iris isvc example to testing namespace
    apiVersion: "serving.kserve.io/v1beta1"
    kind: "InferenceService"
    metadata:
    name: "sklearn-v2-iris"
    spec:
    predictor:
    model:
      modelFormat:
        name: sklearn
      protocolVersion: v2
      runtime: kserve-sklearnserver
      storageUri: "gs://kfserving-examples/models/sklearn/1.0/model"
      resources:
        limits:
          cpu: 1
          memory: 500Mi
        requests:
          cpu: 100m
          memory: 250Mi
  4. Check isvc is ready
    kubectl get isvc -n testing
    NAME              URL                                                  READY   PREV   LATEST   PREVROLLEDOUTREVISION   LATESTREADYREVISION               AGE
    sklearn-v2-iris   http://sklearn-v2-iris.testing.10.64.140.43.nip.io   True           100                              sklearn-v2-iris-predictor-00001   29s
  5. refresh kserve-controller charm to the one from this PR
    juju refresh kserve-controller --channel=0.11/edge/pr-267

    Results

    • charm went to active after refresh
      
      juju status
      Model     Controller          Cloud/Region        Version  SLA          Timestamp
      kubeflow  microk8s-localhost  microk8s/localhost  3.4.5    unsupported  15:10:45Z

App Version Status Scale Charm Channel Rev Address Exposed Message istio-ingressgateway active 1 istio-gateway 1.17/stable 1107 10.152.183.248 no
istio-pilot active 1 istio-pilot 1.17/stable 1059 10.152.183.209 no
knative-eventing active 1 knative-eventing 1.10/stable 353 10.152.183.210 no
knative-operator active 1 knative-operator 1.10/stable 328 10.152.183.53 no
knative-serving active 1 knative-serving 1.10/stable 409 10.152.183.166 no
kserve-controller active 1 kserve-controller 0.11/edge/pr-267 618 10.152.183.34 no

Unit Workload Agent Address Ports Message istio-ingressgateway/0 active idle 10.1.199.226
istio-pilot/0
active idle 10.1.199.231
knative-eventing/0 active idle 10.1.199.228
knative-operator/0
active idle 10.1.199.213
knative-serving/0 active idle 10.1.199.222
kserve-controller/0
active idle 10.1.199.240

* isvc created before upgrade is unaffected

kubectl get isvc -n testing NAME URL READY PREV LATEST PREVROLLEDOUTREVISION LATESTREADYREVISION AGE sklearn-v2-iris http://sklearn-v2-iris.testing.10.64.140.43.nip.io True 100 sklearn-v2-iris-predictor-00001 3m11s

* check the new resource `ClusterStorageContainer` was created

kubectl get ClusterStorageContainer NAME AGE default 96s

* check the new charm configs for proxy exist

juju config kserve-controller application: kserve-controller application-config: ... charm: kserve-controller settings: ... http-proxy: default: "" description: The value of HTTP_PROXY environment variable in the storage-initializer container. source: default type: string value: "" https-proxy: default: "" description: The value of HTTPS_PROXY environment variable in the storage-initializer container. source: default type: string value: "" no-proxy: default: "" description: The value of NO_PROXY environment variable in the storage-initializer container. source: default type: string value: "" ...