zoukankan      html  css  js  c++  java
  • 升级coredns

    一、查看当前coredns版本

    [root@k8s-master01 ~]# kubectl get pod -n kube-system coredns-6ccb5d565f-8fjrk -oyaml | grep image
        image: coredns/coredns:1.8.0
        imagePullPolicy: IfNotPresent
        image: coredns/coredns:1.8.0
    

    二、升级

    2.1、coredns介绍

    # coredns官网:https://github.com/coredns/coredns
    # 老版本用:kube-dns
    # 新版的都用:coredns3
    
    
    # 部署文档:https://github.com/coredns/deployment/tree/master/kubernetes
    

    2.2、备份原来的cm、deploy、clusterrole、clusterrolebinding

    [root@k8s-master01 ~]# kubectl get cm -n kube-system coredns -oyaml > coredns-config.yaml
    [root@k8s-master01 ~]# kubectl get deploy -n kube-system coredns -oyaml > coredns-controllers.yaml
    [root@k8s-master01 ~]# kubectl get clusterrole system:coredns -oyaml > coredns-clusterrole.yaml
    [root@k8s-master01 ~]# kubectl get clusterrolebinding  system:coredns -oyaml > coredns-clusterrolebinding.yaml
    

    2.3、升级

    # 1、下载文件
    [root@k8s-master01 ~]# git clone https://github.com/coredns/deployment.git
    
    # 2、升级
    [root@k8s-master01 ~]# cd deployment/kubernetes/
    [root@k8s-master01 kubernetes]# ./deploy.sh -s | kubectl apply -f -
    
  • 相关阅读:
    JZ-C-36
    JZ-C-35
    JZ-C-34
    JZ-C-33
    JZ-C-32
    JZ-C-31
    JZ-C-30
    JZ-C-29
    JZ-C-28
    JZ-C-27
  • 原文地址:https://www.cnblogs.com/hsyw/p/14396073.html
Copyright © 2011-2022 走看看