代码之家  ›  专栏  ›  技术社区  ›  ImranRazaKhan

如何使用GlusterFS在一个节点上部署OpenShift Origin 10(OKD)

  •  0
  • ImranRazaKhan  · 技术社区  · 7 年前

    我可以在一个节点上安装OKD,在多个节点上相应地安装scaleup。 但是现在我想在一个节点上安装带有GlusterFS的OKD,然后在多个节点上扩展它。

    根据github文档,我有三种选择

    1. 配置新的、本机托管的GlusterFS集群。在这个场景中,GlusterFS吊舱被部署在OpenShift集群中的节点上,这些节点被配置为提供存储。
    2. 配置新的外部GlusterFS集群。在此场景中,集群节点预装了GlusterFS软件,但尚未配置。安装程序将负责配置集群以供OpenShift应用程序使用。
    3. 使用现有的GlusterFS集群。在这个场景中,假设已经设置了一个或多个GlusterFS集群。这些集群可以是本机托管的,也可以是外部的,但必须由heketi服务管理。

    选项2或3是否可以用于从一个节点开始并相应地扩展?我已经在一个节点上安装了glusterfs集群并将其扩展到第二个节点,但是如何在openshift中引入它呢?

    https://imranrazakh.blogspot.com/2018/08/

    1 回复  |  直到 7 年前
        1
  •  0
  •   ImranRazaKhan    7 年前

    我找到了一种在一个节点上安装glusterfs的方法,下面是使用glusterfs的多功能安装

    更改了如下清单文件

        [OSEv3:children]
        masters
        nodes
        etcd
        glusterfs
    
        [OSEv3:vars]
        ansible_ssh_common_args='-o StrictHostKeyChecking=no'
        ansible_ssh_user=root
        openshift_deployment_type=origin
        openshift_enable_origin_repo=false
        openshift_disable_check=disk_availability,memory_availability
    
        os_firewall_use_firewalld=true
    
        openshift_public_hostname=console.1.1.0.1.nip.io
        openshift_master_default_subdomain=apps.1.1.0.1.nip.io
    
        openshift_storage_glusterfs_is_native=false
        openshift_storage_glusterfs_storageclass=true
        openshift_storage_glusterfs_heketi_is_native=true
        openshift_storage_glusterfs_heketi_executor=ssh
        openshift_storage_glusterfs_heketi_ssh_port=22
        openshift_storage_glusterfs_heketi_ssh_user=root
        openshift_storage_glusterfs_heketi_ssh_sudo=false
        openshift_storage_glusterfs_heketi_ssh_keyfile="/root/.ssh/id_rsa
    
        [masters]
        1.1.0.1 openshift_ip=1.1.0.1 openshift_schedulable=true
    
        [etcd]
        1.1.0.1  openshift_ip=1.1.0.1    
    
        [nodes]
        1.1.0.1  openshift_ip=1.1.0.1  openshift_node_group_name="node-config-all-in-one"  openshift_schedulable=true
    
        [glusterfs]
        1.1.0.1  glusterfs_devices='[ "/dev/vdb" ]'
    

    --耐久性无

    openshift-ansible/roles/openshift_storage_glusterfs/tasks/heketi_init_db.yml
    

    以下是更新的代码段

    - name: Create heketi DB volume
      command: "{{ glusterfs_heketi_client }} setup-openshift-heketi-storage --image {{ glusterfs_heketi_image }} --listfile /tmp/heketi-storage.json --durability none"
      register: setup_storage
    

    默认情况下,它会创建需要复制环境的StorageClass,因此我们必须创建自定义StorageClass,如下面的“volumetype:none”

    oc create -f - <<EOT
    apiVersion: storage.k8s.io/v1
    kind: StorageClass
    metadata:
      name: glusterfs-nr-storage
      annotations:
        storageclass.beta.kubernetes.io/is-default-class: "true"
    parameters:
      resturl: http://heketi-storage.glusterfs.svc:8080
      restuser: admin
      secretName: heketi-storage-admin-secret
      secretNamespace: glusterfs
      volumetype: none
    provisioner: kubernetes.io/glusterfs
    volumeBindingMode: Immediate
    EOT
    

    现在您可以从webconsole动态创建存储:)欢迎您提出任何改进建议。

    接下来我将检查如何扩展它?