Skip to content

Commit

Permalink
Enhancement: Updated documentation for HCP (#354)
Browse files Browse the repository at this point in the history
Updated documentation for HCP
Updated parmfile template for zVM

---------

Signed-off-by: DAMISETTI-VEERABHADRARAO <[email protected]>
  • Loading branch information
veera-damisetti authored Nov 25, 2024
1 parent 1c1da4b commit f1a0901
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 10 deletions.
16 changes: 10 additions & 6 deletions docs/run-the-playbooks-for-hcp.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ ansible-vault create playbooks/secrets.yaml
```
kvm_host_password: '<password for kvm host for the specified user>'
bastion_root_pw: '<password_you_want_to_keep_for_bastion>'
api_server: '<api-server-url>:<port>'
user_name: '<username>'
password: '<password>'
# Management cluster login credentials
api_server: '<api-server-url ot management cluster>:<port>'
user_name: '<username >'
password: '<password >'
```

* You can edit the encrypted file using below command
Expand All @@ -39,7 +41,7 @@ ansible-vault edit playbooks/secrets.yaml

## Step-2: Initial Setup for Hosted Control Plane
* Navigate to the [root folder of the cloned Git repository](https://github.com/IBM/Ansible-OpenShift-Provisioning) in your terminal (`ls` should show [ansible.cfg](https://github.com/IBM/Ansible-OpenShift-Provisioning/blob/main/ansible.cfg)).
* Update variables as per the compute node type (zKVM /zVM) in [hcp.yaml](https://github.com/veera-damisetti/Ansible-OpenShift-Provisioning/blob/main/inventories/default/group_vars/hcp.yaml.template) ( hcp.yaml.template )before running the playbooks.
* Update variables as per the compute node type (zKVM /zVM) in [hcp.yaml](https://github.com/IBM/Ansible-OpenShift-Provisioning/blob/main/inventories/default/group_vars/hcp.yaml.template) ( hcp.yaml.template )before running the playbooks.
* First playbook to be run is setup_for_hcp.yaml which will create inventory file for HCP and will add ssh key to the kvm host.

* Run this shell command:
Expand All @@ -48,7 +50,9 @@ ansible-playbook playbooks/setup_for_hcp.yaml --ask-vault-pass
```

## Step-3: Create Hosted Cluster
* Run each part step-by-step by running one playbook at a time, or all at once using [hcp.yaml](https://github.com/veera-damisetti/Ansible-OpenShift-Provisioning/blob/main/playbooks/hcp.yaml).
* Run each part step-by-step by running one playbook at a time, or all at once using [hcp.yaml](https://github.com/IBM/Ansible-OpenShift-Provisioning/blob/main/playbooks/hcp.yaml).
* If bastion is already available ( bastion_params.create = false ) , just give ip ,user, and nameserver under bastion_params section and remaining parameters under bastion_params can be ignored.

* Here's the full list of playbooks to be run in order, full descriptions of each can be found further down the page:
* create_hosted_cluster.yaml ([code](https://github.com/IBM/Ansible-OpenShift-Provisioning/blob/main/playbooks/create_hosted_cluster.yaml))
* create_agents_and_wait_for_install_complete.yaml ([code](https://github.com/IBM/Ansible-OpenShift-Provisioning/blob/main/playbooks/create_agents_and_wait_for_install_complete.yaml))
Expand Down Expand Up @@ -111,7 +115,7 @@ ansible-playbook playbooks/hcp.yaml --ask-vault-pass
* Destroy the Hosted Control Plane and other resources created as part of installation

### Procedure
* Run the playbook [destroy_cluster_hcp.yaml](https://github.com/veera-damisetti/Ansible-OpenShift-Provisioning/blob/main/playbooks/destroy_cluster_hcp.yaml) to destroy all the resources created while installation
* Run the playbook [destroy_cluster_hcp.yaml](https://github.com/IBM/Ansible-OpenShift-Provisioning/blob/main/playbooks/destroy_cluster_hcp.yaml) to destroy all the resources created while installation
```
ansible-playbook playbooks/destroy_cluster_hcp.yaml --ask-vault-pass
```
Expand Down
2 changes: 1 addition & 1 deletion docs/set-variables-group-vars.md
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@
**hcp.data_plane.zvm.nodes.interface.options** | Configurations options | layer2=1
**hcp.data_plane.zvm.interface.ip** | IP addresses for to be used for zVM nodes | 192.168.10.1
**hcp.data_plane.zvm.nodes.dasd.disk_id** | Disk id for dasd disk to be used for zVM node | 4404
**hcp.data_plane.zvm.nodes.lun** | Disk details of fcp disk to be used for zVM node | 4404
**hcp.data_plane.zvm.nodes.lun** | Disk details of fcp disk to be used for zVM node | 0.0.4404

## ZVM ( Optional )
**Variable Name** | **Description** | **Example**
Expand Down
2 changes: 1 addition & 1 deletion inventories/default/group_vars/hcp.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ hcp:

# Hosted Control Plane Parameters
control_plane:
high_availabiliy: true
high_availability: true
clusters_namespace:
hosted_cluster_name:
basedomain:
Expand Down
2 changes: 1 addition & 1 deletion roles/create_hcp_InfraEnv/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
--base-domain={{ hcp.control_plane.basedomain }}
--api-server-address=api.{{ hcp.control_plane.hosted_cluster_name }}.{{ hcp.control_plane.basedomain }}
--ssh-key ~/.ssh/{{ hcp.ansible_key_name }}.pub
{% if hcp.control_plane.high_availabiliy == false %}
{% if hcp.control_plane.high_availability == false %}
--control-plane-availability-policy "SingleReplica"
{% endif %}
--infra-availability-policy "SingleReplica"
Expand Down
3 changes: 3 additions & 0 deletions roles/delete_resources_bastion_hcp/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
- name: Scale in Nodepool
command: oc -n {{ hcp.control_plane.clusters_namespace }} scale nodepool {{ hcp.control_plane.hosted_cluster_name }} --replicas 0

- name: Create Kubeconfig for Hosted Cluster
shell: hcp create kubeconfig --namespace {{ hcp.control_plane.clusters_namespace }} --name {{ hcp.control_plane.hosted_cluster_name }} > /root/ansible_workdir/hcp-kubeconfig

- block:
- name: Wait for Worker Nodes to Detach
k8s_info:
Expand Down
2 changes: 1 addition & 1 deletion roles/setup_for_agents_hcp/templates/parm-file.parm.j2
Original file line number Diff line number Diff line change
@@ -1 +1 @@
rd.neednet=1 ai.ip_cfg_override=1 console=ttysclp0 coreos.live.rootfs_url=http://{{ hcp.bastion_params.ip }}:8080/rootfs.img ip={{ hcp.data_plane.zvm.nodes[item].interface.ip }}::{{ hcp.data_plane.zvm.gateway }}:{{ hcp.data_plane.zvm.subnetmask }}{% if hcp.data_plane.zvm.network_mode | lower != 'roce' %}::{{ hcp.data_plane.zvm.nodes[item].interface.ifname }}:none{% endif %} nameserver={{ hcp.bastion_params.ip }} zfcp.allow_lun_scan=0 {% if hcp.data_plane.zvm.network_mode | lower != 'roce' %}rd.znet={{ hcp.data_plane.zvm.nodes[item].interface.nettype }},{{ hcp.data_plane.zvm.nodes[item].interface.subchannels }},{{ hcp.data_plane.zvm.nodes[item].interface.options }}{% endif %} {% if hcp.data_plane.zvm.disk_type | lower != 'fcp' %}rd.dasd=0.0.{{ hcp.data_plane.zvm.nodes[item].dasd.disk_id }}{% else %}rd.zfcp=0.0.{{ hcp.data_plane.zvm.nodes[item].lun[0].paths[0].fcp}},{{ hcp.data_plane.zvm.nodes[item].lun[0].paths[0].wwpn }},{{ hcp.data_plane.zvm.nodes[item].lun[0].id }} {% endif %} random.trust_cpu=on rd.luks.options=discard ignition.firstboot ignition.platform.id=metal console=tty1 console=ttyS1,115200n8 coreos.inst.persistent-kargs="console=tty1 console=ttyS1,115200n8"
rd.neednet=1 ai.ip_cfg_override=1 console=ttysclp0 coreos.live.rootfs_url=http://{{ hcp.bastion_params.ip }}:8080/rootfs.img ip={{ hcp.data_plane.zvm.nodes[item].interface.ip }}::{{ hcp.data_plane.zvm.gateway }}:{{ hcp.data_plane.zvm.subnetmask }}{% if hcp.data_plane.zvm.network_mode | lower != 'roce' %}::{{ hcp.data_plane.zvm.nodes[item].interface.ifname }}:none{% endif %} nameserver={{ hcp.bastion_params.ip }} zfcp.allow_lun_scan=0 {% if hcp.data_plane.zvm.network_mode | lower != 'roce' %}rd.znet={{ hcp.data_plane.zvm.nodes[item].interface.nettype }},{{ hcp.data_plane.zvm.nodes[item].interface.subchannels }},{{ hcp.data_plane.zvm.nodes[item].interface.options }}{% endif %} {% if hcp.data_plane.zvm.disk_type | lower != 'fcp' %}rd.dasd=0.0.{{ hcp.data_plane.zvm.nodes[item].dasd.disk_id }}{% else %}rd.zfcp={{ hcp.data_plane.zvm.nodes[item].lun[0].paths[0].fcp}},{{ hcp.data_plane.zvm.nodes[item].lun[0].paths[0].wwpn }},{{ hcp.data_plane.zvm.nodes[item].lun[0].id }} {% endif %} random.trust_cpu=on rd.luks.options=discard ignition.firstboot ignition.platform.id=metal console=tty1 console=ttyS1,115200n8 coreos.inst.persistent-kargs="console=tty1 console=ttyS1,115200n8"

0 comments on commit f1a0901

Please sign in to comment.