【问题标题】:How to deploy OpenShift Origin 10 (OKD) on one node with GlusterFS如何使用 GlusterFS 在一个节点上部署 OpenShift Origin 10 (OKD)
【发布时间】:2018-09-27 12:18:07
【问题描述】:

我能够在一个节点上安装 OKD 并在多个节点上相应地进行扩展。 但现在我想在一个节点上安装带有 GlusterFS 的 OKD,然后在多个节点上扩展它。 目前我收到至少需要三个节点的错误。我如何在 ansible 中绕过这个检查?

根据 github 文档,我有三个选项

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

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

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

【问题讨论】:

    标签: openshift openshift-origin


    【解决方案1】:

    我找到了一种在一个节点上安装 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" ]'
    

    现在我们必须通过在下面的 ansible 脚本中添加 --durability none 来破解 ansible 脚本,因为它需要三个节点

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

    以下是更新sn-p

    - 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,因此我们必须使用“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 动态创建存储 :) 欢迎提出任何改进建议。

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-08-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多