Skip to content

Add endpoint annotations to DWR CRD; support endpoint annotations in basic solver - #1297

Merged
AObuchow merged 8 commits into
devfile:mainfrom
AObuchow:endpoint-annotations-implementation
Aug 13, 2024
Merged

Add endpoint annotations to DWR CRD; support endpoint annotations in basic solver#1297
AObuchow merged 8 commits into
devfile:mainfrom
AObuchow:endpoint-annotations-implementation

Conversation

@AObuchow

Copy link
Copy Markdown
Collaborator

What does this PR do?

  • Extends the DevWorkspaceRouting CRD to have annotations for endpoints
  • Adds support for endpoint annotations in the basic DWR solver
  • Extends the DWR controller tests for endpoint annotations
  • Removes the mention of endpoint annotations from the unsupported Devfile API doc
  • Removes the webhook warning when using endpoint annotations

What issues does this PR fix or reference?

Fix#1292 & fix#1296

Is it tested? How?

Testing on both Minikube (Kubernetes) and Openshift is recommended, since ingresses are created on Kubernetes and routes are created on OpenShift.

  1. Install DWO on your cluster using the changes built from this PR. I've pushed a version of DWO with these changes to quay.io/aobuchow/devworkspace-controller:endpoint-annotations-implementation
  2. Apply the following devworkspace, which defines two endpoints, each with their own unique set of annotations:
kind: DevWorkspaceapiVersion: workspace.devfile.io/v1alpha2metadata:
name: plain-dw-endpoint-annotationsspec:
started: trueroutingClass: 'basic'template:
components:
- name: web-terminalcontainer:
image: quay.io/wto/web-terminal-tooling:nextmemoryRequest: 256MimemoryLimit: 512MimountSources: truecommand:
- "tail"
- "-f"
- "/dev/null"endpoints:
- name: endpoint-1targetPort: 8080protocol: httpannotation:
first-annotation: testsecond-annotation: test2
- name: endpoint-2targetPort: 8081protocol: httpannotation:
third-annotation: test3fourth-annotation: test4
  1. Once the workspace has started up, there should be 2 ingresses (or routes, depending on your k8s platform) created that are named after the endpoints. Ensure they each have the appropriate annotations in their metadata.annotations field.

For instance, on minikube, the created ingresses are called <workspace-id>-endpoint-1 & <workspace-id>-endpoint-2 respectively. Checking their annotations shows:

apiVersion: networking.k8s.io/v1kind: Ingressmetadata:
annotations:
controller.devfile.io/endpoint_name: endpoint-1first-annotation: testnginx.ingress.kubernetes.io/rewrite-target: /nginx.ingress.kubernetes.io/ssl-redirect: "false"second-annotation: test2name: workspacee3fe943ee29e4e60-endpoint-1
apiVersion: networking.k8s.io/v1kind: Ingressmetadata:
annotations:
controller.devfile.io/endpoint_name: endpoint-2fourth-annotation: test4nginx.ingress.kubernetes.io/rewrite-target: /nginx.ingress.kubernetes.io/ssl-redirect: "false"third-annotation: test3name: workspacee3fe943ee29e4e60-endpoint-2

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

fixdevfile#1292
Signed-off-by: Andrew Obuchowicz <aobuchow@redhat.com>
Signed-off-by: Andrew Obuchowicz <aobuchow@redhat.com>
Signed-off-by: Andrew Obuchowicz <aobuchow@redhat.com>
Fixdevfile#1296
Signed-off-by: Andrew Obuchowicz <aobuchow@redhat.com>
Signed-off-by: Andrew Obuchowicz <aobuchow@redhat.com>
Signed-off-by: Andrew Obuchowicz <aobuchow@redhat.com>
…orted
Signed-off-by: Andrew Obuchowicz <aobuchow@redhat.com>
…rted Devfile API docs
Signed-off-by: Andrew Obuchowicz <aobuchow@redhat.com>
@AObuchow
AObuchowforce-pushed the endpoint-annotations-implementation branch from 67a79fe to 209b3b3CompareAugust 6, 2024 18:40

@dkwon17dkwon17 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good, and I've tested on both minikube and CRC

@openshift-ci

Copy link
Copy Markdown

[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

Details 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

@AObuchow

Copy link
Copy Markdown
CollaboratorAuthor

Thanks for the review @dkwon17 :) Let's have this merged for DWO 0.31

Sign up for freeto 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.

Support devfile endpoint annotations in basic DevWorkspaceRouting solver Add Annotations to DevWorkspaceRouting Endpoints CRD

2 participants

@AObuchow@dkwon17