Skip to content

Readiness probes for endpoints #168

Closed
@sleshchenko

Description

@sleshchenko

Is your feature request related to a problem? Please describe.
Devfile component's is able to describe an endpoint that is supposed to expose some service.
A user may be interested in the endpoints state ( if services behind them) are available or not to:

  • do not open plugin's endpoint (Theia) when it's not available;
  • do not open container endpoints, after command which lauch server is run but before server is fully started;

Describe the solution you'd like
The plugin is able to declare a readiness probe for its endpoints. So, the implementation (odo, devworkspace operator) is able to evaluate endpoint info and expose it if needed.

components:
  - name: "mycontainer"
    container:
      image: "busybox"
      memoryLimit: "128M"
      mountSources: true
      endpoints:
        - name: term-websockets
          exposure: public
          protocol: ws
          attributes:
            type: terminal
          targetPort: 4000
          readinessProbe:
            path: /readiness
            periodSeconds: 3 # ?
            failureThreshold: 3 # ?
            # ?something else?

If it's the main devworkspace endpoint - workspace is not going to be marked as Running until that endpoint readiness probe passed.

It even may make sense to introduce liveness probe as well, if endpoint lifecycle bound to container lifecycle, user may want to have container automatically restarted when liveness is failed.

Describe alternatives you've considered
Probably one probe per container can be enough, if so - we can reuse K8s interface here:

  containers:
  - name: cache-server
    image: cache-server/latest
    readinessProbe:
      httpGet:
        path: /readiness
        port: 8888
      initialDelaySeconds: 300
      periodSeconds: 30

Additional context
N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/apiEnhancement or issue related to the api/devfile specification

    Type

    No type

    Projects

    Status

    Done ✅

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions