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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ type OperatorConfiguration struct {
// managed
Workspace *WorkspaceConfig `json:"workspace,omitempty"`
// Webhook defines configuration options for the DevWorkspace Webhook Server.
// 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.
Comment on lines +37 to +44
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.

Webhook *WebhookConfig `json:"webhook,omitempty"`
// EnableExperimentalFeatures turns on in-development features of the controller.
// This option should generally not be enabled, as any capabilites are subject
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions deploy/deployment/kubernetes/combined.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions deploy/deployment/openshift/combined.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions docs/additional-configuration.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -351,3 +351,25 @@ spec:
----

For documentation on Runtime Classes, see https://kubernetes.io/docs/concepts/containers/runtime-class/

## Configuring the Webhook deployment
The `devworkspace-webhook-server` deployment can be configured in the global DevWorkspaceOperatorConfig (DWOC). The configuration options include: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#replicas[replicas], https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/[pod tolerations] and https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector[nodeSelector].

These configuration options exist in the **global** DWOC's `config.webhook` field:
[source,yaml]
----
apiVersion: controller.devfile.io/v1alpha1
kind: DevWorkspaceOperatorConfig
metadata:
name: devworkspace-operator-config
namespace: $OPERATOR_INSTALL_NAMESPACE
config:
webhook:
nodeSelector: <string, string>
tolerations: <[]tolerations>
replicas: <int32>
----
**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 so that the replicaset can recreate it. The new pod will update the `devworkspace-webhook-server` deployment.
Loading