真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

Rancher2.x,K8S,使用問題記錄(持續(xù)更新.)

1、ingress-nginx,修改默認(rèn)的Nginx上傳大?。?/h3>

使用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

2、k8s使用cronjob自動(dòng)備份gitlab

常規(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:

  • apiVersion: batch/v1beta1
    kind: CronJob
    metadata:
    name: gitlab2-backup
    namespace: gitlab
    spec:
    concurrencyPolicy: Allow
    failedJobsHistoryLimit: 10
    jobTemplate:
    metadata:
    creationTimestamp: null
    spec:
    template:
    metadata:
    spec:
    containers:
    • command:
      • sh
      • /home/demo.sh
        image: lachlanevenson/k8s-kubectl:v1.17.0
        imagePullPolicy: IfNotPresent
        name: gitlab2-backup
        resources: {}
        stdin: true
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        tty: true
        volumeMounts:
      • mountPath: /etc/kubeconfig
        name: vol1
      • mountPath: /home
        name: vol2
        volumes:
    • configMap:
      defaultMode: 420
      name: kubeconfig
      optional: false
      name: vol1
    • configMap:
      defaultMode: 493
      name: backup-config
      optional: false
      name: vol2
      schedule: 25 8 *
      successfulJobsHistoryLimit: 10
      suspend: false
      kind: List
      metadata:
      resourceVersion: ""
      selfLink: ""

3、Rancher新增加節(jié)點(diǎn)報(bào)錯(cuò)

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)的)即一切正常。


分享文章:Rancher2.x,K8S,使用問題記錄(持續(xù)更新.)
轉(zhuǎn)載源于:http://weahome.cn/article/pddhcs.html

其他資訊

在線咨詢

微信咨詢

電話咨詢

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部