-
Notifications
You must be signed in to change notification settings - Fork 15
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
feat: CLI to manipulate agent configuration #282
Draft
jannfis
wants to merge
29
commits into
main
Choose a base branch
from
feat/agentctl
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #282 +/- ##
==========================================
- Coverage 48.79% 44.73% -4.06%
==========================================
Files 73 78 +5
Lines 6400 7309 +909
==========================================
+ Hits 3123 3270 +147
- Misses 3017 3767 +750
- Partials 260 272 +12 ☔ View full report in Codecov by Sentry. |
Signed-off-by: jannfis <[email protected]>
490c86c
to
4d96327
Compare
Signed-off-by: jannfis <[email protected]>
Signed-off-by: jannfis <[email protected]>
Signed-off-by: jannfis <[email protected]>
Signed-off-by: jannfis <[email protected]>
Signed-off-by: jannfis <[email protected]>
Signed-off-by: jannfis <[email protected]>
Signed-off-by: jannfis <[email protected]>
Signed-off-by: jannfis <[email protected]>
Signed-off-by: jannfis <[email protected]>
Signed-off-by: jannfis <[email protected]>
Signed-off-by: jannfis <[email protected]>
Signed-off-by: jannfis <[email protected]>
Signed-off-by: jannfis <[email protected]>
Signed-off-by: jannfis <[email protected]>
Signed-off-by: jannfis <[email protected]>
Signed-off-by: jannfis <[email protected]>
Signed-off-by: jannfis <[email protected]>
Signed-off-by: jannfis <[email protected]>
Signed-off-by: jannfis <[email protected]>
Signed-off-by: jannfis <[email protected]>
Signed-off-by: jannfis <[email protected]>
Signed-off-by: jannfis <[email protected]>
Signed-off-by: jannfis <[email protected]>
Signed-off-by: jannfis <[email protected]>
Signed-off-by: jannfis <[email protected]>
Signed-off-by: jannfis <[email protected]>
Signed-off-by: jannfis <[email protected]>
Signed-off-by: jannfis <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do / why we need it:
This PR introduces a new CLI for argocd-agent, which can be used to manipulate and inspect agent configuration on the principal.
Right now, it will be able to:
In the future, we may want to extend this functionality beyond the limited use cases we support initially. I will create feature issues for these things.
It also adds some e2e tests for the resource proxy.
Which issue(s) this PR fixes:
Fixes #?
How to test changes / Special notes to the reviewer:
The new CLI is located in
cmd/ctl
. The new commands introduced by this CLI for now areca
(for manipulating and inspecting the CA) andagent
for manipulating and inspecting cluster configuration.The names of these commands are not finalized, so if you have suggestions, let me know!
Agent configuration for now is an Argo CD cluster secret that points to the resource proxy, instead of to a real cluster.
With this change, the resource proxy can be easily tested. First, create the CA and an agent configuration like so:
The
endpoint_addr_of_rp
must be reachable by Argo CD running in your cluster, so it must NOT be 127.0.0.1 or similar. Since the resource proxy will listen on all addresses, it's best to use the address of one of your interfaces.Then, create a new application on the principal and set the destination cluster to the one created by the previous command (i.e.
agent-managed
).The kubeconfig context to use with the agent can be specified by either setting the environment variable
ARGOCD_AGENT_CONTEXT
or the command line switch--context
to the name of the context to use. The command line has precedence over the environment variable.agentctl - CA related commands
ca generate
- Generate a new CA for use with the agentca inspect
- Inspect existing CAca delete
- Delete the CAca dump
- Dump cert or key of CA to stdoutca issue
- Issue certificates for particular components from the CAagentctl - Agent related commands
agent create
- Create a new agent configuration (cluster secret for now)agent list
- List all configured agents (cluster secrets for now)agent inspect
- Inspect a particular agent's configurationagent print-tls
- Print TLS configuration of agentagent reconfigure
- Reconfigure certain aspects of an agentChecklist