使用 kubernetes 的 Minio 部署无法按预期工作



我正在试验kubernetes和minio部署。我有一个k3s 4节点集群,每个集群有4个50GB的磁盘。按照这里的说明,我已经这样做了:

  1. 首先我安装了krew,以便安装minio和directpv操作符。

  2. 我毫无问题地安装了这两个。

  3. 我使用kubectl directpv drives format --drives /dev/vd{b...e} --nodes k3s{1...4}格式化了节点中每个可用hdd

  4. 然后我继续进行部署,首先用kubectl create namespace minio-tenant-1创建名称空间,然后用实际创建租户

    kubectl minio tenant create minio-tenant-1 --servers 4 --volumes 8 --capacity 10Gi --storage-class direct-csi-min-io --namespace minio-tenant-1

  5. 然后,我唯一需要做的就是将端口暴露给访问,我用kubectl port-forward service/minio 443:443来实现这一点(我想这应该是更好的方法,因为最后一个命令显然不是永久性的,可能在kubernetes集群中使用LoadBalancer或NodePort类型的服务(。

到目前为止还不错,但我面临一些问题:

  • 当我尝试使用mc为服务器创建别名时,提示符会回答我:

mc:无法从提供的初始化新别名资格证书收到"https://127.0.0.1/probe-bucket-sign-9aplsepjlq65/?location="x509:无法验证127.0.0.1的证书,因为它不包含任何IP SAN

我只需添加--insecure选项就可以超越这一点,但我不知道它为什么会出现这个错误,我想这是k3s如何管理TLS自动签名证书的问题。

  • 使用--insecure选项创建服务器的别名(我将其命名为test(后,我试图创建一个bucket,但服务器总是用回答我

    mc mb test/hello

    mc: <ERROR> Unable to make bucket test/hello. The specified bucket does not exist.

所以。。。我真的不能用它…任何帮助都会得到感激,我需要知道我做错了什么。

以Minio文档中的信息为指导。您必须生成一个公共证书。首先生成私钥使用命令:

certtool.exe --generate-privkey --outfile NameOfKey.key

之后创建一个名为cert.cnf的文件,内容如下:

# X.509 Certificate options
#
# DN options
# The organization of the subject.
organization = "Example Inc."
# The organizational unit of the subject.
#unit = "sleeping dept."
# The state of the certificate owner.
state = "Example"
# The country of the subject. Two letter code.
country = "EX"
# The common name of the certificate owner.
cn = "Sally Certowner"
# In how many days, counting from today, this certificate will expire.
expiration_days = 365
# X.509 v3 extensions
# DNS name(s) of the server
dns_name = "localhost"
# (Optional) Server IP address
ip_address = "127.0.0.1"
# Whether this certificate will be used for a TLS server
tls_www_server

运行certtool.exe并指定配置文件以生成证书:

certtool.exe --generate-self-signed --load-privkey NameOfKey.key --template cert.cnf --outfile public.crt

最终将公共证书放入:

~/.minio/certs/CAs/

最新更新