arlon icon indicating copy to clipboard operation
arlon copied to clipboard

Arlon cli context management support

Open chinmaykolhatkar opened this issue 2 years ago • 3 comments

Currently arlon cli interacted with 3 entities:

  1. Git repo
  2. ArgoCD Server
  3. K8s API Server of Management Cluster

It would be very beneficial to have a context management similar to how its done by argocd cli. A context can be defined as combination of git repo (with credentials if there), ArgoCD Server connection information, k8s API Server connection information.

All the information about multiple contexts can be saved in ~/.arlon folder on user machine.

User should be able to perform following activities with the contexts:

  1. Create new contexts
  2. Delete contexts
  3. Shift between contexts
  4. Renew tokens in the context (good to have)

Once a context is set by the user, the individual commands having parameters about above 3 (git, k8s, argocd) can be treated as optional. If present, they override the set context.

Commands can be see as follows:

  1. Create new context arlon context add <new_context_name> --argocd-server <argocd_addr> --gitrepo .....

  2. Delete context arlon context delete <context_name>

  3. Shift between context arlon context set <context_name>

  4. Impact of other commands because of context. Below given is an example command: arlon create clusterspec [--context <context_to_use>] [--gitrepo <repo url>].. Notice in above command that git repo and context are optional parameters. Individual command to retrieve the git repo in following order: a. overridden param in command b. context present in the command c. command set globally Similarly do the same for argocd server & mgmt cluster also.

Aha! Link: https://pf9.aha.io/features/ARLON-164

chinmaykolhatkar avatar Jun 01 '22 06:06 chinmaykolhatkar

@bcle who can scope this work?

cre8minus1 avatar Jul 06 '22 19:07 cre8minus1

@jayanth-tjvrr has implemented this (context management) in ArlonCtl (closed source CLI) as part of the PMK integration in v0.3 since it's especially useful when switching between multiple PMK DUs.

cruizen avatar Jul 06 '22 19:07 cruizen

Can you label this with a t-shirt size?

bcle avatar Jul 07 '22 00:07 bcle