devstream icon indicating copy to clipboard operation
devstream copied to clipboard

:four_leaf_clover: `Proposal`: Plugin `argocdapp` Enhancement (sub-task of #513)

Open daniel-hutao opened this issue 2 years ago • 2 comments

What would you like to add? Why is this needed?

Background

See #513 for more details.

daniel-hutao avatar May 18 '22 09:05 daniel-hutao

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.

IronCore864 avatar May 25 '22 09:05 IronCore864

TODO:

  • [x] value_file support local and remote
  • [x] support default config for destination
  • [ ] use goclient instead of kubectl

steinliber avatar Aug 04 '22 03:08 steinliber