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

Adding FlinkDeployment CRD to supported third party resource customizations #5023

Merged
merged 4 commits into from
Jul 1, 2024

Conversation

mszacillo
Copy link
Contributor

What type of PR is this?
/kind feature

What this PR does / why we need it:

This PR adds a default resource customization for FlinkDeployments. Below is a summary of the supported default interpretations:

Supported

  1. InterpretHealth

    • We monitor the internal flink state that is added to the FlinkDeployment status via Flink Operator: spec.status.jobStatus.state. FlinkDeployments can enter errored states due to user related code issues, rather than due to bad cluster health or lack of cluster resources. As a result we want to differentiate from these cases so that Karmada only reschedules these apps when needed.
    • We chose to mark FlinkDeployments as Unhealthy only if the internal flink state is trapped in a non-terminal state - these states include:
      1. CREATED (job was created but not started)
      2. RECONCILING (state unknown, normally due to JM unable to communicate with operator)
    • More info on flink state transitions here: https://nightlies.apache.org/flink/flink-docs-master/docs/internals/job_scheduling/
  2. InterpretReplica

    • FlinkDeployments do not currently get subdivided amongst clusters. The reasoning here is that each Flink Cluster (JM + TMs) should be colocated to reduce request latency and boost performance.
    • Since Karmada interprets scheduling using replicas, we set the replica of the FlinkDeployment to 1, and Karmada will simply schedule the FlinkDeployment CRD to a member cluster, at which point the FlinkOperator will take over.
    • Replica resource requirements for CPU and Memory are set to equal (n * JM) + (k * TM), where n is the number of JobManagers and k is the number of Task Managers.
  3. InterpretStatus

    • We currently pull the full FlinkDeployment status from the resource.
  4. AggregateStatus

    • Since the replica count is 1, the aggregation isn't technically necessary. But in order for the status to show up on the FlinkDeployment resource in Karmada, this definition is needed. I've defined the interpreter to set the Aggregate status equal to the latest status pulled by Karmada.

Not Supported

  1. Retention

    • At the moment not necessary. We do not plan on changes being made to FlinkDeployment spec on the cluster that need to be retained by Karmada.
  2. ReplicaRevision

    • As mentioned, we currently don't plan on increasing the replica size for the FlinkDeployment. Even though JM and TM values can be scaled, the total number of FlinkDeployments will stay 1.
  3. InterpretDependency

    • There are no general dependencies needed for FlinkDeployments. Secrets or other configmaps can be handled on a case-by-case basis.

Which issue(s) this PR fixes:
Fixes #4953

Testing
Tested on cluster and confirmed default interpreters work with FlinkDeployment.

Does this PR introduce a user-facing change?:

Adding FlinkDeployment v1beta1 CRD to supported third party resource customizatons.

@karmada-bot karmada-bot added the kind/feature Categorizes issue or PR as related to a new feature. label Jun 5, 2024
@karmada-bot karmada-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jun 5, 2024
@RainbowMango
Copy link
Member

/assign @yike21 @chaunceyjiang

@yike21
Copy link
Member

yike21 commented Jun 6, 2024

@mszacillo Thanks for your contribution!

@chaunceyjiang
Copy link
Member

/assign

…ations

Signed-off-by: mszacillo <mszacillo@bloomberg.net>
Copy link
Member

@chaunceyjiang chaunceyjiang left a comment

Choose a reason for hiding this comment

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

Thanks~

/lgtm

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Jun 11, 2024
@mszacillo mszacillo changed the title Adding FlinkDeployment CRD to supported third party resource customizations (WIP) Adding FlinkDeployment CRD to supported third party resource customizations Jun 26, 2024
@karmada-bot karmada-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 26, 2024
…preter, adding getResourceQuantity function to kube library

Signed-off-by: mszacillo <mszacillo@bloomberg.net>
@karmada-bot karmada-bot removed the lgtm Indicates that a PR is ready to be merged. label Jun 26, 2024
@mszacillo mszacillo changed the title (WIP) Adding FlinkDeployment CRD to supported third party resource customizations Adding FlinkDeployment CRD to supported third party resource customizations Jun 26, 2024
@karmada-bot karmada-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 26, 2024
Signed-off-by: mszacillo <mszacillo@bloomberg.net>
@codecov-commenter
Copy link

codecov-commenter commented Jun 26, 2024

Codecov Report

Attention: Patch coverage is 0% with 15 lines in your changes missing coverage. Please review.

Project coverage is 28.20%. Comparing base (d05b921) to head (4c8e4de).
Report is 65 commits behind head on master.

Files Patch % Lines
...ceinterpreter/customized/declarative/luavm/kube.go 0.00% 15 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff             @@
##           master    #5023       +/-   ##
===========================================
- Coverage   53.30%   28.20%   -25.11%     
===========================================
  Files         253      632      +379     
  Lines       20560    43571    +23011     
===========================================
+ Hits        10960    12288     +1328     
- Misses       8874    30385    +21511     
- Partials      726      898      +172     
Flag Coverage Δ
unittests 28.20% <0.00%> (-25.11%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: mszacillo <mszacillo@bloomberg.net>
Copy link
Member

@RainbowMango RainbowMango left a comment

Choose a reason for hiding this comment

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

/lgtm

@bharathguvvala Do you have any further comments?

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Jun 29, 2024
@bharathguvvala
Copy link

/lgtm

@bharathguvvala Do you have any further comments?

LGTM for me as well.

@RainbowMango RainbowMango added this to the v1.11 milestone Jul 1, 2024
Copy link
Member

@RainbowMango RainbowMango left a comment

Choose a reason for hiding this comment

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

/approve

@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: RainbowMango

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

@karmada-bot karmada-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 1, 2024
@karmada-bot karmada-bot merged commit c0118ef into karmada-io:master Jul 1, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add default ResourceInterpreterCustomization for FlinkDeployments
7 participants