python - 从 Kubernetes 集群外部访问 Minio
问题描述
我使用新的操作符在 Kubernetes 上部署了 Minio:
helm repo add minio https://operator.min.io/
helm install --namespace minio-operator --create-namespace --generate-name minio/minio-operator
kubectl apply -f https://raw.githubusercontent.com/minio/operator/master/examples/tenant-tiny.yaml
sudo -E kubefwd svc
Port-Forward: 127.1.27.1 minio:80 to pod minio-ss-0-0:9000
Port-Forward: 127.1.27.2 minio-hl:9000 to pod minio-ss-0-0:9000
Port-Forward: 127.1.27.3 minio-ss-0-0.minio-hl:9000 to pod minio-ss-0-0:9000
租户正在工作,我可以通过 minio:80 和 minio-hl:9000 访问 Web 控制台
我想从集群外部访问存储(在 Docker 上运行的 Jupyter notebook);这是我收到错误“ConnectionRefusedError: [Errno 111] Connection denied”的地方:
def main():
client = Minio(
"minio:80", #minio-hl:9000 leads to the same error
access_key="minio",
secret_key="minio123!",
secure=False
)
found = client.bucket_exists("posts")
if not found:
client.make_bucket("posts")
print("Bucket 'posts' created")
else:
print("Bucket 'posts' already exists")
我还尝试使用带有 s3a jar 的 pyspark 来读写对象,但是连接挂了很长时间,最后收到了类似的错误。
有人能帮助我吗?非常感谢!
解决方案
推荐阅读
- apache-beam - 如何从 Apache Beam Row 写入 Avro 文件
- javascript - 如何对具有 document.querySelector 的函数进行单元测试?
- matplotlib - 使用 Matplotlib 理解和绘制 L2 正则化
- huawei-mobile-services - 应用程序在 AppGallery 和 GooglePlaystore 中使用相同的包名后,由于 Google Play 保护而被删除
- c# - Serilog ThreadId 始终输出为 1
- amazon-web-services - 使用会话凭据测试 Boto3 客户端
- reactjs - 将具有对象的状态传递给 React 中的另一个兄弟组件并映射它
- gcc - Cortex-M 编译器生成不正确的 FOR 循环
- html - 我创建了一个自定义光标,它工作正常,但是当我在网页上滚动时,光标失去了位置
- pine-script - 将研究/策略附加到 Tradingview 绘图工具