Usage

Requirement of Zprem repo

Requirements

  1. For Ansible Server (Controller Node) - Minimum 4 CPU, 8GB RAM and 8GB Storage

  2. For 0prem Server (Managed Node)

    • For testing purpose - Minimum 16 CPU, 32GB RAM and 50GB Storage

    • Recommended - 48 CPU, 128GB RAM and 150TB Storage

  3. The Operating System of Ansible and 0prem Server should be Ubuntu 18.04.6 LTS or Ubuntu 20.04.4 LTS

SSH

Sudo

This documentation presumes that users will employ the sudo utility for elevating privileges from the login user to the root user; a configuration in the file /etc/sudoers such as this:

# Allow members of group sudo to execute any command
sudo   ALL=(ALL:ALL) ALL

Share SSH Keys

Login to the Ansible Server -

a) run the following command in ansible server

sudo su -

after running the above commands your current directory should be /root you can check by using pwd command.

pwd

Before running ansible-playbook the ansible server should share ssh public key to 0prem server.

To create an SSH key:

  1. Generate the key:

  2. Append the public key (~/.ssh/id_rsa.pub by default) to the file ~/.ssh/authorized_keys of each remote server by using :

    or

Check the ansible server can login into 0prem server without asking any password by the following command: ssh [email protected] or ssh user@IPv4

0prem

  1. Clone the repository on ansible server

  2. Change the directory

  3. Your current directory should be ~/Zprem and add IPv4 in inventory file NOTE: write same IP in kubespray, master and worker groups

  4. Edit input.yaml

  5. Install pip3

  6. Install Ansible and other tools

  7. Give aws credentials in 0ansible/aws-credentials.yaml file - NOTE: This code itself creates DNS records in Route53

    <cluster>.<domain>

    rancher.<cluster>.<domain>

    grafana.<cluster>.<domain>

Example - DNS Looks like zcn.0chain.net , rancher.zcn.0chain.net , grafana.zcn.0chain.net and 0box.zcn.0chain.net

  1. Add Remote User in ansible.cfg file Note: use remote user same as used in ssh-copy-id [email protected]

Run the Ansible Playbook

Your current directory should be ~/0ansible :

if you want to check broader logs then run :

This link is created by binding host_address and domain in on_prem.json.

Syntax of URL - https://<cluster_name>.<domain>

  1. Explorer - zcn.0chain.net # link of the network you joined [will be shared once whole network is deployed]

  2. Rancher - rancher.zcn.0chain.net # link of the rancher you launched

  3. Grafana - grafana.zcn.0chain.net # link of the grafana you launched

  4. Diagnostics Page - zcn.0chain.net/sharder01/_diagnostics

Update-Resources

After Launching blobbers to a network if you wish to change any value then use update-blobber-resources.yaml file. NOTE: your current path should be ~/0ansible/.

  1. Run the following command for updating blobbers value -

  1. Run the following command for updating miners & sharders value -

ResetNetwork

For reset of the network [not the cluster] run reset-0chain.yaml file. NOTE: your current path should be ~/0ansible/.

  1. Run the following command for updating value -

RedeployNetwork

After running the reset playbook run after-reset.yaml playbook. NOTE: your current path should be ~/0ansible/.

  1. Run the following command for setting up network again -

  1. A prompt will open which asks for Y/N [here Y is Yes and N is No]. So type Y if you wish to delete configmaps otherwise type N and press ENTER key.

  2. About this reset script there are certain points -

Rancher - after redeploy rancher will use password same as used in first deployment [ though there are few ways through which we can create new username & password ]

Grafana - grafana will not pick earlier password after redploying it [ always pick the password given in input file so grafana password can be changed according to set by you ]

Remove-K8SCluster

For removing entire kubernetes cluster change your current directory to /root/kubespray and run the following command -

Last updated