进入mysql容器后,登录mysql一直报错,报错如下:
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: YES)
用k8s使用secret加密密码来制作mysql容器的流程为:
加密:
编写secret.yaml文件
应用secret.yaml生成secret
[root@k8s-master secret]# kubectl apply -f secret.yaml
编写pod_mysql_secret.yaml文件,以环境变量的形式引用了secret,来定义MYSQL_ROOT_PASSWORD环境变量,值为secret对象user-and-passwd的password值
应用pod_mysql_secret.yaml文件生成pod,pod中的容器为mysql容器
[root&