arlon
arlon copied to clipboard
Arlon cli context management support
Currently arlon cli interacted with 3 entities:
- Git repo
- ArgoCD Server
- 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:
- Create new contexts
- Delete contexts
- Shift between contexts
- 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:
-
Create new context
arlon context add <new_context_name> --argocd-server <argocd_addr> --gitrepo .....
-
Delete context
arlon context delete <context_name>
-
Shift between context
arlon context set <context_name>
-
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
@bcle who can scope this work?
@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.
Can you label this with a t-shirt size?