devstream icon indicating copy to clipboard operation
devstream copied to clipboard

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

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

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

See #513 for the details

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

Adding more details about this issue:

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.

Possible Improvements: Config Refactor

The current options section is like this:

  options:
    create_namespace: true
    repo:
      name: argo
      url: https://argoproj.github.io/argo-helm
    chart:
      chart_name: argo/argo-cd
      release_name: argocd
      namespace: argocd
      wait: true
      timeout: 5m
      upgradeCRDs: true
      values_yaml: |
        controller:
          service: 
            port: 8080
        redis:
          image:
            tag: 6.2.6-alpine3.15

There are a couple of possible improvements:

  1. Provide default values for repo.name and repo.url. I.E., the repo section should be optional. The reason is that most users would install ArgoCD from the default/official repo.
  2. chart_name might be a little bit misleading. It's rather "CHART_REPO/CHARTNAME`. A better name is needed.
  3. Provide default values for chart.release_name, chart.namespace, chart.wait, chart.upgradeCRDs, and chart.timeout.
  4. Provide a better example in the documentation, especially for the values_yaml section. The current example doesn't seem quite necessary (like Redis version, and service port 8080, not what normal users would override the default values from the chart).

Possible Improvements: Code Improvement

  1. Code: internal/pkg/plugin/argocd/argocd.go is empty, not necessary maybe. But since the dtm develop command creates this file, maybe the better thing to do here is to move the logic from the state.go to this file.
  2. Functions refactor. Make them easier to read and easier to test.
  3. Add unit tests wherever possible.

IronCore864 avatar May 25 '22 08:05 IronCore864

This issue might be too big for a good first issue, but we still want to give it a try since it's mainly refactoring and improving.

IronCore864 avatar May 25 '22 08:05 IronCore864

I will give it a try @daniel-hutao

jxs1211 avatar Jul 06 '22 00:07 jxs1211

TODO:

  • [x] argocd support default config
  • [x] argocd high available docs -> refer https://argo-cd.readthedocs.io/en/stable/operator-manual/high_availability/
  • [ ] argocd sso

steinliber avatar Aug 03 '22 07:08 steinliber