使用Rancher的負(fù)載均衡,上傳1M以上的文件報(bào)錯(cuò),查看ingress-nginx容器,發(fā)現(xiàn)配置
專注于為中小企業(yè)提供成都網(wǎng)站設(shè)計(jì)、網(wǎng)站制作服務(wù),電腦端+手機(jī)端+微信端的三站合一,更高效的管理,為中小企業(yè)澄邁免費(fèi)做網(wǎng)站提供優(yōu)質(zhì)的服務(wù)。我們立足成都,凝聚了一批互聯(lián)網(wǎng)行業(yè)人才,有力地推動(dòng)了上千企業(yè)的穩(wěn)健成長,幫助中小企業(yè)通過網(wǎng)站建設(shè)實(shí)現(xiàn)規(guī)模擴(kuò)充和轉(zhuǎn)變。
client_max_body_size 1m;
解決辦法:
創(chuàng)建ingress的時(shí)候修改參數(shù):
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
nginx.ingress.kubernetes.io/proxy-body-size: 50m
常規(guī)情況為使用定時(shí)任務(wù)運(yùn)行腳本,運(yùn)行命令即可
gitlab-rake gitlab:backup:create
k8s中運(yùn)行的gitlab,使用cronjob定時(shí)運(yùn)行腳本即可:
1、為了可以使用kubectl,需要使用kubeconfig,創(chuàng)建configmap 就叫kubeconfig:
#kubeconfig默認(rèn)放在/root/.kube/config
kubectl create configmap kubeconfig -n gitlab --from-file=/root/.kube/config
2、創(chuàng)建備份腳本,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
導(dǎo)入到configmap
3、掛載兩個(gè)configmap,需要放到對應(yīng)路徑,kubeconfig放到/etc/kubeconfig/config,備份腳本放到運(yùn)行路徑下即可
4、配置cronjob定時(shí)運(yùn)行掛載的腳本即可
apiVersion: v1
items:
Runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized
查看發(fā)現(xiàn)新節(jié)點(diǎn)/etc/cni/net.d/下無配置文件,把其他的節(jié)點(diǎn)的配置文件拷貝過來即可
10-canal.conflist calico-kubeconfig
雖然節(jié)點(diǎn)顯示正常了不過運(yùn)行容器報(bào)錯(cuò):
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,果然也沒有相關(guān)文件,同上把其他節(jié)點(diǎn)的拷貝過來
可是感覺應(yīng)該不會莫名的沒有安裝上,查看rancher system項(xiàng)目,發(fā)現(xiàn)kube-system空間下的canal在node3還未成功啟動(dòng),在查看原來是相關(guān)鏡像拉取較慢。。鏡像拉取成功后(我是手動(dòng)導(dǎo)的)即一切正常。