-
Notifications
You must be signed in to change notification settings - Fork 42
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
Add ssh access to VMs #352
Add ssh access to VMs #352
Conversation
ad0c989
to
9a3e059
Compare
7d8d5e3
to
5e6cfc3
Compare
Quoting from the PR description:
I would suggest to update the |
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.
Thanks @claudious96. At a first sight, this PR seems very good!
A couple of comments with regard to your notes (and a few very minor inline):
- Tenant resources are not namespaced
scope: Cluster - Totally agree about using the keys from a secret and not statically generate them in the docker
- From my point of view, both generating the configuration using RUN and using an external file is fine. In the first case, you could use only one echo instruction instead of multiples.
- Fine to have a separate manifest with the cluster role (makes it easier to apply the others from the CI)
- Yes, it would be nice to have a bit of templating for the namespace, image version and so on
log.Info("reconciling bastion") | ||
|
||
// Get tenants resources | ||
var list crownlabsalpha1.TenantList |
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.
var list crownlabsalpha1.TenantList | |
var tenants crownlabsalpha1.TenantList |
Just a proposal, to make the code more readable
Thanks for the input @frisso , I've just tested the case (updated the keys on an existing Tenant resource) and the |
5e6cfc3
to
849f1d4
Compare
@giorio94 I updated the PR with your suggestions. The manifest can now be generated like the lab operator, setting desired values, then exporting the envs and substituting them in the template. In case of using the default namespace the result of the kubectl apply is I wrote some instructions in the README inside the I have also updated the var you suggested in the bastion controller and the message in |
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.
/lgtm
Just a couple of minor comments inline.
Could you also add the bastion-operator
to this list in order to automatically generate the Docker images?
CrownLabs/.github/workflows/build.yml
Lines 91 to 94 in 31092a7
matrix: | |
component: | |
- laboratory-operator | |
- crownlabs-image-list |
849f1d4
to
dfc872f
Compare
dfc872f
to
c022938
Compare
de5245b
to
d4ad3b4
Compare
d4ad3b4
to
609b945
Compare
40b00fe
to
2731453
Compare
add bastion dockerfile and bastion-operator tenant's public keys injection to vms with cloud-init tests with ginkgo docs
2731453
to
e66a4dd
Compare
/merge |
Your staging environment has been correctly teared-down! |
Description
This PR presents a possible implementation of an SSH bastion using a sidecar approach. Each pod is composed of an ssh-bastion running sshd and a sidecar operator that whatches the Tenant resource updating the
authorized_keys
file at each tenant related event (creation/deletion/update of a Tenant resource).Currently the operator gets a
List
of Tenants in the default namespace, this is good for testing but probably should be managed differently.Assuming that a single deployment would manage all incoming ssh incoming traffic for the whole crownlabs cluster, since the Tenant resource could belong to one or more workspaces, a possible approach could be:
authorized_keys
fileOtherwise if the plan is to deploy it per workspace, the operator could just perform the
List
on the related workspace and the operator should be modified in order to be aware of the workspace (namespace might be useful).Notes: