You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enhanced/improved provider configuration options and documentation (#268)
* fix(provider): implement `kubernetes.config_context` options
These were available on the provider configuration but not actually used,
* fix(provider): remove unused `kubernetes` configuration options
These cannot be used by the provider so there's no point in having them here.
* fix(provider): mark `server_addr` as optional
This does not need to be supplied when port forwarding or using local config.
* feat(provider): add `core` to provider configuration
* fix(provider): fix description of `context` option
* fix(provider): improve descriptions for port forwarding configuration
* docs(provider): improve overview and add examples for common provider configuration
* docs: improve wording on port forwarding example
Co-authored-by: Olivier Boukili <[email protected]>
* chore: drop `ARGOCD_CONTEXT` var from local test env vars
---------
Co-authored-by: Olivier Boukili <[email protected]>
Description: "ArgoCD authentication token, takes precedence over `username`/`password`. Can be set through the `ARGOCD_AUTH_TOKEN` environment variable.",
Description: "Kubernetes context to load from an existing `.kube/config` file. Can be set through `ARGOCD_CONTEXT` environment variable.",
127
+
Description: "Context to choose when using a local ArgoCD config file. Only relevant when `use_local_config`. Can be set through `ARGOCD_CONTEXT` environment variable.",
128
+
ConflictsWith: []string{
129
+
"core",
130
+
"username",
131
+
"password",
132
+
"auth_token",
133
+
},
114
134
},
115
135
"user_agent": {
116
136
Type: schema.TypeString,
117
137
Optional: true,
118
138
},
139
+
"core": {
140
+
Type: schema.TypeBool,
141
+
Optional: true,
142
+
Description: "Configure direct access using Kubernetes API server.\n\n "+
143
+
"**Warning**: this feature works by starting a local ArgoCD API server that talks directly to the Kubernetes API using the **current context "+
144
+
"in the default kubeconfig** (`~/.kube/config`). This behavior cannot be overridden using either environment variables or the `kubernetes` block "+
145
+
"in the provider configuration at present).\n\n If the server fails to start (e.g. your kubeconfig is misconfigured) then the provider will "+
146
+
"fail as a result of the `argocd` module forcing it to exit and no logs will be available to help you debug this. The error message will be "+
147
+
"similar to\n > `The plugin encountered an error, and failed to respond to the plugin.(*GRPCProvider).ReadResource call. The plugin logs may "+
148
+
"contain more details.`\n\n To debug this, you will need to login via the ArgoCD CLI using `argocd login --core` and then running an operation. "+
Description: "Use the authentication settings found in the local config file. Useful when you have previously logged in using SSO. Conflicts with `auth_token`, `username` and `password`.",
Description: "Override the default config path of `$HOME/.config/argocd/config`. Only relevant when `use_local_config`. Can be set through the `ARGOCD_CONFIG_PATH` environment variable.",
144
183
ConflictsWith: []string{
145
-
"username",
146
-
"password",
147
184
"auth_token",
185
+
"core",
186
+
"password",
187
+
"username",
148
188
},
149
189
},
150
190
"port_forward": {
151
-
Type: schema.TypeBool,
152
-
Optional: true,
191
+
Type: schema.TypeBool,
192
+
Description: "Connect to a random argocd-server port using port forwarding.",
193
+
Optional: true,
153
194
},
154
195
"port_forward_with_namespace": {
155
-
Type: schema.TypeString,
156
-
Optional: true,
196
+
Type: schema.TypeString,
197
+
Description: "Namespace name which should be used for port forwarding.",
Description: "Kubernetes configuration overrides. Only relevant when `port_forward = true` or `port_forward_with_namespace = \"foo\"`. The kubeconfig file that is used can be overridden using the [`KUBECONFIG` environment variable](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#the-kubeconfig-environment-variable)).",
-`config_path` (String) Override the default config path of `$HOME/.config/argocd/config`. Only relevant when `use_local_config`. Can be set through the `ARGOCD_CONFIG_PATH` environment variable.
37
-
-`context` (String) Kubernetes context to load from an existing `.kube/config` file. Can be set through `ARGOCD_CONTEXT` environment variable.
102
+
-`context` (String) Context to choose when using a local ArgoCD config file. Only relevant when `use_local_config`. Can be set through `ARGOCD_CONTEXT` environment variable.
103
+
-`core` (Boolean) Configure direct access using Kubernetes API server.
104
+
105
+
**Warning**: this feature works by starting a local ArgoCD API server that talks directly to the Kubernetes API using the **current context in the default kubeconfig** (`~/.kube/config`). This behavior cannot be overridden using either environment variables or the `kubernetes` block in the provider configuration at present).
106
+
107
+
If the server fails to start (e.g. your kubeconfig is misconfigured) then the provider will fail as a result of the `argocd` module forcing it to exit and no logs will be available to help you debug this. The error message will be similar to
108
+
> `The plugin encountered an error, and failed to respond to the plugin.(*GRPCProvider).ReadResource call. The plugin logs may contain more details.`
109
+
110
+
To debug this, you will need to login via the ArgoCD CLI using `argocd login --core` and then running an operation. E.g. `argocd app list`.
38
111
-`grpc_web` (Boolean) Whether to use gRPC web proxy client. Useful if Argo CD server is behind proxy which does not support HTTP2.
39
112
-`grpc_web_root_path` (String) Use the gRPC web proxy client and set the web root, e.g. `argo-cd`. Useful if the Argo CD server is behind a proxy at a non-root path.
40
113
-`headers` (Set of String) Additional headers to add to each request to the ArgoCD server.
41
114
-`insecure` (Boolean) Whether to skip TLS server certificate. Can be set through the `ARGOCD_INSECURE` environment variable.
42
-
-`kubernetes` (Block List, Max: 1) Kubernetes configuration. (see [below for nested schema](#nestedblock--kubernetes))
115
+
-`kubernetes` (Block List, Max: 1) Kubernetes configuration overrides. Only relevant when `port_forward = true` or `port_forward_with_namespace = "foo"`. The kubeconfig file that is used can be overridden using the [`KUBECONFIG` environment variable](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#the-kubeconfig-environment-variable)). (see [below for nested schema](#nestedblock--kubernetes))
43
116
-`password` (String) Authentication password. Can be set through the `ARGOCD_AUTH_PASSWORD` environment variable.
44
117
-`plain_text` (Boolean) Whether to initiate an unencrypted connection to ArgoCD server.
45
-
-`port_forward` (Boolean)
46
-
-`port_forward_with_namespace` (String)
118
+
-`port_forward` (Boolean) Connect to a random argocd-server port using port forwarding.
119
+
-`port_forward_with_namespace` (String) Namespace name which should be used for port forwarding.
47
120
-`server_addr` (String) ArgoCD server address with port. Can be set through the `ARGOCD_SERVER` environment variable.
48
121
-`use_local_config` (Boolean) Use the authentication settings found in the local config file. Useful when you have previously logged in using SSO. Conflicts with `auth_token`, `username` and `password`.
49
122
-`user_agent` (String)
@@ -60,8 +133,6 @@ Optional:
60
133
-`config_context` (String) Context to choose from the config file. Can be sourced from `KUBE_CTX`.
61
134
-`config_context_auth_info` (String)
62
135
-`config_context_cluster` (String)
63
-
-`config_path` (String) Path to the kube config file. Can be sourced from `KUBE_CONFIG_PATH`.
64
-
-`config_paths` (List of String) A list of paths to the kube config files. Can be sourced from `KUBE_CONFIG_PATHS`.
65
136
-`exec` (Block List, Max: 1) Configuration block to use an [exec-based credential plugin](https://kubernetes.io/docs/reference/access-authn-authz/authentication/#client-go-credential-plugins), e.g. call an external command to receive user credentials. (see [below for nested schema](#nestedblock--kubernetes--exec))
66
137
-`host` (String) The hostname (in form of URI) of the Kubernetes API. Can be sourced from `KUBE_HOST`.
67
138
-`insecure` (Boolean) Whether server should be accessed without verifying the TLS certificate. Can be sourced from `KUBE_INSECURE`.
0 commit comments