Openshift集群升级3.6至3.7

作者: 潘晓华Michael | 来源:发表于2018-05-03 14:24 被阅读41次

    更新方法与策略:自动升级方法

    更新openshift-ansible的脚本代码

    git pull 
    git checkout -b release-3.7
    

    安装需要的包

    ansible all -m yum -a 'name=pyOpenSSL state=present'
    

    关闭Service Catalog和Template Service Broker。
    3.7 以上版本默认会启用 Service Catalog 和 Template Service Broker

    # /etc/ansible/hosts
    ...
    openshift_enable_service_catalog=false
    template_service_broker_install=false
    ...
    

    关闭etcd目录的selinux检查
    关闭任务Check selinux label of '{{ etcd_data_dir }}'与Make sure the '{{ etcd_data_dir }}' has the proper label

    # roles/etcd/tasks/backup/backup.yml
    ...
    - name: Detecting Atomic Host Operating System
      stat:
        path: /run/ostree-booted
      register: l_ostree_booted
    
    #- name: Check selinux label of '{{ etcd_data_dir }}'
    #  command: >
    #    stat -c '%C' {{ etcd_data_dir }}
    #  register: l_etcd_selinux_labels
    #
    #- debug:
    #    msg: "{{ l_etcd_selinux_labels }}"
    #
    #- name: Make sure the '{{ etcd_data_dir }}' has the proper label
    #  command: >
    #    chcon -t svirt_sandbox_file_t  "{{ etcd_data_dir }}"
    #  when:
    #  - l_etcd_selinux_labels.rc == 0
    #  - "'svirt_sandbox_file_t' not in l_etcd_selinux_labels.stdout"
    
    - name: Generate etcd backup
      command: >
        {{ r_etcd_common_etcdctl_command }} backup --data-dir={{ l_etcd_incontainer_data_dir }}
        --backup-dir={{ l_etcd_incontainer_backup_dir }}
    ...
    

    执行更新

    ansible-playbook -i inventory-hosts playbooks/byo/openshift-cluster/upgrades/v3_7/upgrade.yml
    

    查看当前oc版本及各node版本

    oc version
    oc get node
    

    升级后发现的问题

    RBD的storageclass异常

    # 解决方法,storageclass.parameters中添加 imageFormat: "1"
    apiVersion: storage.k8s.io/v1
    metadata:
       name: ceph-rbd-sc
    Parameters:
      adminId: admin
      adminSecretName: ceph-secret
      adminSecretNamespace: kube-system
      fsType: ext4
      imageFormat: "1"
      monitors: 192.168.1.3:6789
      pool: rbd
      userId: admin
      userSecretName: ceph-secret
    Provisioner: kubernetes.io/rbd
    

    相关文章

      网友评论

        本文标题:Openshift集群升级3.6至3.7

        本文链接:https://www.haomeiwen.com/subject/itvqrftx.html