Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Allow to pass Kubernetes configuration overrides #5906

Merged
merged 1 commit into from
Apr 7, 2021
Merged

fix: Allow to pass Kubernetes configuration overrides #5906

merged 1 commit into from
Apr 7, 2021

Conversation

raphink
Copy link
Contributor

@raphink raphink commented Mar 30, 2021

This allows to override the Kubernetes configuration used to set up the
Port Forward.

Signed-off-by: Raphaël Pinson raphael.pinson@camptocamp.com

Note on DCO:

If the DCO action in the integration test fails, one or more of your commits are not signed off. Please click on the Details link next to the DCO action for instructions on how to resolve this.

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).

This allows to override the Kubernetes configuration used to set up the
Port Forward.

Closes [ISSUE 5905]

Signed-off-by: Raphaël Pinson <raphael.pinson@camptocamp.com>
@raphink
Copy link
Contributor Author

raphink commented Mar 30, 2021

Not sure why the caching step is failing 🤔

@jannfis
Copy link
Member

jannfis commented Mar 30, 2021

Not sure why the caching step is failing

Seems like a hiccup with GitHub actions to me. I'll re-run the CI.

@codecov
Copy link

codecov bot commented Mar 30, 2021

Codecov Report

Merging #5906 (f6e9b91) into master (8bfe41b) will decrease coverage by 0.00%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5906      +/-   ##
==========================================
- Coverage   40.89%   40.88%   -0.01%     
==========================================
  Files         147      147              
  Lines       19633    19634       +1     
==========================================
  Hits         8028     8028              
- Misses      10500    10501       +1     
  Partials     1105     1105              
Impacted Files Coverage Δ
cmd/argocd-util/commands/app.go 31.57% <0.00%> (-0.14%) ⬇️
cmd/argocd-util/commands/cluster.go 0.00% <0.00%> (ø)
util/kube/portforwarder.go 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8bfe41b...f6e9b91. Read the comment docs.

@sbose78
Copy link
Contributor

sbose78 commented Mar 30, 2021

Could you please help me with an example @raphink ?

@raphink
Copy link
Contributor Author

raphink commented Mar 30, 2021

@sbose78 certainly. In https://github.com/hashicorp/terraform-provider-kubernetes/blob/main/kubernetes/provider.go for example, the code instantiates a clientcmd.ConfigOverrides{} and passes various fields to it based on the Terraform provider parameters. Then they pass the overrides to the client.

The idea is to do the same for the ArgoCD provider, by allowing to pass Kubernetes parameters to the provider and pass them in the overrides.

This way, users of the provider (and potentially other users of the API client) will be able to specify a cluster and its credentials dynamically.

In the context of Terraform, this is useful as we might create the Kubernetes cluster with Terraform, and then pass the generated cluster parameters dynamically to ArgoCD in the same run.

This is what we do in our DevOps Stack project, where the argocd-helm module takes a kubeconfig parameter as a string, passed by another module creating the cluster (e.g. for EKS: https://github.com/camptocamp/devops-stack/blob/master/modules/eks/aws/main.tf#L108).

At the moment, we need to use a hack to dump the Kube config in a temporary file. Use the ArgoCD Terraform provider would save us from this hack, but we need a way to dynamically pass the cluster credentials to it, in the same Terraform run. Hence this PR.

@raphink
Copy link
Contributor Author

raphink commented Apr 7, 2021

Any news on this? Is there any change I need to make?

Copy link
Collaborator

@alexmt alexmt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for providing the link to the workaround that you are using. So the PR allows using Kubernetes overrides by argocd CLI when port forwarding is used.

LGTM. thank you!

@alexmt alexmt merged commit 7c88ac8 into argoproj:master Apr 7, 2021
yujunz added a commit to abcue/argo-cd that referenced this pull request Apr 7, 2021
* 4f9c500 (upstream/master) docs: k8s version in Ingress Configuration documentation (argoproj#5727)
* 7c88ac8 feat: Allow to pass Kubernetes configuration overrides (argoproj#5906)
* 834a5fa chore: Change grammar in high_availability.md (argoproj#5964)
* 2a2b81f fix: Improvements to mobile UI (argoproj#5965)
* f06fc0d feat: allow per-version kustomize options (argoproj#5967)
* 92c7ca0 chore: make argocd gitpod friendly (argoproj#5973)
* 1bc3348 Upgrade gitops-engine (argoproj#5972)
* a686f12 fix: run dex as nonroot (argoproj#5815)
* ed5c5b6 chore: Update go-git to v5 (argoproj#5520)
* ac3d4cc fix: correct package name in Makefile (argoproj#5960)
* 24b2cac chore: fix incorrect image name in 'publish' CI job (argoproj#5956)
* b37eee1 chore: fix invalid IMAGE_NAMESPACE in image 'publish' CI job (argoproj#5953)
* dc4eaff chore: Remove specification of user id for the Redis workload (argoproj#5863)
* 8eeb9a0 chore: use clusterrolebinding v1 (argoproj#5939)
* 7945286 docs: clarify that the certificate must be in PEM format (argoproj#5946)
* de522bf chore: migrate argocd dev images to ghcr.io (argoproj#5948)
* 0a53fb1 chore(deps): bump y18n from 4.0.0 to 4.0.1 in /ui (argoproj#5919)
* ae49b45 chore: Upgrade Go module to v2 (argoproj#5931)
* a2ebe15 add user (argoproj#5938)
* 7f5a23d Update USERS.md (argoproj#5835)
* 24218b4 docs: Propose an enhancement proposal process (argoproj#5771)
shubhamagarwal19 pushed a commit to shubhamagarwal19/argo-cd that referenced this pull request Apr 15, 2021
This allows to override the Kubernetes configuration used to set up the
Port Forward.

Closes [ISSUE 5905]

Signed-off-by: Raphaël Pinson <raphael.pinson@camptocamp.com>
@jannfis jannfis changed the title Closes [ISSUE 5905] Allow to pass Kubernetes configuration overrides fix: Allow to pass Kubernetes configuration overrides Jul 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants