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

feat: [M3-6969] - Add DC-specific pricing to Kubernetes HA #9568

Merged
merged 15 commits into from
Aug 22, 2023

Conversation

mjac0bs
Copy link
Contributor

@mjac0bs mjac0bs commented Aug 18, 2023

Description 📝

High Availability (HA) pricing ($60.00/month per cluster for all DCs) is controlled through an environment variable in CI. This PR moves base pricing to a constant in the codebase and allows us to dynamically calculate HA pricing for new DCs.

Major Changes 🔄

  • With the feature flag on:
    • On the Kubernetes Create page, summary/pricing data and the Create Cluster button do not appear in the Checkout Summary bar until a Region selection has been made. This will avoid displaying inaccurate pricing in the checkout bar, since a user could enable HA before choosing a Region.
    • Prices on enable HA Control Plane radio button on Kubernetes Create page reflect DC-specific HA prices.
      • When no Region is selected, no pricing information is shown.
    • Prices on enable Update to HA modal on Kubernetes Details page reflect DC-specific HA prices.
    • Prices on the Kube Summary section of the Kubernetes Details page reflect DC-specific HA prices.
  • HA pricing relies on the pricing multiplier constant (LKE_HA_PRICE) rather than the REACT_APP_LKE_HIGH_AVAILABILITY_PRICE env var.
  • Unit tests are updated and the HA selection that had been previously commented out in e2e tests was restored with the use of a constant for HA.
  • Updates Sao Paulo's price increase percentage.

Preview 📷

Location Preview
Create Cluster
Screen.Recording.2023-08-20.at.3.31.12.PM.mov
Create Cluster - No Region Screenshot 2023-08-20 at 3 30 43 PM
Kube Cluster Specs Screenshot 2023-08-20 at 3 32 16 PM
Kube Upgrade Cluster Dialog Screenshot 2023-08-20 at 3 37 20 PM

How to test 🧪

  1. How to setup test environment?
  • Check out code locally and enable the DC-Specific Pricing feature flag in the dev settings.
  1. How to verify changes?
  • Verify the e2es and unit tests pass.
  • Test the following flows with both the flag on and off. Test Sao Paulo, Jakarta and any region without a price increase.
  • When DC-specific pricing flag is off, the flows should match production. When on, the flows should show the major changes described above and visible in the preview section.

Flows:

  • http://localhost:3000/kubernetes/create
    • Without selecting a Region, toggle between HA selections. Confirm no pricing is displayed in the Checkout Summary.
    • Selecting a Region, confirm the pricing is displayed in the Checkout Summary. Test all DC-specific pricing regions.
    • Select a Plan and confirm the total is correct. (note this total)
    • Do not enable HA. (select 'No')
    • Create Cluster.
  • http://localhost:3000/kubernetes/clusters/{id}/summary
    • Confirm the total price in the Kube Summary (top of the page) is accurate, matching the total from the Create page.
    • Click the Upgrade to HA button and confirm the copy and the HA price on the dialog is correct.
    • Submit the form to upgrade to HA and confirm the total price in the Kube Summary has been updated to reflect the addition of HA.
  1. How to run Unit or E2E tests?
yarn test HAControlPlane KubeCheckoutBar kubeUtils
yarn cy:run -s "cypress/e2e/core/kubernetes/smoke-lke-create.spec.ts cypress/e2e/core/kubernetes/lke-create.spec.ts"

@mjac0bs mjac0bs marked this pull request as ready for review August 21, 2023 14:05
@mjac0bs mjac0bs added the UX/UI Changes for UI/UX to review label Aug 21, 2023
Copy link
Member

@bnussman-akamai bnussman-akamai left a comment

Choose a reason for hiding this comment

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

Nice to see the env var go away 👋🏼

@bnussman-akamai bnussman-akamai added Add'tl Approval Needed Waiting on another approval! and removed Ready for Review labels Aug 21, 2023
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is not directly relevant to this PR, but it is a quick change to finalize this.

Copy link
Contributor

@abailly-akamai abailly-akamai left a comment

Choose a reason for hiding this comment

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

