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

Improve documentation for Webhook deployment configuration #1312

Merged
merged 3 commits into from
Sep 11, 2024

Conversation

AObuchow
Copy link
Collaborator

@AObuchow AObuchow commented Sep 6, 2024

What does this PR do?

  • Add documentation to the DWOC CRD about requirements for configuring the webhook (must use the global DWOC and restart the devworkspace-controller-manager pod for changes to take effect)
  • Add documentation about configuration the webhook in the Additional Docs

What issues does this PR fix or reference?

Fix #1289

Is it tested? How?

  1. Install DWO with the changes from this PR and login to your cluster with oc
  2. Do a kubectl explain dwoc.config.webhook. The DESCRIPTION field should show the new mentions of needing to use the global DWOC and restarting the devworkspace-controller-manager pod
  3. Check the additional docs (here's a link to them on my fork to easily view the changes)

PR Checklist

  • E2E tests pass (when PR is ready, comment /test v8-devworkspace-operator-e2e, v8-che-happy-path to trigger)
    • v8-devworkspace-operator-e2e: DevWorkspace e2e test
    • v8-che-happy-path: Happy path for verification integration with Che

@AObuchow
Copy link
Collaborator Author

AObuchow commented Sep 6, 2024

Oops my branch was branched off of #1310 causing CI to fail. Will fix this quickly

@AObuchow AObuchow force-pushed the webhook-config-docs branch 2 times, most recently from 488c32a to 1893b82 Compare September 6, 2024 16:20
Copy link
Collaborator

@dkwon17 dkwon17 left a comment

Choose a reason for hiding this comment

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

Looks good, I just have some suggestions

Comment on lines 372 to 375
**Note:** In order for the `devworkspace-webhook-server` configuration options to take effect:
- You must place them in the https://github.com/devfile/devworkspace-operator?tab=readme-ov-file#global-configuration-for-the-devworkspace-operator[global DWOC], which has the name `devworkspace-operator-config` and exists in the namespace where the DevWorkspaceOperator is installed. If it does not already exist on the cluster, you must create it.
- You'll need to terminate the `devworkspace-controller-manager` pod and restart it so that the `devworkspace-webhook-server` deployment can be adjusted accordingly.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
**Note:** In order for the `devworkspace-webhook-server` configuration options to take effect:
- You must place them in the https://github.com/devfile/devworkspace-operator?tab=readme-ov-file#global-configuration-for-the-devworkspace-operator[global DWOC], which has the name `devworkspace-operator-config` and exists in the namespace where the DevWorkspaceOperator is installed. If it does not already exist on the cluster, you must create it.
- You'll need to terminate the `devworkspace-controller-manager` pod and restart it so that the `devworkspace-webhook-server` deployment can be adjusted accordingly.
**Note:** For the `devworkspace-webhook-server` configuration options to take effect:
- You must place them in the https://github.com/devfile/devworkspace-operator?tab=readme-ov-file#global-configuration-for-the-devworkspace-operator[global DWOC], which has the name `devworkspace-operator-config` and exists in the namespace where the DevWorkspace Operator is installed. If it does not already exist on the cluster, you must create it.
- You'll need to delete the current `devworkspace-controller-manager` pod so that the replicaset can recreate a new pod. The new pod will update the `devworkspace-webhook-server` deployment.

Here is my suggestion. We also need to have the newline in between the Note: and first bullet point, otherwise the bullet points are not rendered properly:
image

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks so much for the review and for catching this David, I'll update the PR accordingly!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed :) Should be good now 🙏

Comment on lines +37 to +44
// Note: In order for changes made to the webhook configuration to take effect:
//
// - The changes must be made in the global DevWorkspaceOperatorConfig, which has the
// name 'devworkspace-operator-config' and exists in the same namespace where the
// DevWorkspaceOperator is deployed.
//
// - The devworkspace-controller-manager pod must be terminated and recreated for the
// DevWorkspace Webhook Server deployment to be updated.
Copy link
Collaborator

@dkwon17 dkwon17 Sep 6, 2024

Choose a reason for hiding this comment

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

Suggested change
// Note: In order for changes made to the webhook configuration to take effect:
//
// - The changes must be made in the global DevWorkspaceOperatorConfig, which has the
// name 'devworkspace-operator-config' and exists in the same namespace where the
// DevWorkspaceOperator is deployed.
//
// - The devworkspace-controller-manager pod must be terminated and recreated for the
// DevWorkspace Webhook Server deployment to be updated.
// For the changes made to the webhook configuration to take effect:
//
// - The changes must be made in the global DevWorkspaceOperatorConfig, which has the
// name 'devworkspace-operator-config' and exists in the same namespace where the
// DevWorkspace Operator is deployed. This DevWorkspaceOperatorConfig can be created
// manually if it does not exist.
//
// - The devworkspace-controller-manager pod must be manually terminated. This allows the
// replicaset to recreate the pod which will update the DevWorkspace Webhook Server deployment.

**Note:** In order for the `devworkspace-webhook-server` configuration options to take effect:

- You must place them in the https://github.com/devfile/devworkspace-operator?tab=readme-ov-file#global-configuration-for-the-devworkspace-operator[global DWOC], which has the name `devworkspace-operator-config` and exists in the namespace where the DevWorkspaceOperator is installed. If it does not already exist on the cluster, you must create it.
- You'll need to terminate the `devworkspace-controller-manager` pod and restart it so that the `devworkspace-webhook-server` deployment can be adjusted accordingly.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we update to:

Suggested change
- You'll need to terminate the `devworkspace-controller-manager` pod and restart it so that the `devworkspace-webhook-server` deployment can be adjusted accordingly.
- You'll need to terminate the `devworkspace-controller-manager` pod so that the replicaset can recreate it. The new pod will update the `devworkspace-webhook-server` deployment.

it's to make it clear that the user doesn't have to restart anything, all the user has to do is terminate the pod and wait until it's recreated

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good call, done :)

@dkwon17
Copy link
Collaborator

dkwon17 commented Sep 9, 2024

Thank you @AObuchow , I will merge soon

Copy link

openshift-ci bot commented Sep 9, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: AObuchow, dkwon17

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@dkwon17
Copy link
Collaborator

dkwon17 commented Sep 10, 2024

I cannot merge because of a failing check:
image

I am checking

@AObuchow
Copy link
Collaborator Author

CI is failing due to #1314


These configuration options exist in the **global** DWOC's `config.webhook` field:

```YAML
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is using the wrong code block formatting style. It should be:

[source,yaml]
----
(content)
----

Will fix this.

Copy link

openshift-ci bot commented Sep 10, 2024

New changes are detected. LGTM label has been removed.

Mention requirements for DWOC webhook configuration changes to take effect.

Fix devfile#1289

Signed-off-by: Andrew Obuchowicz <aobuchow@redhat.com>
Signed-off-by: Andrew Obuchowicz <aobuchow@redhat.com>
Signed-off-by: Andrew Obuchowicz <aobuchow@redhat.com>
@AObuchow AObuchow merged commit a7c016c into devfile:main Sep 11, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve documentation for Webhook deployment configuration
2 participants