Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update GCS InferenceService docs #404

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 23 additions & 22 deletions docs/modelserving/storage/gcs/gcs.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,55 +17,56 @@ e.g. ```gs://kfserving-examples/models/tensorflow/flowers```

KServe supports authenticating using Google Service Account Key

### Create a Service Account Key
### Create a Google Service Account Key

* To create a Service Account Key follow the steps [here](https://cloud.google.com/iam/docs/keys-create-delete#iam-service-account-keys-create-console).
* Base64 encode the generated Service Account Key file


## Create Google Secret
## Create Secret and attach to Service Account


### Create secret
=== "yaml"
```yaml
apiVersion: v1
kind: Secret
metadata:
name: storage-config
name: gcscreds
type: Opaque
stringData:
gcs: |
{
"type": "gs",
"bucket": "mlpipeline",
"base64_service_account": "c2VydmljZWFjY291bnQ=" # base64 encoded value of the credential file
}
data:
gcloud-application-credentials.json: <base64 encoded value of the credential file>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to have a note that this name can be configured using the inferenceservice-config configmap. https://github.com/kserve/kserve/blob/3deb30fee58d63e772db28abf58582570dbb28cc/config/configmap/inferenceservice.yaml#L113

```

=== "kubectl"
```bash
kubectl apply -f create-gcs-secret.yaml
tjandy98 marked this conversation as resolved.
Show resolved Hide resolved
### Attach secret to a service account
=== "yaml"
```yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: sa
secrets:
- name: gcscreds
```


## Deploy the model on GCS with `InferenceService`

Create the InferenceService with the Google service account credential
=== "yaml"
```yaml
apiVersion: serving.kserve.io/v1beta1
kind: InferenceService
apiVersion: "serving.kserve.io/v1beta1"
tjandy98 marked this conversation as resolved.
Show resolved Hide resolved
kind: "InferenceService"
metadata:
name: sklearn-gcs
name: sklearn-gcs
tjandy98 marked this conversation as resolved.
Show resolved Hide resolved
spec:
predictor:
serviceAccountName: sa
model:
modelFormat:
name: sklearn
storage:
key: gcs
path: models/tensorflow/flowers
parameters: # Parameters to override the default values
bucket: kfserving-examples
name: tensorflow
storageUri: "gs://kfserving-examples/models/tensorflow/flowers"

```

Apply the `sklearn-gcs.yaml`.
Expand Down