您好,登录后才能下订单哦!
使用Rancher的负载均衡,上传1M以上的文件报错,查看ingress-nginx容器,发现配置
client_max_body_size 1m;
解决办法:
创建ingress的时候修改参数:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
nginx.ingress.kubernetes.io/proxy-body-size: 50m
常规情况为使用定时任务运行脚本,运行命令即可
gitlab-rake gitlab:backup:create
k8s中运行的gitlab,使用cronjob定时运行脚本即可:
1、为了可以使用kubectl,需要使用kubeconfig,创建configmap 就叫kubeconfig:
#kubeconfig默认放在/root/.kube/config
kubectl create configmap kubeconfig -n gitlab --from-file=/root/.kube/config
2、创建备份脚本,configmap:
备份脚本如下:
#!/bin/sh
pod_name=$(kubectl get pods -l app=gitlab -o jsonpath={.items[*].metadata.name} -n gitlab --kubeconfig=/etc/kubeconfig/config)
kubectl --kubeconfig=/etc/kubeconfig/config exec $pod_name -n gitlab -- gitlab-rake gitlab:backup:create
导入到configmap
3、挂载两个configmap,需要放到对应路径,kubeconfig放到/etc/kubeconfig/config,备份脚本放到运行路径下即可
4、配置cronjob定时运行挂载的脚本即可
apiVersion: v1
items:
Runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized
查看发现新节点/etc/cni/net.d/下无配置文件,把其他的节点的配置文件拷贝过来即可
10-canal.conflist calico-kubeconfig
虽然节点显示正常了不过运行容器报错:
Failed create pod sandbox: rpc error: code = Unknown desc = [failed to set up sandbox container "75b6c96ee03bcdb754b01c126afb8f77016000a27e1ad7d55bd4d1e31c7889c4" network for pod "demo1111-645996f944-lrkwq": NetworkPlugin cni failed to set up pod "demo1111-645996f944-lrkwq_yj-test" network: failed to find plugin "loopback" in path [/opt/cni/bin], failed to clean up sandbox container "75b6c96ee03bcdb754b01c126afb8f77016000a27e1ad7d55bd4d1e31c7889c4" network for pod "demo1111-645996f944-lrkwq": NetworkPlugin cni failed to teardown pod "demo1111-645996f944-lrkwq_yj-test" network: failed to find plugin "portmap" in path [/opt/cni/bin]] 2 minutes ago
Warning FailedCreatePodSandBox Failed create pod sandbox: rpc error: code = Unknown desc = [failed to set up sandbox container
查看/opt/cni/bin,果然也没有相关文件,同上把其他节点的拷贝过来
可是感觉应该不会莫名的没有安装上,查看rancher system项目,发现kube-system空间下的canal在node3还未成功启动,在查看原来是相关镜像拉取较慢。。镜像拉取成功后(我是手动导的)即一切正常。
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。