I have setup MinIO with Kubernetes (K3s) in one node.
Command kubectl logs mypod-0 -n minio returns the following:
I have access to the console from the second link and by using python I can list the buckets inside minio with:
import logging
from minio import Minio
from minio.error import S3Error
# execute from IDE terminal
minio = Minio(
'10.42.0.14:9000',
access_key='chesAccesskeyMinio',
secret_key='chesSecretkey',
secure=False,
)
def list_all_buckets():
bucket_list = minio.list_buckets()
for bucket in bucket_list:
objects = minio.list_objects(bucket.name, recursive=True)
print (bucket.name)
if __name__ == '__main__':
try:
list_all_buckets()
except S3Error as exc:
print("error occurred.", exc)
logging.critical("Object storage not reachable")
My question is how to expose this IP to be accesible from outside my network (both he console and the API). Do I have to use ingress?
UPDATED based on answer and comments
I have two services
apiVersion: v1
kind: Service
metadata:
name: ches
namespace: minio
labels:
app: ches
spec:
clusterIP: None
selector:
app: ches
ports:
- port: 9011
name: ches
---
apiVersion: v1
kind: Service
metadata:
name: ches-service
namespace: minio
labels:
app: ches
spec:
type: LoadBalancer
selector:
app: ches
ports:
- port: 9012
targetPort: 9011
protocol: TCP
and then I created an Ingress using
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: minio
namespace: minio
spec:
rules:
- host: s3.example.com
http:
paths:
- backend:
service:
name: ches-service
port:
number: 9000
path: /
pathType: Prefix
Command kubectl describe Ingress minio -n minio results in:
Name: minio
Namespace: minio
Address: 192.168.1.14
Default backend: default-http-backend:80 (<error: endpoints "default-http-backend" not found>)
Rules:
Host Path Backends
---- ---- --------
s3.example.com
/ ches-service:9000 (10.42.0.14:9011)
Annotations: <none>
Events: <none>
However I cannot access s3.example.com.
Am I missing something here?