您好,登錄后才能下訂單哦!
使用Rancher的負載均衡,上傳1M以上的文件報錯,查看ingress-nginx容器,發(fā)現(xiàn)配置
client_max_body_size 1m;
解決辦法:
創(chuàng)建ingress的時候修改參數(shù):
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
nginx.ingress.kubernetes.io/proxy-body-size: 50m
常規(guī)情況為使用定時任務(wù)運行腳本,運行命令即可
gitlab-rake gitlab:backup:create
k8s中運行的gitlab,使用cronjob定時運行腳本即可:
1、為了可以使用kubectl,需要使用kubeconfig,創(chuàng)建configmap 就叫kubeconfig:
#kubeconfig默認放在/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、掛載兩個configmap,需要放到對應(yīng)路徑,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
查看發(fā)現(xiàn)新節(jié)點/etc/cni/net.d/下無配置文件,把其他的節(jié)點的配置文件拷貝過來即可
10-canal.conflist calico-kubeconfig
雖然節(jié)點顯示正常了不過運行容器報錯:
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é)點的拷貝過來
可是感覺應(yīng)該不會莫名的沒有安裝上,查看rancher system項目,發(fā)現(xiàn)kube-system空間下的canal在node3還未成功啟動,在查看原來是相關(guān)鏡像拉取較慢。。鏡像拉取成功后(我是手動導(dǎo)的)即一切正常。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。