Skip to content

Conversation

ls0f
Copy link
Contributor

@ls0f ls0f commented May 24, 2022

May fix
#8314
#6043

WIP
It should be discussed, then add more tests.

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • Optional. My organization is added to USERS.md.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).

@ls0f ls0f changed the title feat: managed clusters via proxy feat: manage clusters via proxy May 24, 2022
@codecov
Copy link

codecov bot commented May 24, 2022

Codecov Report

Attention: 23 lines in your changes are missing coverage. Please review.

Comparison is base (02bf903) 45.75% compared to head (582d59f) 45.71%.
Report is 1689 commits behind head on master.

❗ Current head 582d59f differs from pull request most recent head 91d373f. Consider uploading reports for the commit 91d373f to get more accurate results

Files Patch % Lines
pkg/apis/application/v1alpha1/types.go 0.00% 15 Missing ⚠️
cmd/argocd/commands/cluster.go 0.00% 5 Missing ⚠️
cmd/util/cluster.go 0.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9496      +/-   ##
==========================================
- Coverage   45.75%   45.71%   -0.04%     
==========================================
  Files         236      236              
  Lines       28527    28550      +23     
==========================================
  Hits        13053    13053              
- Misses      13669    13691      +22     
- Partials     1805     1806       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ls0f
Copy link
Contributor Author

ls0f commented May 30, 2022

This branch does not contain the latest commit. we have implemented the feature in our test env.
I can continue to work on it if this feature is considered @crenshaw-dev

@jinnjwu
Copy link

jinnjwu commented May 30, 2022

same issue: #7887

@crenshaw-dev
Copy link
Member

I think this change is reasonable. Added a couple more reviewers.

@ls0f ls0f changed the title feat: manage clusters via proxy feat: manage clusters via proxy [WIP] Jun 6, 2022
@jinnjwu
Copy link

jinnjwu commented Jul 13, 2022

any udpate, we need this feature, all of our k8s behind a proxy

@jinnjwu
Copy link

jinnjwu commented Jul 24, 2022

any update?

1 similar comment
@jinnjwu
Copy link

jinnjwu commented Jul 24, 2022

any update?

@jinnjwu
Copy link

jinnjwu commented Aug 8, 2022

any chance to merge at v2.5 @crenshaw-dev

@crenshaw-dev
Copy link
Member

Apologies for missing your pings @jinnjwu! @ls0f are you still able to push this PR? Looks like it needs a make codegen.

I'm definitely going to need some external help on the review. I'm going to add this PR to the topics for the next contributor experience meeting so I can get help.

@ls0f
Copy link
Contributor Author

ls0f commented Aug 10, 2022

yep, i can push this PR @crenshaw-dev

@crenshaw-dev
Copy link
Member

@ls0f can you run codegen and push?

I'm also curious if you have reproduction/test steps handy? I don't tinker with proxies often, so if you have particular tools or steps you've used, that would help me test. :-)

@zhang-xuebin
Copy link

any update?

https://github.com/zhang-xuebin/argo-helm/tree/host-on-gke is an example to let Argo manage private GKE clusters. It doesn't matter if the cluster is public or private. it works for Argo 2.4.1+.

@jinnjwu
Copy link

jinnjwu commented Aug 18, 2022

any update?

https://github.com/zhang-xuebin/argo-helm/tree/host-on-gke is an example to let Argo manage private GKE clusters. It doesn't matter if the cluster is public or private. it works for Argo 2.4.1+.

looks like we are talking different scenaio.

@jinnjwu
Copy link

jinnjwu commented Aug 18, 2022

@ls0f can you run codegen and push?

I'm also curious if you have reproduction/test steps handy? I don't tinker with proxies often, so if you have particular tools or steps you've used, that would help me test. :-)

@ls0f would you help it?

@jinnjwu
Copy link

jinnjwu commented Aug 31, 2022

@ls0f any chance for pr?

haifangwang added 2 commits September 24, 2022 11:55
Signed-off-by: ls0f <lovedboy.tk@qq.com>
Signed-off-by: ls0f <lovedboy.tk@qq.com>
@ls0f
Copy link
Contributor Author

ls0f commented Sep 24, 2022

@crenshaw-dev The code is updated.
The related PR should be merge first. argoproj/gitops-engine#466

@jinnjwu
Copy link

jinnjwu commented Sep 25, 2022

@ls0f one question, Does it support multi proxy. our each k8s cluster has different proxy

@ls0f
Copy link
Contributor Author

ls0f commented Sep 25, 2022

@ls0f one question, Does it support multi proxy. our each k8s cluster has different proxy

every cluster manged by argo can specify proxy

@jinnjwu
Copy link

jinnjwu commented Oct 4, 2022

@crenshaw-dev The code is updated. The related PR should be merge first. argoproj/gitops-engine#466

@crenshaw-dev would you help it?

@jinnjwu
Copy link

jinnjwu commented Oct 5, 2022

hope it will be ready in 2.5 . all of our k8s cluster behind a proxy.

@dje4om
Copy link

dje4om commented Jun 1, 2023

This patch branch has been running in our pro env for half a year and no problems have been found.

if this argoproj/gitops-engine#466 is merged, i will update this PR

Hello @ls0f, now it is :)

@chris-lsn
Copy link

Hi,

As i had the doubt about to miss a thing, i continued to search and yes, i missed a thing ^^, it was finally about this commit and the make codegen step ! So guys, if you build your own for testing purposes, take care to check all the steps !

