Blame docs/operations/ci/adding_cico_tenant/adding_cico_tenants.md

792b29
# CentOS CI - On-boarding
792b29
792b29
Note to users:
792b29
792b29
Please note that Infra space is for Fedora and CentOS related projects to
792b29
consume. Decision may take some time (often up to 2 weeks) as these are decided
792b29
by the whole team.
792b29
Once decided as go, we will create you a namespace in a openshift cluster where
792b29
you can configure your CI. We do provide a Jenkins template in case you want to be
792b29
able to consume vms/baremetal nodes to perform your CI.
792b29
792b29
Please answer the following questions so that we understand your requirement.
792b29
792b29
* How does your project relates to Fedora/CentOS?
792b29
* Describe your work flow and if you need any special permissions (other than
792b29
  admin access to namespace), please tell us and provide a reason for them.
792b29
* Do you need bare-metal/vms checkout capability? (we prefer your workflow
792b29
  containerized)
792b29
* Resources required
792b29
  * PVs:
792b29
792b29
```
792b29
Project_name:
792b29
Project_members:
792b29
 - user1@ACO_registered_email_address
792b29
 - user2@ACO_registered_email_address
792b29
```
792b29
792b29
## Steps
792b29
1. Create an OpenShift namespace
792b29
2. Create an entry in duffy db (with ssh key) - follow adding-duffy-api-key.md
f1ccc7
3. Create a PV(Persistent Volume) for Jenkins instance
f1ccc7
4. Instantiate a template to provision Jenkins
792b29
792b29
792b29
### Create an OpenShift namespace
792b29
792b29
Using the data provided by tenant (i.e. Project name and its admins), create an yaml file to be passed to ansible-playbook (example above).
792b29
b762e3
Store it in the (private) [projects directory](https://github.com/centosci/projects) to and push it to git
792b29
792b29
Use playbook (adhoc-openshift-resources.yaml)[https://github.com/CentOS/ansible-infra-playbooks/blob/staging/adhoc-openshift-resources.yaml] with variables `host=openshift-ci-management` and `the file containing project name and admins`
792b29
792b29
Example: "ansible-playbook playbooks/adhoc-openshift-resources.yaml -e "host=ocp-ci-management" -e "@important_project.yaml""
792b29
b762e3
!!! note
b762e3
    If you need to also modify members and/or email addresses, you can just follow the same process and replay the same playbook : that will reflect changes in openshift. If you need access to that private git repository (to be fixed and moved elsewhere in the official `centos` namespace, reach out to another infra team member
b762e3
792b29
0c8a7f
## Create an entry in duffy db (with ssh key) - [follow adding-duffy-api-key.md](/operations/ci/adding_cico_tenant/adding-duffy-api-key/)
792b29
f1ccc7
## Create a PV(Persistent Volume) for Jenkins instance
f1ccc7
f1ccc7
The default PV size for Jenkins instance is 10Gi. If a volume of a different size is created it will need to be reflected in the next section
f1ccc7
f1ccc7
To create the PV follow [Persistent storage via NFS](https://docs.infra.centos.org/operations/ci/installation/persistant_storage_nfs/). The host will be `ocp-ci-management`
f1ccc7
f1ccc7
792b29
## Instantiate a template to provision Jenkins
792b29
* Login to openshift
f1ccc7
* Ensure you are in Developer mode and select +Add from the menu
f1ccc7
* At the top select the Project cico-templates from the dropdown
f1ccc7
* Under the Developer Catalog section select All Services
f1ccc7
* Enter cico-workspace in the search field you will see a template 
f1ccc7
  called "cico-workspace: provided by The CentOS Project"
792b29
* Click the template to start instantiation process.
792b29
  * Select the namespace we want to run Jenkins in (In Namespace variable)
792b29
  * Enter appropriate Memory limit and volume capacity (for Jenkins, we prefer 3Gi and 10Gi respectively)
792b29
  * Enter duffy API key for the project and SSH private key whose public pair is in duffy db.
792b29
792b29
Click create to instantiate the project.
792b29
792b29
Admin's hack: Increase timeout in deployment config to counter our slow storage timeout issue.