devstream
devstream copied to clipboard
:four_leaf_clover: `Proposal`: Plugin `argocdapp` Enhancement (sub-task of #513)
What would you like to add? Why is this needed?
Background
See #513 for more details.
Adding more background and possible improvements:
Background
The ArgoCD App plugin creates a YAML file locally for ArgoCD Application CRD then uses kubectl
to apply it, which isn't a good practice, because:
- It relies on
kubectl
command tool, but the thing is, it might not be available. So, the plugin depends on the environment in which it's running. - It creates a file then removes the file, which is redundant.
Possible Improvements: Apply Mechanism
Maybe we can use ArgoCD API client and/or K8s Go SDK to create the CRD, instead of using kubectl
.
Possible Improvements: Config
Current config is as follows:
tools:
- name: argocdapp
instanceID: default
dependsOn: [ "argocd.ARGOCD_INSTANCE_NAME" ]
options:
app:
name: hello
namespace: argocd
destination:
server: https://kubernetes.default.svc
namespace: default
source:
valuefile: values.yaml
path: charts/go-hello-http
repoURL: YOUR_CHART_REPO_URL
Better naming:
-
valuefile
->valueFile
-
path
: is a bit unclear. Better naming is required. -
repoURL
: what repo?
Add default values, maybe:
- options.destination.server: https://kubernetes.default.svc (on which the Argo CD is running)
Be Brave, Be Imaginative
Anything that isn't following the clean code best practice, refactor it.
Any feature you think would add value to end-users, add it.
Any configuration refactors / documentation updates that would improve the end users' quality of life, do it.
Be brave when deleting unnecessary code, and be imaginative when adding new features.
TODO:
- [x] value_file support local and remote
- [x] support default config for destination
- [ ] use
goclient
instead of kubectl