Skip to content
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

MTV-1590 Improved hooks description #586

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

Conversation

@RichardHoch RichardHoch marked this pull request as draft November 17, 2024 16:15
@RichardHoch RichardHoch force-pushed the improved_hook_description branch 2 times, most recently from c0e8df2 to 931c4a2 Compare December 18, 2024 09:51
@RichardHoch RichardHoch changed the title WIP New hooks description MTV-1590 Improved hooks description Dec 18, 2024
@RichardHoch RichardHoch marked this pull request as ready for review December 18, 2024 17:29
+
[NOTE]
====
You can also use a `here` document to encode a playbook:
Copy link
Collaborator

Choose a reason for hiding this comment

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

could you explain a bit more, as i got a bit confused?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@anarnold97 I'm actually wondering if this is still relevant -- it was in the upstream document that I refashioned into the current downstream documentation. I'll make a note to ask Martin and Matthew about it when I ask for their review.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I did change the wording.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@mnecas Is this note about a here document still relevant?

@RichardHoch RichardHoch force-pushed the improved_hook_description branch 2 times, most recently from aed7a60 to 76326e0 Compare December 19, 2024 16:16
@RichardHoch RichardHoch force-pushed the improved_hook_description branch from 76326e0 to 01b65ab Compare December 19, 2024 16:24
@RichardHoch RichardHoch requested a review from fabiand December 19, 2024 16:26
@RichardHoch RichardHoch requested a review from mnecas December 19, 2024 16:26
@RichardHoch
Copy link
Collaborator Author

@mnecas @fabiand Please review this PR. Thanks.

@matthewsecaur
Copy link

Hi, @RichardHoch ! I made some comments to you directly via Slack. Happy to continue the conversation here, if needed.

[id="hook-execution_{context}"]
== Hook execution
An Ansible playbook that is provided as part of a migration hook is mounted into the hook container as a `ConfigMap`. The hook container is run as a job on the desired cluster, using the default `ServiceAccount` in the `konveyor-forklift` namespace.

Copy link
Collaborator Author

@RichardHoch RichardHoch Dec 22, 2024

Choose a reason for hiding this comment

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

@mnecas @matthewsecaur comments: The text says: "The hook container is run as a job on the desired cluster, using the default ServiceAccount in the konveyor-forklift namespace"
Issue: MTV is not installed in the konveyor-forklift namespace. It is installed in openshift-mtv. Also, the default serviceAccount is forklift-controller, though it might not be necessary to mention that.

. For a pre-migration hook, perform the following steps:

.. In the *Pre migration hook* section, toggle the *Enable hook* switch to *Enable pre migration hook*.
.. Enter the *Hook runner image*. The default image is `quay.io/konveyor/hook-runner` and this value must be used if you are adding an Ansible playbook.
Copy link
Collaborator Author

@RichardHoch RichardHoch Dec 22, 2024

Choose a reason for hiding this comment

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

@mnecas @matthewsecaur comments:
The text says: "Enter the Hook runner image. The default image is quay.io/konveyor/hook-runner and this value must be used if you are adding an Ansible playbook."
Issue: I don't understand what we mean when we say "this value must be used if you are adding and Ansible playbook". Customers are free to use their own image, are they not? I suppose their custom image could be based on the default hook-runner image, by why do we say is MUST be used? Here is an example of a custom hook-runner image that can be used with a playbook: https://github.com/alezzandro/aap25-ee-vmware-rhel8/tree/main/hook-runner

$ oc -n openshift-mtv patch hook <name_of_hook> \
-p '{"spec":{"serviceAccount":"<service_account>"}}' --type merge
----

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@mnecas @matthewsecaur notes:
Issue: The command is correct, but we don't go into any detail about how to create the serviceAccount. It is mentioned in the Prerequisites, so I suppose that is sufficient, but should there be some additional text? Perhaps instead of "associate each hook with your Red Hat OpenShift service account", we could say "associate each hook with the Red Hat OpenShift service account that was created for running hooks" or similar?

EOF
----
====

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@mnecas Do you have a better way to explain what a 'here" document is? Is this note actually needed/useful for our users?

where:
+
`playbook` refers to an optional Base64-encoded Ansible Playbook. If you specify a playbook, the `image` must be `hook-runner`.
+
Copy link
Collaborator Author

@RichardHoch RichardHoch Dec 22, 2024

Choose a reason for hiding this comment

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

@mnecas @matthewsecaur comments:
If we're going to create a Hook CR here, then we may as well have the user put the serviceAccount in now, instead of creating the hook and then adding the SA later. In fact, I don't see any mention of the serviceAccount in the CLI-based instructions. This is required for Console-based and CLI-based hooks.
The example command for decoding a playbook from a hook uses the "konveyor-forklift" namespace, but MTV is installed in "openshift-mtv"
Same as earlier, the text says "If you specify a playbook, the image must be hook-runner", but that isn't necessarily true. You can use a custom image and a playbook.

@RichardHoch
Copy link
Collaborator Author

@mnecas Matthew added some comments in Slack and I copy-pasted them here.

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.

4 participants