.. _tenant_deployment: Deploy a tenant instance of Software Factory -------------------------------------------- .. warning:: Tenant deployment mode must be considered beta for the 3.1 release. A tenant SF is an instance that does not run Zuul services. Zuul services (Zuul, Nodepool) will be shared with a Master SF. Users of a tenant SF benefit from their own SF services like Gerrit or ELK. In this guide, we will deploy a SF for a tenant. This tenant will run Gerrit. Some tasks will be executed on the Tenant SF and some others on the master SF. Deploy the minimal tenant architecture ...................................... On a CentOS-7 system, deploy the tenant minimal architecture: .. code-block:: bash yum install -y https://softwarefactory-project.io/repos/sf-release-3.1.rpm yum update -y yum install -y sf-config cp /usr/share/sf-config/refarch/tenant-minimal.yaml /etc/software-factory/arch.yaml Into /etc/software-factory/sfconfig.yaml add: .. code-block:: yaml tenant-deployment: name: tenant-name master-sf: https://master-sf.com If the tenant config repositories are on Github, follow :ref:`Create a config and jobs repository` to create the projects and the section :ref:`Update the configuration` without the github_connection section since it is already set in the main instance. Then run sfconfig: .. code-block:: bash sfconfig Add the new tenant on the Master SF ................................... Define the tenant's default connection in /etc/software-factory/sfconfig.yaml: .. code-block:: yaml gerrit_connections: - name: tenant-gerrit hostname: tenant-sf.com port: 29418 puburl: https://tenant-sf.com/r/ username: zuul Then run sfconfig .. code-block:: yaml sfconfig --skip-install Define the new tenant inside the resources. Create the following file config/resources/tenant.yaml: .. code-block:: yaml resources: tenants: tenant-sf: description: "The new tenant" url: "https://tenant-sf.com/manage" default-connection: tenant-gerrit .. code-block:: bash git add resources/tenant.yaml && git commit -m"Add new tenant" && git review Once the change is approved, merged and the *config-update* finished with success, operator can run a new sfconfig run on the tenant SF. Finalize the tenant SF configuration .................................... The Master is now configured and know about the new tenant, then a final sfconfig run on the tenant SF will finalize the pairing. .. code-block:: bash sfconfig --skip-install Workflow details ................ A tenant SF gets its own SF config repository. The tenant can manage its own resources like CRUD on Gerrit repositories. *config-check* and *config-update* jobs are triggered during a change lifecycle for the tenant's config repository. Both are executed on the Master SF's Zuul executor.