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

Use kube context - as argocd --core #170

Closed
nicraMarcin opened this issue May 10, 2022 · 1 comment · Fixed by #268
Closed

Use kube context - as argocd --core #170

nicraMarcin opened this issue May 10, 2022 · 1 comment · Fixed by #268

Comments

@nicraMarcin
Copy link

Hi,
I have not exposed argo server, it is as ClusterIP. I'd like to connect to it using kubernetes api like argocd --core does

$ argocd version --core
argocd: v2.3.3+07ac038
  BuildDate: 2022-03-30T01:46:59Z
  GitCommit: 07ac038a8f97a93b401e824550f0505400a8c84e
  GitTreeState: clean
  GoVersion: go1.17.6
  Compiler: gc
  Platform: linux/amd64
argocd-server: v2.3.3+07ac038
  BuildDate: 2022-03-30T01:46:59Z
  GitCommit: 07ac038a8f97a93b401e824550f0505400a8c84e
  GitTreeState: clean
  GoVersion: go1.17.6
  Compiler: gc
  Platform: linux/amd64
  Ksonnet Version: unable to determine ksonnet version: exec: "ks": executable file not found in $PATH
  Kustomize Version: could not get kustomize version: exec: "kustomize": executable file not found in $PATH
  Helm Version: v3.8.2+g6e3701e
  Kubectl Version: v0.23.1
  Jsonnet Version: v0.18.0

How to configure this provider?

provider "argocd" {
  # Configuration options
  # server_addr = "kubernetes"
  insecure = true
  kubernetes {
    config_path = "~/.kube/config"
    config_context = "kind-monitor"
  }
}

server_addr attribure is required :( but if I set it with kubectl api it does't work.

Error: Missing required argument
│ 
│   with provider["registry.terraform.io/oboukili/argocd"],
│   on providers.tf line 10, in provider "argocd":
│   10: provider "argocd" {
│ 
│ "username": one of `auth_token,password,use_local_config,username` must be specified
@MrLuje
Copy link
Contributor

MrLuje commented Jun 26, 2022

AFAIK, login --core cannot be used by 3rd-parties for now, since it simulates a local ArgoCD as a backend (and is not available in argo-cd package)
I see that you have an argocd-server which makes the use of --core not mandatory for the terraform part.
You can try with the port-forward flag so you can use the ClusterIP :

provider "argocd" {
  server_addr = "port-forward"
  username = ""  # <--- needed since not login core anymore
  password = ""  # <--- needed since not login core anymore

  port_forward  = true
  port_forward_with_namespace = "xxx" # <--- if not default namespace

  insecure = true
  kubernetes {
    config_path = "~/.kube/config"
    config_context = "kind-monitor"
  }
  grpc_web = true  # <-- might be needed depending on your config

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants