<p>I set up a microk8s deployment with the Minio service activated. I can connect to the Minio dashboard with a browser but cannot find a way to connect to the service via the API.</p>
<p>Here is the output to the <code>microk8s kubectl get all --all-namespaces</code> command</p>
<pre><code>NAMESPACE        NAME                                            READY   STATUS    RESTARTS      AGE
minio-operator   pod/minio-operator-67dcf6dd7c-vxccn             0/1     Pending   0             7d22h
kube-system      pod/calico-node-bpd4r                           1/1     Running   4 (26m ago)   8d
kube-system      pod/dashboard-metrics-scraper-7bc864c59-t7k87   1/1     Running   4 (26m ago)   8d
kube-system      pod/hostpath-provisioner-69cd9ff5b8-x664l       1/1     Running   4 (26m ago)   7d22h
kube-system      pod/kubernetes-dashboard-dc96f9fc-4759w         1/1     Running   4 (26m ago)   8d
minio-operator   pod/console-66c4b79fbd-mw5s8                    1/1     Running   3 (26m ago)   7d22h
kube-system      pod/calico-kube-controllers-79568db7f8-vg4q2    1/1     Running   4 (26m ago)   8d
kube-system      pod/coredns-6f5f9b5d74-fz7v8                    1/1     Running   4 (26m ago)   8d
kube-system      pod/metrics-server-6f754f88d-r7lsj              1/1     Running   4 (26m ago)   8d
minio-operator   pod/minio-operator-67dcf6dd7c-8dnlq             1/1     Running   9 (25m ago)   7d22h
minio-operator   pod/microk8s-ss-0-0                             1/1     Running   9 (25m ago)   7d22h

NAMESPACE        NAME                                TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)                  AGE
default          service/kubernetes                  ClusterIP   10.152.183.1     &lt;none&gt;        443/TCP                  11d
kube-system      service/kube-dns                    ClusterIP   10.152.183.10    &lt;none&gt;        53/UDP,53/TCP,9153/TCP   8d
kube-system      service/metrics-server              ClusterIP   10.152.183.43    &lt;none&gt;        443/TCP                  8d
kube-system      service/kubernetes-dashboard        ClusterIP   10.152.183.232   &lt;none&gt;        443/TCP                  8d
kube-system      service/dashboard-metrics-scraper   ClusterIP   10.152.183.226   &lt;none&gt;        8000/TCP                 8d
minio-operator   service/operator                    ClusterIP   10.152.183.48    &lt;none&gt;        4222/TCP,4221/TCP        7d22h
minio-operator   service/console                     ClusterIP   10.152.183.193   &lt;none&gt;        9090/TCP,9443/TCP        7d22h
minio-operator   service/minio                       ClusterIP   10.152.183.195   &lt;none&gt;        80/TCP                   7d22h
minio-operator   service/microk8s-console            ClusterIP   10.152.183.192   &lt;none&gt;        9090/TCP                 7d22h
minio-operator   service/microk8s-hl                 ClusterIP   None             &lt;none&gt;        9000/TCP                 7d22h

NAMESPACE     NAME                         DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR            AGE
kube-system   daemonset.apps/calico-node   1         1         1       1            1           kubernetes.io/os=linux   8d

NAMESPACE        NAME                                        READY   UP-TO-DATE   AVAILABLE   AGE
kube-system      deployment.apps/coredns                     1/1     1            1           8d
kube-system      deployment.apps/dashboard-metrics-scraper   1/1     1            1           8d
kube-system      deployment.apps/kubernetes-dashboard        1/1     1            1           8d
minio-operator   deployment.apps/console                     1/1     1            1           7d22h
kube-system      deployment.apps/hostpath-provisioner        1/1     1            1           7d22h
kube-system      deployment.apps/calico-kube-controllers     1/1     1            1           8d
kube-system      deployment.apps/metrics-server              1/1     1            1           8d
minio-operator   deployment.apps/minio-operator              1/2     2            1           7d22h

NAMESPACE        NAME                                                  DESIRED   CURRENT   READY   AGE
kube-system      replicaset.apps/coredns-6f5f9b5d74                    1         1         1       8d
kube-system      replicaset.apps/dashboard-metrics-scraper-7bc864c59   1         1         1       8d
kube-system      replicaset.apps/kubernetes-dashboard-dc96f9fc         1         1         1       8d
minio-operator   replicaset.apps/console-66c4b79fbd                    1         1         1       7d22h
kube-system      replicaset.apps/hostpath-provisioner-69cd9ff5b8       1         1         1       7d22h
kube-system      replicaset.apps/calico-kube-controllers-79568db7f8    1         1         1       8d
kube-system      replicaset.apps/metrics-server-6f754f88d              1         1         1       8d
minio-operator   replicaset.apps/minio-operator-67dcf6dd7c             2         2         1       7d22h

NAMESPACE        NAME                             READY   AGE
minio-operator   statefulset.apps/microk8s-ss-0   1/1     7d22h
</code></pre>
<p>I've tried the following commands to connect to the pod via the Python API, but keep getting errors:</p>
<pre><code>client = Minio(&quot;microk8s-ss-0-0&quot;, secure=False)

try:
    objects = client.list_objects(&quot;bucket-1&quot;,prefix='/',recursive=True)
    for obj in objects:
        print (obj.bucket_name)
except InvalidResponseError as err:
    print (err)
</code></pre>
<p>And received the following error:</p>
<pre><code>MaxRetryError: HTTPConnectionPool(host='microk8s-ss-0-0', port=80): Max retries exceeded with url: /bucket-1?delimiter=&amp;encoding-type=url&amp;list-type=2&amp;max-keys=1000&amp;prefix=%2F (Caused by NewConnectionError('&lt;urllib3.connection.HTTPConnection object at 0x7f29041e1e40&gt;: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))
</code></pre>
<p>I also tried:
<code>client = Minio(&quot;10.152.183.195&quot;, secure=False)</code></p>
<p>And got the same result. How do I access the minio pod from the API?</p>

Mark C
<p>Can you try this?</p>
<pre><code>client = Minio(&quot;minio.minio-operator.svc.cluster.local:80&quot;, 
YOUR_ACCESS_KEY, YOUR_SECRET_KEY, secure=False)
</code></pre>
<p>If the service cannot be reached where your python code is running you can port-forward the service using the command below</p>
<pre><code>microk8s kubectl -n minio-operator port-forward svc/minio 80
</code></pre>
<p>and then you can do</p>
<pre><code>client = Minio(&quot;localhost:80&quot;, 
YOUR_ACCESS_KEY, YOUR_SECRET_KEY, secure=False)
</code></pre>