Code looks good to me!

However I wanted to point to a difference in the UX that bothers me:

Before, adding a cluster in the create flow would

  1. disable the add button and reset the field to 0
  2. add the subtotal in the panel

Now, in the new flow, we only get item 1 and it's a pretty odd experience because one would expect something else to happen> i think it is confusing to the user. I know we still have the "Select a Region and Plan to create a cluster." sentence in there but it's super easy to miss and wonder if something is broken.

IMO it would make more sense to still add the items to the sidebar but not display the prices and the sentence for each item instead, OR at least adding a warning icon or something next to the empty sidebar sentence to make sure the user does not miss it.

Thoughts?

@mjac0bs
Copy link
Contributor Author

mjac0bs commented Aug 21, 2023

it would make more sense to still add the items to the sidebar but not display the prices and the sentence for each item instead, OR at least adding a warning icon or something next to the empty sidebar sentence to make sure the user does not miss it.

@abailly-akamai - Yeah, this is fair. I've reached out to Matthew and Kendall for some feedback on this/overall UI changes when Region is not selected and are awaiting their input. I think either approach you suggested would work and improve the UX from what it is now.

Here's my current thought:

Screen.Recording.2023-08-21.at.1.48.40.PM.mov

@mjac0bs
Copy link
Contributor Author

mjac0bs commented Aug 21, 2023

@abailly-akamai This is ready for re-review with a UX sign off on these changes from Kendall.

Changes:

In the checkout summary, without a Region selection, the total price is replaced with a message indicate Region and Node Pool selections are needed. Until Region is selected, users can still add Pools, but they won’t see pricing for it under each pool.

Although the radio button label is long, this provides transparency and reiterates the need to make a Region selection. Removed the "Prices my vary based on Region" from the helper text above the options.
Screenshot 2023-08-21 at 3 29 25 PM

At UX request, added HA as a line item to the Cluster Summary -- this was slightly out of scope of this PR, but an improvement upon #9489, so this change is not feature flagged. Also updated the helper text copy slightly to more accurately instruct the user to add a Node Pool.

No Selections Selections
image Screenshot 2023-08-21 at 3 30 01 PM

@abailly-akamai abailly-akamai self-requested a review August 22, 2023 12:38
Copy link
Contributor

@abailly-akamai abailly-akamai left a comment

Choose a reason for hiding this comment

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

Looks great thx for the changes!

@bnussman-akamai bnussman-akamai added Approved Multiple approvals and ready to merge! and removed Add'tl Approval Needed Waiting on another approval! labels Aug 22, 2023
@mjac0bs mjac0bs merged commit 7db4e85 into linode:develop Aug 22, 2023
coliu-akamai pushed a commit to coliu-akamai/manager that referenced this pull request Aug 23, 2023
* Delete unused files from refactor in linode#9489

* Add dynamic HA pricing for Kubernetes

* Update unit tests

* Add DC-specific HA price on upgrade dialog

* Replace HA env var with pricing constant

* Clean up

* Added changeset: Add DC-specific pricing to Kubernetes HA

* Don't display prices before region is selected

* Tweak copy in Kube checkout bar

* Update tests

* Feature flag all changes and update tests

* Update price increase percentage for Sao Paulo

* Address feedback: eliminate prop and use hook

* Address feedback: copy, UX for HA checkout bar
corya-akamai pushed a commit to corya-akamai/manager that referenced this pull request Sep 6, 2023
* Delete unused files from refactor in linode#9489

* Add dynamic HA pricing for Kubernetes

* Update unit tests

* Add DC-specific HA price on upgrade dialog

* Replace HA env var with pricing constant

* Clean up

* Added changeset: Add DC-specific pricing to Kubernetes HA

* Don't display prices before region is selected

* Tweak copy in Kube checkout bar

* Update tests

* Feature flag all changes and update tests

* Update price increase percentage for Sao Paulo

* Address feedback: eliminate prop and use hook

* Address feedback: copy, UX for HA checkout bar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approved Multiple approvals and ready to merge! DC-Specific Pricing UX/UI Changes for UI/UX to review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants