Skip to content

feat: [M3-7048] - Add DC-specific pricing for Kubernetes node pools#9606

Merged
abailly-akamai merged 12 commits intolinode:developfrom
mjac0bs:M3-7048-add-dc-pricing-for-kube-node-pools
Sep 2, 2023
Merged

feat: [M3-7048] - Add DC-specific pricing for Kubernetes node pools#9606
abailly-akamai merged 12 commits intolinode:developfrom
mjac0bs:M3-7048-add-dc-pricing-for-kube-node-pools

Conversation

@mjac0bs
Copy link
Contributor

@mjac0bs mjac0bs commented Aug 30, 2023

Description 📝

This PR adds DC-specific pricing for Kubernetes node pools in the create flow and on the details page in add/resize drawers.

Major Changes 🔄

With the mocks and feature flag on:
Kube Create page:

  • When a region is selected, the Node Pools table displays the hourly and monthly pricing corresponding to the selected region.
  • When a region is not selected, the Node Pools table does not display rows, and instead displays a message: "Select a Region to view plans and prices."
  • The Cluster Summary displays correctly calculated DC-specific pricing based on the Linode's region – both Node Pool line items and the total.
  • When either a region or a pool is not selected, the cluster summary does not display prices and displays helper text indicating what selections must be made for pricing and cluster creation.

Kube Details page:

  • Kube cluster specs displays a correctly calculated total DC-specific total price of the cluster/month.

Add a Node Pool drawer:

  • The Node Pools table displays the hourly and monthly pricing corresponding to the region the cluster is in.
  • The drawer copy displays correctly calculated DC-specific pricing based on the cluster's region.

Resize Pool drawer:

  • The drawer copy displays correctly calculated DC-specific pricing based on the cluster's region.

Preview 📷

Flow/Component Before After
Create Cluster -> Node Pool Panel & Plan Selection Screenshot 2023-08-30 at 4 14 48 PM Screenshot 2023-08-30 at 4 12 25 PM Screenshot 2023-08-30 at 10 35 21 AM Screenshot 2023-08-30 at 3 20 42 PM
Create Cluster -> Checkout Bar Screenshot 2023-08-30 at 4 13 05 PM Screenshot 2023-08-30 at 4 21 03 PM
Kubenetes Cluster Details -> Specs Screenshot 2023-08-30 at 3 30 22 PM Screenshot 2023-08-30 at 3 30 14 PM
Kubernetes Cluster Details -> Add Node Pool Drawer Screenshot 2023-08-30 at 3 30 46 PM Screenshot 2023-08-30 at 3 31 02 PM
Kubernetes Cluster Details -> Resize Node Pool Drawer Screenshot 2023-08-30 at 3 31 43 PM Screenshot 2023-08-30 at 3 31 27 PM

How to test 🧪

  1. How to setup test environment?
  • Ensure DC-Specific Pricing flag and MSW are both on.
  • To test, I temporarily modified the kubernetesAPIResponse and kubernetesClusterFactory factories and replaces region: 'us-central' with region: 'id-cgk'.
  1. How to verify changes?
  • Test that the above changes are visible with the DC-Specific Pricing flag on and not visible with the flag off.
  • Confirm that the plans selection cards in mobile view update dynamically with region selection when the flag is on and the notice looks good.
  1. How to run Unit or E2E tests?
yarn test NodePoolPanel kubeUtils ResizeNodePoolDrawer KubeCheckoutBar KubernetesPlanContainer KubernetesPlanSelection

I did not cover the Add/Resize Node Pool drawers. There is an lke-update.spec.ts testing adding and resizing node pools; these should be updated in an e2e ticket.

@mjac0bs mjac0bs self-assigned this Aug 30, 2023
@mjac0bs mjac0bs force-pushed the M3-7048-add-dc-pricing-for-kube-node-pools branch 3 times, most recently from 4661995 to 456bb81 Compare September 1, 2023 05:56
@mjac0bs mjac0bs marked this pull request as ready for review September 1, 2023 06:04
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, no defect found. nice work! 🚀

just a few nice to have or follow ups

Copy link
Contributor

Choose a reason for hiding this comment

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

Note for later: not a blocker but we may want to revisit not rendering anything (and just an error) if missing types?

Copy link
Contributor

Choose a reason for hiding this comment

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

Would be nice to rename this util getKubeMonthlyPrice and move it to the pricing utils for consistency

Copy link
Contributor

Choose a reason for hiding this comment

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

We should type highAvailabilityPrice as PriceObject for consistency.

Copy link
Contributor

Choose a reason for hiding this comment

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

same for those, types are inferred but i think we should be more strict

Copy link
Contributor

Choose a reason for hiding this comment

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

same

Copy link
Contributor

Choose a reason for hiding this comment

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

😃 ty (i've seen this somewhere else ;) !

Copy link
Contributor

Choose a reason for hiding this comment

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

fantastic! 🎉

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

@jdamore-linode since we may merge this PR while @mjac0bs is away, do you mind checking if the failing object-storage.e2e test is relevant? I ran things locally without a problem but would be nice to be confident

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.

All flows showed correct prices! 💵

@bnussman-akamai bnussman-akamai added Approved Multiple approvals and ready to merge! and removed Add'tl Approval Needed Waiting on another approval! labels Sep 1, 2023
@jdamore-linode
Copy link
Contributor

@jdamore-linode since we may merge this PR while @mjac0bs is away, do you mind checking if the failing object-storage.e2e test is relevant? I ran things locally without a problem but would be nice to be confident

@abailly-akamai We can disregard the failure! We were having an OBJ incident earlier today around the time of this run that I think is responsible for the failure; it just passed locally for me 👍

@abailly-akamai abailly-akamai force-pushed the M3-7048-add-dc-pricing-for-kube-node-pools branch from ed7e79c to d7055c0 Compare September 1, 2023 20:25
@abailly-akamai abailly-akamai merged commit 8fc7ce9 into linode:develop Sep 2, 2023
abailly-akamai added a commit that referenced this pull request Sep 7, 2023
…9606)

* Update kube utils for dynamic pricing

* Add DC-specific dynamic pricing for Add and Resize Node Pool drawers

* Add DC-specific dynamic pricing to cluster specs and checkout bar

* Update test

* Add DC-specific dynamic pricing in kube node pools tables

* Display dynamic prices in the selection card, mobile view

* Render mobile view empty state plan table helper text in Notice

* WIP: suspicious tests

* Update unit tests

* Cleanup

* Added changeset: Add DC-specific pricing to Kubernetes node pools

* feat: [M3-7048] feedback

---------

Co-authored-by: Alban Bailly <abailly@akamai.com>
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants