我正在试验kubernetes和minio部署。我有一个k3s 4节点集群,每个集群有4个50GB的磁盘。按照这里的说明,我已经这样做了:
-
首先我安装了krew,以便安装minio和directpv操作符。
-
我毫无问题地安装了这两个。
-
我使用
kubectl directpv drives format --drives /dev/vd{b...e} --nodes k3s{1...4}
格式化了节点中每个可用hdd -
然后我继续进行部署,首先用
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
-
然后,我唯一需要做的就是将端口暴露给访问,我用
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/