0
点赞
收藏
分享

微信扫一扫

kubesphere常用的问题

一、使用多节点,直接在linux上安装,如何指定nfs-client?

1、创建nfs-server服务端;参照

​​https://mp.weixin.qq.com/s/s5sdExIQVjSHEmGuK0qrhA​​

这篇文章的第一部分;

2、创建nfs-client部分操作,参照:

​​https://kubesphere.com.cn/docs/installing-on-linux/persistent-storage-configurations/install-nfs-client/​​

主要是创建一个nfs-client.yaml

nfs:
server: "10.10.1.204" # This is the server IP address. Replace it with your own.
path: "/nfs/data" # Replace the exported directory with your own.
storageClass:
defaultClass: true

3、在生成的 config-sample.yaml 里,添加部分代码:

addons:
- name: nfs-client
namespace: kube-system
sources:
chart:
name: nfs-client-provisioner
repo: 'https://charts.kubesphere.io/main'
valuesFile: /root/myyaml/nfs-client.yaml

valuesFile路径是刚刚创建的。

kubesphere常用的问题_linux

 

 这样就参照官方的教程继续执行。

​​https://kubesphere.com.cn/docs/installing-on-linux/introduction/multioverview/​​

 

二、多集群,host集群添加member集群一直报异常,问题如下:

​​https://kubesphere.com.cn/forum/d/6306-member​​

解决办法:

cat $HOME/.kube/config

这里的server地址,改为member集群的master的ip地址即可。

比如:

server: https://10.10.1.120:6443

 

三、修改ks配置

kubectl edit cc ks-installer -n kubesphere-system

 

四、查看运行情况:

 

kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app=ks-install -o jsonpath='{.items[0].metadata.name}') -f

 

五、升级到3.2.1后流水线调整:

最后一步的部署,原来的流水线脚本为:

'deploy/**', enableConfigSubstitution: true, kubeconfigId: "${KUBECONFIG_CREDENTIAL_ID}")

现在要改为:

'base') {
withCredentials([kubeconfigFile(credentialsId: env.KUBECONFIG_CREDENTIAL_ID, variable: 'KUBECONFIG')]) {
sh 'envsubst < ${web_dictionary_name}/deploy/svc.yml | kubectl apply -f -'
echo '发布成功'
}

}

(1)要指定yaml文件具体的路径;

(2)使用envsubst 将相关参数也传给该yaml文件。

(3)然后再执行 kubectl apply -f  参数替换后的yaml文件。

 

 

 

 

作者:沐雪



举报

相关推荐

0 条评论