Skip to content

Commit

Permalink
Fix: Added os flag for virt-install command and changed hypershift bi…
Browse files Browse the repository at this point in the history
…nary name (#214)

- Added os flag for virt-install command as it is a required flag in
rhel9
- Changed hypershift binary name to hcp
- added new flags in cluster creation command

---------

Signed-off-by: Klaus Smolin <[email protected]>
Signed-off-by: root <[email protected]>
Co-authored-by: Klaus Smolin <[email protected]>
Co-authored-by: root <[email protected]>
  • Loading branch information
3 people authored Oct 30, 2023
1 parent 6db25d4 commit 3168120
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
1 change: 1 addition & 0 deletions roles/boot_agents_hypershift/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
virt-install \
--name "{{ hypershift.hcp.hosted_cluster_name }}-agent-{{ item }}" \
--osinfo detect=on,require=off \
--autostart \
--ram="{{ hypershift.agents_parms.ram }}" \
--cpu host \
Expand Down
18 changes: 10 additions & 8 deletions roles/create_hcp_InfraEnv_hypershift/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,39 +27,41 @@
set_fact:
ssh_key: "{{ ssh_output.stdout_lines[0] }}"

- name: Get pod name for hypershift-cli-download
- name: Get pod name for hcp-cli-download
kubernetes.core.k8s_info:
api_version: v1
kind: Pod
namespace: "{{ hypershift.asc.mce_namespace }}"
label_selectors:
- app= hypershift-cli-download
register: hypershift_pod_name
- app= hcp-cli-download
register: hcp_pod_name

- name: Get hypershift.tar.gz file from pod
- name: Get hcp.tar.gz file from pod
kubernetes.core.k8s_cp:
namespace: "{{ hypershift.asc.mce_namespace }}"
pod: "{{ hypershift_pod_name.resources[0].metadata.name }}"
pod: "{{ hcp_pod_name.resources[0].metadata.name }}"
remote_path: "/opt/app-root/src/linux/s390x/"
local_path: "/root/ansible_workdir"
state: from_pod

- name: Extract binary from hypershift.tar.gz
- name: Extract binary from hcp.tar.gz
unarchive:
src: /root/ansible_workdir/hypershift.tar.gz
src: /root/ansible_workdir/hcp.tar.gz
dest: /usr/local/bin/
remote_src: true

- name: Create a Hosted Cluster
command: >
hypershift create cluster agent
hcp create cluster agent
--name={{ hypershift.hcp.hosted_cluster_name }}
--pull-secret={{ hypershift.hcp.pull_secret_file }}
--agent-namespace={{ hosted_control_plane_namespace }}
--namespace={{ hypershift.hcp.clusters_namespace }}
--base-domain={{ hypershift.hcp.basedomain }}
--api-server-address=api.{{ hypershift.hcp.hosted_cluster_name }}.{{ hypershift.hcp.basedomain }}
--ssh-key ~/.ssh/{{ env.ansible_key_name }}.pub
--control-plane-availability-policy "SingleReplica"
--infra-availability-policy "SingleReplica"
--release-image=quay.io/openshift-release-dev/ocp-release:{{ hypershift.hcp.ocp_release }}
{% set release_image = lookup('env', 'HCP_RELEASE_IMAGE') %}
{% if release_image is defined and release_image != '' %}
Expand Down
2 changes: 1 addition & 1 deletion roles/delete_resources_bastion_hypershift/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
namespace: "{{ hypershift.hcp.clusters_namespace }}-{{ hypershift.hcp.hosted_cluster_name }}"

- name: Destroy Hosted Control Plane
command: hypershift destroy cluster agent --name {{ hypershift.hcp.hosted_cluster_name }} --namespace {{ hypershift.hcp.clusters_namespace }}
command: hcp destroy cluster agent --name {{ hypershift.hcp.hosted_cluster_name }} --namespace {{ hypershift.hcp.clusters_namespace }}

- name: Delete Clusters Namespace
k8s:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
delay: 10

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

- name: Wait for Worker Nodes to Join
k8s_info:
Expand Down

0 comments on commit 3168120

Please sign in to comment.