So, i confirm that it now works as expected ! i mean creating a cluster through a secret as well as creating the cluster through the argocd add cluster --proxy-url command, and in both case, i am able to see the field on this command output :

argocd cluster list -o json | jq .[].config.proxyUrl

the link seems not accessible.

@dje4om
Copy link

dje4om commented Jul 3, 2023

Hi,
As i had the doubt about to miss a thing, i continued to search and yes, i missed a thing ^^, it was finally about this commit and the make codegen step ! So guys, if you build your own for testing purposes, take care to check all the steps !
So, i confirm that it now works as expected ! i mean creating a cluster through a secret as well as creating the cluster through the argocd add cluster --proxy-url command, and in both case, i am able to see the field on this command output :
argocd cluster list -o json | jq .[].config.proxyUrl

the link seems not accessible.

Hello, i fixed it, here is the link : 582d59f

@Hirikols
Copy link

Hirikols commented Oct 13, 2023

@ls0f hi,any updates on this feature?

@chris-lsn
Copy link

I have been using this change about a half year without any issues.

@rochaporto
Copy link
Contributor

Is there a timeline to get this merged? We need to rebuild argocd/run this as a local patch right now to be able to manage some of our deployments.

@rochaporto
Copy link
Contributor

@ls0f are you still willing to push this in?

@ls0f
Copy link
Contributor Author

ls0f commented Dec 18, 2023

Sorry for the long delay in responding, but I haven't had time to work on this lately, is there anyone willing to develop this feature. @dje4om @manuelstein

@todaywasawesome todaywasawesome added the lifecycle/rotten Issue/PR had no activity for a long time and should be closed soon label Feb 15, 2024
tmsdce pushed a commit to claranet/terraform-provider-argocd that referenced this pull request Mar 25, 2024
tmsdce pushed a commit to claranet/terraform-provider-argocd that referenced this pull request Mar 25, 2024
@qixiaobo
Copy link

I found a way to make workaround
image

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: argocd

secretGenerator:
  - name: cluster-xxx-xxx
    files:
      - config=secrets/config.json
      - name=secrets/name
      - server=secrets/server

generatorOptions:
  disableNameSuffixHash: true
  labels:
    type: generated
    argocd.argoproj.io/secret-type: cluster
  annotations:
    note: generated
    managed-by: argocd.argoproj.io

image

So this makes sense
image

dje4om added a commit to claranet/terraform-provider-argocd that referenced this pull request Mar 27, 2024
@dindurthy
Copy link

Is there much remaining to do on this? Seems like a pretty critical feature?

@KarstenSiemer
Copy link
Contributor

any news? Would be super cool!

@warroyo
Copy link

warroyo commented Jul 3, 2024

any movement on this?

@rochaporto
Copy link
Contributor

@crenshaw-dev what's the best way to get this merged? We've been using a patched ArgoCD for 6 months with this and working great.

@MPritsch
Copy link

MPritsch commented Aug 9, 2024

The workaround of @qixiaobo did not work for us. We were also unable to patch and compile argocd ourselves, so we got creative. We came up with a different solution. We did it with a deployment of a kubectl container which generates kubeconfig for EKS and runs this command:

kubectl proxy --port=your-port --address=0.0.0.0 --accept-hosts='.*' --api-prefix=/

Then the ArgoCD cluster secret points to the service of the pod with http (https, wouldn't work). We use cilium, so traffic is still encrypted.

Don't know about the stability of the solution yet. We just build a cronjob to redeploy it every hour...

This is also "insecure", since it has no authentication, so any pod could run kubectl commands on the target cluster. Our cluster is not easily reachable, so it should be fine, but still...

We would greatly appreciate it if the proper solution of this pull-request provides could finally be merged, because we don't want to work with janky workarounds. This was pretty frustrating, since we have no good alternative in an on-premise environment that needs to communicate with an external cluster.

@4ch3los
Copy link

4ch3los commented Sep 5, 2024

Hey together,
i would offer to write some test to get this merged.
From my understanding the e2e test currently require and run only on one cluster and the process of adding a cluster is also just tested with the one instance, which makes a test with 2 clusters + http proxy a bit hard. Should this behaviour be changed or did you intend other kind of tests for this feature?
cc. @crenshaw-dev

@DerrickMartinez
Copy link

We need this too, I guess we'll have to compile our own...

@4ch3los
Copy link

4ch3los commented Sep 26, 2024

Hey together, i would offer to write some test to get this merged. From my understanding the e2e test currently require and run only on one cluster and the process of adding a cluster is also just tested with the one instance, which makes a test with 2 clusters + http proxy a bit hard. Should this behaviour be changed or did you intend other kind of tests for this feature? cc. @crenshaw-dev

#push a hint on the test requirement would be great to be able to contribute the tests needed for a merge @crenshaw-dev

@todaywasawesome todaywasawesome added component:cluster-management Issue related to multi-clusters management and removed lifecycle/rotten Issue/PR had no activity for a long time and should be closed soon labels Oct 10, 2024
@pasha-codefresh
Copy link
Member

Reopened PR here #20374
Will work on comments and tests.

Huge thanks to @ls0f for initial work. Really appreciate it

@pasha-codefresh
Copy link
Member

Merged #20374

tmsdce pushed a commit to claranet/terraform-provider-argocd that referenced this pull request Mar 17, 2025
pdecat pushed a commit to claranet/terraform-provider-argocd that referenced this pull request Mar 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:cluster-management Issue related to multi-clusters management
Projects
None yet
Development

Successfully merging this pull request may close these issues.