繁体   English   中英

没有 Google Cloud Storage 的 Kubeflow

[英]Kubeflow without Google Cloud Storage

是否可以用替代的本地解决方案替换 Google Cloud Storage 存储桶的使用,以便可以完全独立于 Google Cloud Platform 运行例如 Kubeflow Pipelines?

对的,这是可能的。 您可以使用minio ,它类似于 s3/gs,但它在本地存储的持久卷上运行。

以下是有关如何将其用作 kfserving 推理存储的说明:

验证 minio 是否在您的 kubeflow 安装中运行:

$ kubectl get svc -n kubeflow |grep minio
minio-service                                  ClusterIP   10.101.143.255   <none>        9000/TCP            81d

为您的 minio 启用隧道:

$ kubectl port-forward svc/minio-service -n kubeflow 9000:9000
Forwarding from 127.0.0.1:9000 -> 9000
Forwarding from [::1]:9000 -> 9000

浏览http://localhost:9000以进入 minio UI 并创建一个存储桶/上传您的 model。 凭证minio/minio123 或者,您可以使用mc命令从终端执行此操作:

$ mc ls minio/models/flowers/0001/
[2020-03-26 13:16:57 CET]  1.7MiB saved_model.pb
[2020-04-25 13:37:09 CEST]      0B variables/

为minio访问创建一个secret&serviceaccount,注意s3-endpoint定义了minio的路径,keyid&acceskey是编码在base64中的凭证:

$ kubectl get secret mysecret -n homelab -o yaml
apiVersion: v1
data:
  awsAccessKeyID: bWluaW8=
  awsSecretAccessKey: bWluaW8xMjM=
kind: Secret
metadata:
  annotations:
    serving.kubeflow.org/s3-endpoint: minio-service.kubeflow:9000
    serving.kubeflow.org/s3-usehttps: "0"
  name: mysecret
  namespace: homelab

$ kubectl get serviceAccount -n homelab sa -o yaml
apiVersion: v1
kind: ServiceAccount
metadata:
  name: sa
  namespace: homelab
secrets:
- name: mysecret

最后,按如下方式创建您的inferenceservice服务:

$ kubectl get inferenceservice tensorflow-flowers -n homelab -o yaml
apiVersion: serving.kubeflow.org/v1alpha2
kind: InferenceService
metadata:
  name: tensorflow-flowers
  namespace: homelab
spec:
  default:
    predictor:
      serviceAccountName: sa
      tensorflow:
        storageUri: s3://models/flowers

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM