kyma-project / kyma-environment-broker

Kyma Environment Broker
Apache License 2.0
0 stars 22 forks source link

[betaEnabled] Support Beta flag in KEB and Kyma CR #60

Closed PK85 closed 5 months ago

PK85 commented 1 year ago

Description

The KEB needs to store “Used for production” and “Enabled beta features” information during Kyma provisioning (Only provisioning).

Reason

This feature is of high importance as it directly impacts the ability of customers to utilize beta modules effectively within Kyma. Being able to discern user preferences for beta features during Subaccount creation will enable better alignment with customer needs and preferences.

AC

Info

PK85 commented 11 months ago

We encountered that "Enable beta features" could be selected to "true" after subaccount creation. This changes the way we can implement this feature.

In that case we do not need to call CIS APIs during provisioning. We can check events let say every 1-2 hours and check betaEnabled from event itself.

To get information about betaEnabled for older Kyma instances the only way is to call Account Service APIs and check subaccount. But right now we receive 403.

Comments:

jaroslaw-pieszka commented 8 months ago

Having subaccount with Cloud Management Service (cis) and system-basic plan you can get Subaccount_Update event when betaEnabled or usedForProduction has changed. However in the event payload there is not information about usedForProduction even if change of this value triggered appropriate event.

betaEnabled and usedForProduction checked in cockpit - event generated:

"events": [
        {
                "id": 25290915,
                "actionTime": 1706600916546,
                "creationTime": 1706600917056,
                "details": {
                        "description": "Subaccount updated.",
                        "guid": "e6c2c9d4-49d9-4da7-92be-00e24fe02f51",
                        "technicalName": "e6c2c9d4-49d9-4da7-92be-00e24fe02f51",
                        "parentGuid": "156d610b-eda1-44ab-a093-4977fca4e43e",
                        "displayName": "jp-test",
                        "subaccountDescription": null,
                        "region": "eu12",
                        "subdomain": "jp-test-pn9upk1f",
                        "betaEnabled": true
                },
                "globalAccountGUID": "156d610b-eda1-44ab-a093-4977fca4e43e",
                "entityId": "e6c2c9d4-49d9-4da7-92be-00e24fe02f51",
                "entityType": "Subaccount",
                "eventOrigin": "accounts-service",
                "eventType": "Subaccount_Update"
        },

usedForProduction unchecked in cockpit - event generated:

"events": [
        {
                "id": 25290926,
                "actionTime": 1706601042984,
                "creationTime": 1706601044047,
                "details": {
                        "description": "Subaccount updated.",
                        "guid": "e6c2c9d4-49d9-4da7-92be-00e24fe02f51",
                        "technicalName": "e6c2c9d4-49d9-4da7-92be-00e24fe02f51",
                        "parentGuid": "156d610b-eda1-44ab-a093-4977fca4e43e",
                        "displayName": "jp-test",
                        "subaccountDescription": null,
                        "region": "eu12",
                        "subdomain": "jp-test-pn9upk1f",
                        "betaEnabled": true
                },
                "globalAccountGUID": "156d610b-eda1-44ab-a093-4977fca4e43e",
                "entityId": "e6c2c9d4-49d9-4da7-92be-00e24fe02f51",
                "entityType": "Subaccount",
                "eventOrigin": "accounts-service",
                "eventType": "Subaccount_Update"
},
jaroslaw-pieszka commented 8 months ago

Meeting minutes:

  1. Once a day we do a full sync i.e. for all subaccounts we fetch current state of betaEnabled, usedForProduction using account (technical) endpoint
  2. During remaining time we do incremental sync i.e. we fetch events (Subaccount_Update, Subaccount_Create) and check if above-mentioned values were changed of set in the case of create event. We do not get value for usedForProduction in event details - to be clarified with CIS team if this is to be changed
  3. We initiate incremental sync every 15 minutes (for example) with overlapping window (20 minutes) to minimize risk of missing any relevant event.
  4. Times, intervals should be configurable,
  5. Persist (in the storage) the information about desired and current state of kyma resources in regard to these two values [edit: this is disputable, possibly we can recreate the information after every restart and then for given period),
  6. Persist state of sliding event window,
  7. Metrics are to be introduced,
  8. Handle rate limiting (accounts and events endpoints),
  9. Handle errors while updating kyma resources (retry later on),
  10. Check with jellyfish the exact labels to be used, make sure no such labels are there - we should start from the scratch,
  11. It would be nice to have single credentials for events and accounts (at the time being we have to sets),
jaroslaw-pieszka commented 8 months ago

Ad 5. Persistence is not necessary, if the apps runs permanently in memory, we can keep state there and rebuild it after restart by full sync with CIS, KCP and database.

Ad 6. Not needed. Just after app start we do a full sync and later on periodic event scan with the sliding window.

Ad 7. Not in MVC0.

jaroslaw-pieszka commented 8 months ago

We requested on Jan, 31st adding "usedForProduction" to Event details. Answer from Serhan:

This will be handled in T02 (staring next week) in CIS dev team: Add usedForProduction flag value to the > Subaccount_Create/Update/Delete event payloads So you can expect it with the release of T2402

jaroslaw-pieszka commented 8 months ago
jaroslaw-pieszka commented 8 months ago

Meeting minutes:

szwedm commented 7 months ago

CIS fake server for tests: https://github.com/kyma-project/kyma-environment-broker/pull/589

jaroslaw-pieszka commented 6 months ago

PR for review: https://github.com/kyma-project/kyma-environment-broker/pull/460

jaroslaw-pieszka commented 5 months ago

App deployed on dev. Deployment to stage and prod and monitoring setup will be done in scope of separate issues.