Skip to content

Update Tiltfile to differentiate between aks and kind cluster #5289

@nawazkh

Description

@nawazkh

Tiltfile uses if "aks" in settings.get("kustomize_substitutions", {}).get("MGMT_CLUSTER_NAME", ""): to check if the tilt is being used with AKS cluster as a management cluster.
This is an inefficient approach. Especially when a user is switching from AKS -> KIND.

Suggested approach:

  • There are two approaches to solve this
    1. Have MGMT_CLUSTER_TYPE saved to an .env file in the repo directory with MGMT_CLUSTER_TYPE=aks when running make aks-create. Source this env file before running tilt-up. The env file must be updated when running make kind-create.
      OR
    2. Update tilt-settings.yaml, add or delete MGMT_CLUSTER_TYPE every time aks-create or kind-create is called. Tilt-settings.yaml gets parsed in Tiltfile
      tilt_file = "./tilt-settings.yaml" if os.path.exists("./tilt-settings.yaml") else "./tilt-settings.json"
    • Once settings struct in tiltfile is updated, we can then use it to check if the mgmt cluster type is aks or not.
  • Once a similar logic is implemented, we want to update all the occurrences of if "aks" in settings.get("kustomize_substitutions", {}).get("MGMT_CLUSTER_NAME", ""): in the Tiltfile with appropriate if condition.

Metadata

Metadata

Assignees

Labels

good first issueDenotes an issue ready for a new contributor, according to the "help wanted" guidelines.help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.

Type

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions