<p>Is it possible to replace the usage of Google Cloud Storage buckets with an alternative on-premises solution so that it is possible to run e.g. Kubeflow Pipelines completely independent from the Google Cloud Platform?</p>

tech34841916559242495
<p>Yes it is possible. You can use <a href="https://min.io/" rel="noreferrer">minio</a>, it's like s3/gs but it runs on a persistent volume of your on-premises storage.</p>

<p>Here are the instructions on how to use it as a kfserving inference storage:</p>

<p>Validate that minio is running in your kubeflow installation:</p>

<pre><code>$ kubectl get svc -n kubeflow |grep minio
minio-service                                  ClusterIP   10.101.143.255   &lt;none&gt;        9000/TCP            81d
</code></pre>

<p>Enable a tunnel for your minio:</p>

<pre><code>$ kubectl port-forward svc/minio-service -n kubeflow 9000:9000
Forwarding from 127.0.0.1:9000 -&gt; 9000
Forwarding from [::1]:9000 -&gt; 9000
</code></pre>

<p>Browse <a href="http://localhost:9000" rel="noreferrer">http://localhost:9000</a> to get to the minio UI and create a bucket/upload your model. Credentials <code>minio/minio123</code>. Alternatively you can use the <code>mc</code> command to do it from your terminal:</p>

<pre><code>$ 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/
</code></pre>

<p>Create a secret&amp;serviceaccount for the minio access, note that the s3-endpoint defines the path to the minio, keyid&amp;acceskey are the credentials encoded in base64:</p>

<pre><code>$ 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
</code></pre>

<p>Finally, create your <code>inferenceservice</code> as follows:</p>

<pre><code>$ 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
</code></pre>
