Skip to content

Updated: sap_hypervisor_node_preconfigure and sap_vm_provision #95

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

newkit
Copy link
Member

@newkit newkit commented Apr 30, 2025

sap_hypervisor_node_preconfigure

  • added wait for MCP update
  • removed authentication from playbook
  • enable DownwardMetrics Feature Gate

sap_vm_provision

  • removed authentication from playbook
  • removed VM authentications password and inline key, only support ssh key files

sap_hypervisor_node_preconfigure
  - added wait for MCP update
  - removed authentication from playbook
  - enable DownwardMetrics Feature Gate

sap_vm_provision
  - removed authentication from playbook
  - removed VM authentications password and inline key, only support ssh key files
@newkit newkit requested review from rhmk and berndfinger April 30, 2025 11:21
# Namespace where the VM should be created in
sap_vm_provision_kubevirt_vm_target_namespace: sap
sap_vm_provision_kubevirt_vm_target_namespace: openshift-sriov-network-operator
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@newkit sap_hypervisor_node_preconfigure is currently supporting only RH, but sap_vm_provision was not intended to be tied to one OS, as visible in

- KubeVirt Virtual Machine/s (e.g. SUSE Rancher with Harvester HCI) `[Experimental]`

Please ensure that default name you pre-set is not specific, like it was before with generic sap.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @marcelmamula!

You are right, the preset should not be OpenShift specific, I will revert that.

ansible.builtin.set_fact:
sap_hypervisor_node_preconfigure_ocp_kubeconfig_path: "{{ lookup('env', 'K8S_AUTH_KUBECONFIG') | default(None) }}"
sap_hypervisor_node_preconfigure_kubeconfig: "{{ lookup('env', 'K8S_AUTH_KUBECONFIG') | lookup('env', 'KUBECONFIG') | default(None) }}"
Copy link
Contributor

@geetikakay geetikakay May 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"{{ lookup('env', 'K8S_AUTH_KUBECONFIG') | lookup('env', 'KUBECONFIG') | default(None) }}"
-- here we are sending output of lookup('env', 'K8S_AUTH_KUBECONFIG') to lookup('env', 'KUBECONFIG')
Also is it better to use lookup('env', 'K8S_AUTH_KUBECONFIG') or lookup('env', 'KUBECONFIG') -?
Ideally we want flow to be

  1. look for K8S_AUTH_KUBECONFIG, if found stop.
  2. if not found look for KUBECONFIG, if found stop
  3. if none is there, do we want to fail ? in current case it is silently setting to None which has no use? Add a fail in next step if None?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @geetikakay, thanks for sharing your thoughts on this.

What should be happening is:

  1. sap_hypervisor_node_preconfigure_kubeconfig is set --> use this and continue
  2. Else look for K8S_AUTH_KUBECONFIG and if set --> use this and continue
  3. Else look for KUBECONFIG and if set --> use this and continue
  4. Fail with Error message that kubeconfig is not set.

I'll add a task which will handle 4.) which is currently missing.

content: "{{ __sap_vm_provision_kubevirt_vm_register_kubeconfig_data | to_nice_yaml }}"
dest: "{{ __sap_vm_provision_kubevirt_vm_register_kubeconfig }}"
mode: "0600"
sap_vm_provision_kubevirt_vm_kubeconfig: "{{ lookup('env', 'K8S_AUTH_KUBECONFIG') | default(lookup('env', 'KUBECONFIG'), true) }}"
Copy link
Contributor

@geetikakay geetikakay May 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto Should we fail if both are missing? That way Jenkins CI failures would be easier to narrow down.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

# Namespace where the VM should be created in
sap_vm_provision_kubevirt_vm_target_namespace: sap
sap_vm_provision_kubevirt_vm_target_namespace: openshift-sriov-network-operator
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should avoid configuring vm in operator namespaces .

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, but SRIOV has not been working outside of that namespace. But we can set the default to sap again and fix it in documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants