-
Notifications
You must be signed in to change notification settings - Fork 29
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
Remote Agent Part1: bootstrap #622
base: remote-agent
Are you sure you want to change the base?
Remote Agent Part1: bootstrap #622
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved this change as long as the file conflict is resolved. I still have comments, please take a look and fix in next improvement PR.
// Set the spec fields | ||
spec := map[string]interface{}{ | ||
"secretName": secretName, | ||
"duration": "2160h", // 90 days |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make these two values configurable.
target, err := c.TargetsManager.GetState(ctx, id, namespace) | ||
if err != nil { | ||
tLog.InfofCtx(ctx, "V (Targets) : onBootstrap target %s in namespace %s not found", id, namespace) | ||
err := json.Unmarshal(request.Body, &target) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
User new JsonUnmarshal function.
}) | ||
} | ||
var topology model.TopologySpec | ||
json.Unmarshal(request.Body, &topology) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New Json unmarshal function
assert.NotNil(t, authResponse.AccessToken) | ||
assert.Equal(t, "Bearer", authResponse.TokenType) | ||
} | ||
// func TestTargetsOnBootstrap(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove or modify?
} | ||
fs := &fasthttp.FS{ | ||
Root: "/", // Directory to serve files from | ||
IndexNames: []string{"index.html"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this file?
key: "tls.crt" | ||
|
||
- inLine: | | ||
-----BEGIN CERTIFICATE----- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we keep this inline?
echo "private.pem" | ||
echo "remote-agent" | ||
|
||
./remote-agent -config=$config -client-cert=./public.pem -client-key=./private.pem -target-name=$target_name -namespace=$namespace -topology=$topology |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
run as a service.
@@ -0,0 +1,21 @@ | |||
-----BEGIN CERTIFICATE----- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I doubt you cannot have this file checked in, especially when we backport this to extension repo.
Bootstrap changes are :
Symphony control plane side to enable cert based authentication
Symphony control plane side to trust specific CAs
Symphony control plane side to trust specific subjectNames
Symphony control plane side to have a file server to download agent
Agent side to call file server to download symphony agent
Agent side to call bootstrap endpoint
The bootstrap would exchange bootstrap certificate for working certificate. The bootstrap certificate now is pre-defined. (I randomly created a self-signed CA from cert manager and issued one client cert)
The bootstrap script would do this and start the agent. (we have a task to run the agent as a service)
The agent would use the topology.json to render the providers for it. And the http binding in remote agent serves purely as a client.