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

[WIP] Change status.conditions to the Kubernetes format & adjust the reconciliation logic #563

Closed
wants to merge 15 commits into from

Conversation

tpiperatgod
Copy link
Contributor

(If this PR fixes a github issue, please add Fixes #<xyz>.)

Fixes #

(or if this PR is one task of a github issue, please add Master Issue: #<xyz> to link to the master issue.)

Master Issue: #552

Motivation

Explain here the context, and why you're making that change. What is the problem you're trying to solve.

Modifications

Describe the modifications you've done.

Verifying this change

  • Make sure that the change passes the CI checks.

(Please pick either of the following options)

This change is a trivial rework / code cleanup without any test coverage.

(or)

This change is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(example:)

  • Added integration tests for end-to-end deployment with large payloads (10MB)
  • Extended integration test for recovery after broker failure

Documentation

Check the box below.

Need to update docs?

  • doc-required

    (If you need help on updating docs, create a doc issue)

  • no-need-doc

    (Please explain why)

  • doc

    (If this PR contains doc changes)

Signed-off-by: laminar <tpiperatgod@gmail.com>
Signed-off-by: laminar <tpiperatgod@gmail.com>
Signed-off-by: laminar <tpiperatgod@gmail.com>
…ermine if the target component needs to be updated during a new reconciliation

Signed-off-by: laminar <tpiperatgod@gmail.com>
Signed-off-by: laminar <tpiperatgod@gmail.com>
Signed-off-by: laminar <tpiperatgod@gmail.com>
Signed-off-by: laminar <tpiperatgod@gmail.com>
Signed-off-by: laminar <tpiperatgod@gmail.com>
Signed-off-by: laminar <tpiperatgod@gmail.com>
Signed-off-by: laminar <tpiperatgod@gmail.com>
@tpiperatgod tpiperatgod requested review from nlu90, freeznet and a team as code owners January 30, 2023 09:55
@github-actions github-actions bot added the no-need-doc This pr does not need any document label Jan 30, 2023
@tpiperatgod
Copy link
Contributor Author

This PR contains the following changes.

  • Change status.Conditions to Kubernetes format
  • Store the hash of the desired component specification in status
  • Use the hash of the desired component specification as a condition for determining whether the target component needs to be updated
  • Adjusted some issues with deprecated libraries, chart documentation

Signed-off-by: laminar <tpiperatgod@gmail.com>
@tpiperatgod
Copy link
Contributor Author

the status of the mesh looks as follows:

status:
  conditions:
  - lastTransitionTime: "2023-01-30T08:23:38Z"
    message: ""
    observedGeneration: 2
    reason: FunctionIsReady
    status: "True"
    type: FunctionReady
  - lastTransitionTime: "2023-01-30T10:21:20Z"
    message: ""
    observedGeneration: 2
    reason: SourceIsReady
    status: "True"
    type: SourceReady
  - lastTransitionTime: "2023-01-30T08:23:39Z"
    message: ""
    observedGeneration: 2
    reason: SinkIsReady
    status: "True"
    type: SinkReady
  - lastTransitionTime: "2023-01-30T10:21:20Z"
    message: ""
    observedGeneration: 2
    reason: MeshIsReady
    status: "True"
    type: Ready
  - lastTransitionTime: "2023-01-30T08:13:55Z"
    message: 'error creating or updating source: Operation cannot be fulfilled on
      sources.compute.functionmesh.io "functionmesh-sample-source-two": the object
      has been modified; please apply your changes to the latest version and try again'
    reason: ErrorCreatingSource
    status: "True"
    type: Error
  functionConditions:
    function-two:
      hash: 0f7296b0d0d8bb9c6383da89b9637e8534f9c44ada5d3d0aad8c46e457ddfab1
      status: Ready
  sinkConditions:
    sink-two:
      hash: 4f8f50a6c3d65cb417be505435ab33a6e6e475239260dfa86bbd0129f0d0d203
      status: Ready
  sourceConditions:
    source-two:
      hash: 43935768e90239780541ac38521b05c7c64ab064dda16589f228bf4248ecdfc3
      status: Ready

and the status of the function/sink/source looks as follows:

status:
  componentHash:
    HorizontalPodAutoscaler: b893bb82b2720f90298d82e2c5ef0a8a70cee2a298cdb5234e199931fa157f94
    Service: 1ed47cf0d11e4c696b24626d242f3fcd6f068aec58eb39007bed90894a41337e
    StatefulSet: 0fbe9c7c7501e68ce0c803e451b852f794f33f1a54a1cfbfe71be8b44be3e24c
  conditions:
  - lastTransitionTime: "2023-01-30T08:23:38Z"
    message: ""
    observedGeneration: 1
    reason: StatefulSetIsReady
    status: "True"
    type: StatefulSetReady
  - lastTransitionTime: "2023-01-30T08:23:33Z"
    message: ""
    observedGeneration: 1
    reason: ServiceIsReady
    status: "True"
    type: ServiceReady
  - lastTransitionTime: "2023-01-30T08:23:33Z"
    message: ""
    observedGeneration: 1
    reason: HPAIsReady
    status: "True"
    type: HPAReady
  - lastTransitionTime: "2023-01-30T08:23:38Z"
    message: ""
    observedGeneration: 1
    reason: FunctionIsReady
    status: "True"
    type: Ready
  replicas: 1
  selector: app=function-mesh,app.kubernetes.io/instance=functionmesh-sample-function-two-function,app.kubernetes.io/name=functionmesh-sample-function-two-function,component=function,compute.functionmesh.io/app=function-mesh,compute.functionmesh.io/component=function,compute.functionmesh.io/name=functionmesh-sample-function-two,compute.functionmesh.io/namespace=default,name=functionmesh-sample-function-two,namespace=default

Signed-off-by: laminar <tpiperatgod@gmail.com>
@tpiperatgod tpiperatgod changed the title Change status.conditions to the Kubernetes format & adjust the reconciliation logic [WIP] Change status.conditions to the Kubernetes format & adjust the reconciliation logic Feb 3, 2023
@nlu90
Copy link
Contributor

nlu90 commented Feb 6, 2023

as we discussed in the meeting:

  1. this could cause breaking changes. so might need to introduce a v1alpha2 CRD for it.
  2. the componentHash section is not needed.

@tpiperatgod
Copy link
Contributor Author

as we discussed in the meeting:

  1. this could cause breaking changes. so might need to introduce a v1alpha2 CRD for it.
  2. the componentHash section is not needed.

Sure.

In addition, I think the observedGeneration in the condition of type Ready can indicate the number of observed generations of the current CRD, so we don't need to add the observedGeneration to status. For higher-level resources, it is possible to get the information in the Ready type Condition by using meta.FindCondition().

Of course we could also add status.observedGeneration, which would make it easier to get the number of observed generations of the CRD, but it would be somewhat redundant.

Any suggestions?

Signed-off-by: laminar <tpiperatgod@gmail.com>
@tpiperatgod
Copy link
Contributor Author

tpiperatgod commented Feb 7, 2023

introduce v1alpha2 api:

  • add v1alpha2 api
  • migrate the api used by the controller from v1alpha1 to v1alpha2
  • support v1alpha1 to v1alpha2 conversion (v1alpha2 is the hub and the storage version)
  • update test cases
  • update samples
  • update chart
  • update docs

Signed-off-by: laminar <tpiperatgod@gmail.com>
Signed-off-by: laminar <tpiperatgod@gmail.com>
@nlu90
Copy link
Contributor

nlu90 commented Sep 18, 2023

inactivity

@nlu90 nlu90 closed this Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-need-doc This pr does not need any document
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants