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

How to deploy OpenShift Origin 10 (OKD) on one node with GlusterFS

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

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

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

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

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

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

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

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

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