<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                ## kubernetes 筆記 [TOC=3,8] ---- ### 安裝 #### 升級內核 ```shell $: chmod +x ./kernel_upgrade.sh && ./kernel_upgrade.sh ``` ---- #### 安裝 Docker 已安裝可跳過。 ```shell $: chmod +x ./docker_install.sh && ./docker_install.sh ``` ---- #### 安裝 k8s ##### 1: 準備工作 1. 準備三臺虛擬主機,mac 地址需要不同,并設置好網絡環境,保證 三臺虛機 網絡可以互通。 2. 接下來所有的命令在當前主機上執行前,需要先根據當前主機修改 `_hostname` 、`_hosts` 、`_m_ip` 文件 修改 `_hostname` 文件,內容為 主機名,如 主節點 `k8s-master` ,worker 節點 `k8s-node1` ~~~ k8s-master ~~~ 修改 `_hosts` ,如: ~~~ 192.168.11.67 k8s-master 192.168.11.90 k8s-node1 192.168.11.91 k8s-node2 ~~~ 修改 `_m_ip` 文件,內容為 內網ip > 注意 這些節ip 都是內網ip,而非外網ip ---- ##### 2: 執行安裝腳本 > 注意,需要在所有節點執行,請注意需改 _hostname 文件 ```shell $: chmod +x ./nodes_install.sh && ./nodes_install.sh ``` 說明:腳本會自動識別主節點,會在主節點上初始化集群。 ---- ##### 3: worker 節點加入到集群 見 `node_join.sh` 腳本 ,復制命令,token 值 為 上一步中主節點輸出的集群初始化結果。 ---- ##### 4: 測試 冒煙測試 ... ---- #### 其它 ``` vi /etc/kubernetes/kubeadm-config.yaml ``` ```shell # 查看日志 $: journalctl -xeu kubelet $: systemctl status kubelet $: netstat -antup | grep 6443 $: kubectl get cs ``` 常用命令: ```shell # 查看節點列表 $: kubectl get nodes -o wide $: kubectl get nodes --show-labels # 查看 pod 列表 $: kubectl get pods -n kube-system -o wide $: kubectl get pods --all-namespaces -o wide # 查看 deployment 列表 $: kubectl get deployments --all-namespaces -o wide #: kubectl edit deployment nginx-deployment # 查看 ReplicaSet 列表 $: kubectl get rs --all-namespaces -o wide # 查看 services 列表 $: kubectl get svc --all-namespaces -o wide $: kubectl describe svc nginx-svc # 查看 ingress 列表 $: kubectl get ingress --all-namespaces -o wide # 顯示 DaemonSet 列表 $: kubectl get ds --all-namespaces # 查看 pvc 列表 $: kubectl get pvc -n yf-test # 查看 pv 列表 $: kubectl get pv # 查看 namespace 列表 $: kubectl get namespaces # 分區配額限制 $: kubectl get resourcequota -n yf-test $: kubectl describe resourcequota yf-test -n yf-test # 創建命名空間 $: kubectl create namespace yf-test $: kubectl get sc --all-namespaces -o wide # 查看某個資源的詳細信息 $: kubectl describe pods calico-node-bmfqh -n kube-system $: kubectl describe pods coredns-6d8c4cb4d-4xdsv -n kube-system # 查看 密鑰 $: kubectl get secret docker-secret -o jsonpath='{.data}' $: kubectl get secret --all-namespaces -o wide $: kubectl describe secret docker-secret $: echo 'MWYyZDFlMmU2N2Rm' | base64 --decode # 查看配置 $: kubectl get configmap --all-namespaces -o wide # 刪除 pod $: kubectl delete pod coredns-6d8c4cb4d-4xdsv -n kube-system # 查看某個 pod 的日志 $: kubectl logs coredns-6d8c4cb4d-4xdsv -n kube-system $: kubectl logs coredns-6d8c4cb4d-4xdsv --all-containers -n kube-system # 進入容器 $: kubectl exec -it yf-api-deployment-f4ff84b49-g62bk -n yf-test -c nginx -- sh # 驗證集群可用性 $: kubectl get nodes -owide # 查看集群健康情況 $: kubectl get cs $: kubeadm token list ``` ~~~ vi /etc/sysconfig/network-scripts/ifcfg-enp0s3 TYPE=Ethernet PROXY_METHOD=none BROWSER_ONLY=no BOOTPROTO=static DEFROUTE=yes ONBOOT=yes IPADDR=192.168.11.67 NETMASK=255.255.255.0 GATEWAY=192.168.11.1 DNS1=114.114.114.114 DNS2=223.5.5.5 DNS3=1.1.1.1 DNS4=8.8.8.8 ~~~ ```shell ip addr service network restart systemctl stop firewalld.service systemctl disable firewalld.service systemctl status firewalld.service vi /etc/resolv.conf ``` ---- 容器別名 ```shell $: alias calicoctl="kubectl exec -i -n kube-system calicoctl -- /calicoctl" ``` ---- ~~~ ? root@k8s-master  ~/kubernetes/install  kubectl get pods --all-namespaces -o wide NAMESPACE NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES kube-system calico-kube-controllers-cd8566cf-dq5k6 1/1 Running 1 (9m54s ago) 22m 10.244.235.198 k8s-master <none> <none> kube-system calico-node-8kf6k 1/1 Running 1 (17m ago) 22m 192.168.11.91 k8s-node2 <none> <none> kube-system calico-node-bvwc8 1/1 Running 1 (9m55s ago) 22m 192.168.11.67 k8s-master <none> <none> kube-system calico-node-r7fc9 1/1 Running 0 22m 192.168.11.90 k8s-node1 <none> <none> kube-system coredns-6d8c4cb4d-4q6lb 1/1 Running 0 2m19s 10.244.36.65 k8s-node1 <none> <none> kube-system coredns-6d8c4cb4d-p6jl7 1/1 Running 0 3m49s 10.244.169.129 k8s-node2 <none> <none> kube-system etcd-k8s-master 1/1 Running 4 (9m55s ago) 5h3m 192.168.11.67 k8s-master <none> <none> kube-system kube-apiserver-k8s-master 1/1 Running 4 (9m53s ago) 5h3m 192.168.11.67 k8s-master <none> <none> kube-system kube-controller-manager-k8s-master 1/1 Running 7 (9m55s ago) 5h3m 192.168.11.67 k8s-master <none> <none> kube-system kube-proxy-gqjg4 1/1 Running 2 (18m ago) 113m 192.168.11.91 k8s-node2 <none> <none> kube-system kube-proxy-mvjb8 1/1 Running 3 (18m ago) 113m 192.168.11.90 k8s-node1 <none> <none> kube-system kube-proxy-ssbdr 1/1 Running 4 (9m55s ago) 5h2m 192.168.11.67 k8s-master <none> <none> kube-system kube-scheduler-k8s-master 1/1 Running 6 (9m54s ago) 5h3m 192.168.11.67 k8s-master <none> <none> ~~~ ~~~ coredns ports: 8080 8181/ready 53 9153 ~~~ coredns 要這樣處理下(不需要,是節點 nfs-utils 沒安裝的問題) https://blog.csdn.net/qq_40806970/article/details/99845808 ```shell $: kubectl edit cm coredns -n kube-system # loop 注釋 # 刪除 pod ``` coredns 默認有兩個副本,如果 pod 不正常,刪除 pod 重建后就會恢復(調度到 非 master 節點上后正常)。 ---- ### 理解 Kubernetes 對象 Kubernetes 對象是持久化的實體,用來表示 集群狀態,和指示其 如何 運行應用容器,及容器所需資源等。 ---- ### Pod **更新策略** [Pod 更新與替換](https://kubernetes.io/zh-cn/docs/concepts/workloads/pods/#pod-update-and-replacement) Pod 的絕大多數元數據都是不可變的。例如,你不可以改變其 namespace、name、 uid 或者 creationTimestamp 字段;generation 字段是比較特別的, 如果更新該字段,只能增加字段取值而不能減少。 1. 其它字段更新都會導致觸發“更新策略”嗎? 2. 如果沒有字段需要變更,就是想觸發“更新策略”如何實現,如鏡像更新了,但是標簽名不變的情況? 用 env 字段 ---- ### 容器 Kubernetes 中的抽象允許你將容器化的應用部署到集群,而無需將它們綁定到某個特定的獨立計算機。為了使用這種新的部署模型,應用需要以將應用與單個主機分離的方式打包:它們需要被容器化。與過去的那種應用直接以包的方式深度與主機集成的部署模型相比,容器化應用更靈活、更可用。 Kubernetes 以更高效的方式跨集群自動分發和調度應用容器 **容器運行時** 如 Docker ,負責從倉庫中提取容器鏡像,運行應用容器。 ---- ### Service Service可以起到對pod負載均衡的作用,主要有3種service type(ClusterIP,NodePort,LoadBalance),其中type為ClusterIP時有2種情況,clusterIP設置為None時,我們把它稱為headless service,這個headless service與普通的service有什么區別呢? headless service設置clusterIP為None,那么在k8s集群中,kube-proxy就不對其進行代理,則集群內部對象在訪問該服務時將返回服務的全部pod的ip,開發者可以根據這些ip列表自己做負載均衡。我們對以上說法進行下證明 https://blog.csdn.net/RIGHTSONG/article/details/114917562 > NodePort 隨機分配一個集群內唯一的端口,訪問任意節點ip的該端口都能找到服務 (而不論節點上是否有該 pod ,不過直接訪問 pod 所在節點的ip 應該更快一點)。 1. 每個 Pod 都有自己的 虛擬ip 2. Pod 內鏡像網絡互通(不是容器環境互通,而是通過 kube-proxy 實現的網絡互通) 3. 東西流量(集群內部流量) 完全可以通過 服務名(Pod虛擬ip)互通,端口就是 容器的指定端口。 ---- ### 命名空間 在 Kubernetes 中,名字空間(Namespace) 提供一種機制,將同一集群中的資源劃分為相互隔離的組。 同一名字空間內的資源名稱要唯一,但跨名字空間時沒有這個要求。 名字空間作用域僅針對帶有名字空間的對象, (例如 Deployment、Service 等),這種作用域對集群范圍的對象 (例如 StorageClass、Node、PersistentVolume 等)不適用。 如: yf --- ### 節點 分為 主節點 和 工作節點,主節點 調度 pod 在工作節點運行。 ---- ### 網絡 ---- ### pod 運行容器的負載,k8s 最小調度點。 ---- ### statfulset ---- ### 卷 ---- ### 持久存儲 節點選擇 ---- ### 節點選擇 節點選擇控制,節點親和性 ---- ### 負載均衡 基于 DNS 和 Service 的 兩層負載均衡 ~~~ DNS 域名解析負載均衡 www.domain.com / | \ / | \ --------------------------------------------------------------------------- DNS 的負載均衡太簡單,這里還可以加一層廠商的負載均衡 如 SLB,不過成本不低 --------------------------------------------------------------------------- / | \ / | \ Ingress node 192.168.0.1 192.168.0.2 192.168.0.3 ... | \ \ Service svc-A svc-B svc-C ... |\ \ | \ \ | \ \ | \ \ | \ \ | \ \ | \ \ | \ \ | \ \ | \ \ pod pod-a-1(node1) pod-a-2(node2) pod-a-3(node3) ... 無狀態 pod 橫向水平擴展 ~~~ 部署 Ingress Controller 的節點充當內部服務與外部的橋梁,服務與 pod 節點之間也有一層負載均衡。 Ingress Controller 負載最好單獨固定使用幾個節點,上面不進行其它工作 pod 負載,網絡和 cpu 配置要好,并針對網絡程序進行優化。 無狀態 pod 副本可無限水平擴容,理論上只要節點足夠,負載提升就沒有上限。 > 如果自行安裝高可用組件的話 (HAProxy, keepalived),會有一個虛擬ip 綁定到某一個節點上(keepalived 會確保虛擬ip 一直綁定到可用的節點上),此后訪問這個虛擬ip 就會根據一定的機制被路由的某一個節點上,以此實現高可用。 ---- ### ConfigMap ---- ### 日志 ---- ### 監控 ---- ### 滾動發布 ---- ### DaemonSet DaemonSet 保證滿足條件的節點只會部署一個 pod ,需要注意的是這里 “只會部署一個 pod ” 是指 該 pod 在一個節點上只會部署一個 而不是指一個節點只能有一個 DaemonSet pod,一個節點可以有多個 DaemonSet pod,如 可部署多個不同的 DaemonSet pod: logstash , Prometheus Node Exporter, kube-proxy ---- ### 計劃任務 ---- ### 安裝 helm ```shell $: mkdir helm && cd helm #$: wget https://get.helm.sh/helm-v3.12.1-linux-amd64.tar.gz $: wget https://yf5gcar.oss-cn-shanghai.aliyuncs.com/org/helm-v3.12.1-linux-amd64.tar.gz $: tar -zxvf helm-v3.12.1-linux-amd64.tar.gz $: mv linux-amd64/helm /usr/local/bin/helm $: helm version # 阿里云 helm 倉庫 $: helm repo add aliyun https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts $: helm repo add aliyun https://apphub.aliyuncs.com/stable ``` ```shell $: helm list --all-namespaces $: helm delete xxx -n xxx-namespace ``` ---- ### 部署 Ingress https://kubernetes.github.io/ingress-nginx/deploy/#bare-metal-clusters **install for helm:** ```shell # 添加倉庫 $: helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx # 查看倉庫列表 $: helm repo list # 搜索 ingress-nginx $: helm search repo ingress-nginx # 下載安裝包 $: helm pull ingress-nginx/ingress-nginx --version 4.7.0 $: tar -zxvf ingress-nginx-4.7.0.tgz ``` 配置參數 調整 (除了安裝 helm ,這些可以跳過, ingress-nginx-4.7.0 已準備好,直接安裝就可以了。) ~~~ # 修改 values.yaml 鏡像地址:修改為國內鏡像 registry: registry.cn-hangzhou.aliyuncs.com image: google_containers/nginx-ingress-controller image: google_containers/kube-webhook-certgen tag: v1.3.0 hostNetwork: true dnsPolicy: ClusterFirstWithHostNet 修改部署配置的 kind: DaemonSet nodeSelector: ingress: "true" # 增加選擇器,如果 node 上有 ingress=true 就部署 將 admissionWebhooks.enabled 修改為 false 將 service 中的 type 由 LoadBalancer 修改為 ClusterIP,如果服務器是云平臺才用 LoadBalancer ~~~ ```shell # 為需要部署 ingress 的節點上加標簽 $: kubectl label nodes k8s-node1 ingress=true $: kubectl get nodes --show-labels # 刪除節點 # 注意,不要直接 非法刪除 節點服務器(如直接釋放節點主機),應該是這個 這個命令刪除節點,不然的話會造成集群狀態異常,此時可以嘗試 重啟 主節點服務器 reboot $: kubectl delete nodes k8s-node-xxx # 安裝 ingress-nginx $: kubectl create namespace ingress-nginx $: helm install ingress-nginx ./ingress-nginx-4.7.0 -n ingress-nginx ``` ~~~ 遇到 鏡像下載失敗時,修改 鏡像地址 kubectl edit ds ingress-nginx-controller -n ingress-nginx image: registry.cn-hangzhou.aliyuncs.com/google_containers/nginx-ingress-controller:v1.8.0 ~~~ ```shell $: kubectl get pods --all-namespaces -o wide # 在 ingress 節點上查看,可以看到 ingress-nginx 已經啟動了,接下來 配置我們的 ingress 資源就好了 $: netstat -antup | grep 80 $: netstat -antup | grep 443 ``` ---- ### 外部訪問集群 [運維 - 01.kubernetes筆記 Pod及 Security Context安全上下文 - 個人文章 - SegmentFault 思否](https://segmentfault.com/a/1190000040651880?utm_source=sf-similar-article) > 提示沒有SSL認證 因為.kube/config秘鑰格式curl無法識別 > 解決辦法是讓 kubectl proxy 實現https會話卸載 通過kubectl---->API service相互認證 curl通過http訪問 kubectl映射端口 [kubectl proxy 讓外部網絡訪問K8S service的ClusterIP - 塵葉心繁的專欄 - TNBLOG](http://tnblog.net/hb/article/details/4681) ```shell # master 上執行 $: kubectl proxy --address='0.0.0.0' --accept-hosts='^*$' # server: https 改為 http,ip 改為 外網ip,端口 改為 8001 # http://124.222.180.179:8001 $: cat ~/.kube/config ``` 這樣在 Lens 中就可以導入集群使用了,不過感覺 UI 也不是很好用,命令行反而還更快更方便些。 ---- ### 配置默認存儲類 ```shell # 為空說明沒有配置存儲類 $: kubectl get storageclass $: kubectl get sc ``` **安裝 NFS 存儲類** https://kubernetes.io/zh-cn/docs/concepts/storage/storage-classes/#nfs https://github.com/kubernetes-sigs/nfs-ganesha-server-and-external-provisioner ```shell $: cd install/nfs # k8s-node2 節點上部署 nfs 服務 $: kubectl label nodes k8s-node2 nfs=true # 每個節點上安裝 (否則使用時可能掛載失敗) $: yum install -y nfs-utils # 部署 nfs 服務 $: kubectl apply -f deployment.yaml $: kubectl apply -f rbac.yaml # 創建 nfs 存儲類 (提供者: example.com/nfs Service 實現) $: kubectl apply -f class.yaml # 創建 pvc $: kubectl apply -f claim.yaml # 默認已自動制備 pv $: kubectl get pv # 測試 pod 掛載 pv $: kubectl apply -f write-pod.yaml $: kubectl apply -f read-pod.yaml # 設置默認存儲類 $: kubectl patch storageclass example-nfs -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}' # IsDefaultClass: Yes $: kubectl describe sc example-nfs # 可以看到默認存儲類設置完成 $: kubectl get sc NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE example-nfs (default) example.com/nfs Delete Immediate false 27m ``` ---- **國外鏡像無法拉取問題:** 遇到國內下載不了的鏡像可以先看看 registry.cn-hangzhou.aliyuncs.com/google_containers 中有沒有, 如果沒有就去 https://labs.play-with-docker.com 上白嫖國外的服務器來下載鏡像 再打標簽推到阿里鏡像倉庫上自己用就行了,出口轉內銷了啊,不對,應該是 走私進口 ^_^,嗯,曲線救國。 ```shell $: docker pull registry.k8s.io/sig-storage/nfs-provisioner:v4.0.8 $: docker login registry.cn-hangzhou.aliyuncs.com --username=811800545@qq.com $: docker tag registry.k8s.io/sig-storage/nfs-provisioner:v4.0.8 registry.cn-hangzhou.aliyuncs.com/yf5g/sig-storage-nfs-provisioner:v4.0.8 $: docker push registry.cn-hangzhou.aliyuncs.com/yf5g/sig-storage-nfs-provisioner:v4.0.8 $: docker pull registry.cn-hangzhou.aliyuncs.com/yf5g/sig-storage-nfs-provisioner:v4.0.8 ``` ---- ### 在 Kubernetes 上安裝 KubeSphere 注意: 1. 安裝前一定要確認 集群需要已配置默認 StorageClass,否則安裝會失敗 2. 如果安裝失敗,請執行 `kubesphere-delete.sh` 完全卸載后再重新安裝 3. 必須保證節點資源至少 4C-8G (DevOps 節點可能需要 16G 內存) 4. 可插拔組件 也支持 安裝后再啟用,所有安裝時可以先按照如下最小安裝 [在 Kubernetes 上最小化安裝 KubeSphere](https://www.kubesphere.io/zh/docs/v3.3/quick-start/minimal-kubesphere-on-k8s/) [啟用可插拔組件](https://www.kubesphere.io/zh/docs/v3.3/pluggable-components/) kubesphere 版本: v3.3.2 使用端口: NodePort (IP:30880) 默認帳戶: admin/P@88w0rd 建議安裝組件: ~~~ KubeSphere 監控系統 ? KubeSphere DevOps系統 ? KubeSphere 事件系統 x KubeSphere 告警和通知 x KubeSphere 應用商店 x KubeSphere 日志系統 x KubeSphere 服務網格 x ~~~ ```shell $: cd install/kubesphere # $: wget https://github.com/kubesphere/ks-installer/releases/download/v3.3.2/kubesphere-installer.yaml # 下載后編輯文件 # $: wget https://github.com/kubesphere/ks-installer/releases/download/v3.3.2/cluster-configuration.yaml $: kubectl apply -f kubesphere-installer.yaml $: kubectl apply -f cluster-configuration.yaml # 檢查安裝情況 $: kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l 'app in (ks-install, ks-installer)' -o jsonpath='{.items[0].metadata.name}') -f $: kubectl get svc/ks-console -n kubesphere-system # 訪問 NodeIP:NodePort 登錄控制臺 124.221.89.233:30880 ``` ```shell # 卸載 $: chmod +x ./kubesphere-delete.sh && ./kubesphere-delete.sh ``` 常見問題: https://www.cnblogs.com/cosmos-wong/p/15759645.html ---- ### 記一次 網絡故障 集群容器內無法訪問外網域名 因為之前 非常規刪除過一次 節點,后面再出現了一個 coredns 不正常的情況。 ```shell kubectl -n kube-system edit cm coredns -o yaml ``` 找到原因了:是節點 nfs-utils 沒安裝的問題 coredns 默認有兩個副本,如果 pod 不正常,刪除 pod 重建后就會恢復(調度到 非 master 節點上后正常)。 ---- ### 問題排查步驟 **集群問題** ```shell # 查看日志 $: journalctl -xeu kubelet # 查看狀態 $: systemctl status kubelet # 檢查端口 $: netstat -antup | grep 6443 # 查看集群狀態 $: kubectl get cs ``` **節點問題** ```shell # 查看節點列表 $: kubectl get nodes -o wide $: kubectl get nodes --show-labels # 查看節點信息 # 查看 NotReady 原因 $: kubectl describe nodes k8s-node2 # 查看 coredns-xxxxxxx-xxx 狀態(至少兩個 pod ,不能在 master 上,如果不正常可以嘗試刪除) $: kubectl get pods -n kube-system -o wide # 查看 pod 詳情 $: kubectl describe pods coredns-xxxxxxx-xxx -n kube-system # 刪除 pod $: kubectl delete pods coredns-xxxxxxx-xxx -n kube-system ``` **Pod 問題** ```shell # 查看 pod 列表 $: kubectl get pods --all-namespaces -o wide $: kubectl get pods -n kube-system -o wide $: kubectl get pods -n yf-test -o wide # 查看 pod 詳情 $: kubectl describe pods yf-api-deployment-f4ff84b49-g62bk -n yf-test # 獲取 pod yaml 格式的配置 $: kubectl get pods yf-api-deployment-f4ff84b49-g62bk -n yf-test -o yaml # 查看 deployment 詳情 $: kubectl describe deployment yf-api-deployment -n yf-test # 編輯 deployment $: kubectl edit deployment yf-api-deployment -n yf-test # 獲取 deployment yaml 格式的配置 $: kubectl get deployment yf-api-deployment -n yf-test -o yaml # 查看某個 pod 的日志 $: kubectl logs coredns-6d8c4cb4d-4xdsv -n kube-system $: kubectl logs coredns-6d8c4cb4d-4xdsv --all-containers -n kube-system # 進入容器 $: kubectl exec -it yf-api-deployment-f4ff84b49-g62bk -n yf-test -c nginx -- sh # 顯示 DaemonSet 列表 $: kubectl get ds --all-namespaces ``` **服務問題** ```shell # 查看 services 列表 $: kubectl get svc --all-namespaces -o wide $: kubectl describe svc nginx-svc # 查看 ingress 列表 $: kubectl get ingress --all-namespaces -o wide ``` **pv/pvc** ```shell # 獲取 存儲類 列表 $: kubectl get sc --all-namespaces -o wide # 查看 pvc 列表 $: kubectl get pvc -n yf-test # 查看 pv 列表 $: kubectl get pv ``` **secret/configmap** ```shell # 查看 密鑰 $: kubectl get secret docker-secret -o jsonpath='{.data}' $: kubectl get secret --all-namespaces -o wide $: kubectl describe secret docker-secret $: echo 'MWYyZDFlMmU2N2Rm' | base64 --decode # 查看配置 $: kubectl get configmap --all-namespaces -o wide ``` **** **kubesphere 流水線問題** 1. 流水線編輯 把 node 都選 base 再試一下 2. 重新創建 devops-jenkins, devops-controller 負載試一下 http://101.133.137.104:30880/clusters/default/projects/kubesphere-devops-system/deployments/devops-jenkins/resource-status 3. 刪除 base pod 試試,http://101.133.137.104:30180/computer/ base 節點刪除試試(也有同步刪除) 4. 重啟 Jenkins 試試 http://101.133.137.104:30180/restart 5. 先把等待的流水線任務全部停止
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看