-
Notifications
You must be signed in to change notification settings - Fork 56
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
Rework VirtualMachine, introduce cloudinit and sshKeys configuration, fix externalPorts #303
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -63,6 +63,7 @@ spec: | |||||||||
#cloud-config | ||||||||||
ssh_pwauth: {{ if .Values.sshPwauth | default false }}True{{ else }}False{{ end }} | ||||||||||
disable_root: {{ if .Values.disableRoot | default false }}True{{ else }}False{{ end }} | ||||||||||
user: {{ .Values.user }} | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's make these parameterns optional:
Suggested change
Or we can simple map |
||||||||||
password: {{ .Values.password }} | ||||||||||
chpasswd: { expire: {{ if .Values.chpasswdExpire | default false }}True{{ else }}False{{ end }} } | ||||||||||
ssh_authorized_keys: | ||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
## @param resources.disk The size of the disk allocated for the virtual machine | ||
## @param sshPwauth Enable password authentication for SSH. If set to `true`, users can log in using a password | ||
## @param disableRoot Disable root login via SSH. If set to `true`, root login will be disabled | ||
## @param user The username to be used for the virtual machine. Default is `username` | ||
## @param password The default password for the virtual machine | ||
## @param chpasswdExpire Set whether the password should expire | ||
## @param sshKeys List of SSH public keys for authentication. Can be a single key or a list of keys | ||
|
@@ -23,6 +24,7 @@ resources: | |
disk: 5Gi | ||
sshPwauth: true | ||
disableRoot: true | ||
user: username | ||
password: hackme | ||
chpasswdExpire: false | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do you think about using common There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is that what you mean?
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It might be better to pass all cloud-init configuration as a string: cloudInitUserConfig: |
#cloud-config
ssh_pwauth: true
disable_root: true
user: username due to fact user configuration have no formalized spec, it can include multiple header, scripts and even jinja2 templates variuos vendors can define their own format for this, eg. Talos Linux allows to write machine-config in user-data This config should be saved into external secret and included with secretRef into KubeVirt VM: - name: cloudinitdisk
cloudInitNoCloud:
secretRef:
name: my-vmi-secret As about sshKeys, cloud-init defines formalized spec for this in meta-data: KubeVirt allows to specify them as accessCredentials:
- sshPublicKey:
source:
secret:
secretName: my-pub-key
propagationMethod:
noCloud: {} details: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What difference would it make? We'd have to create a secret anyway. |
||
sshKeys: | ||
|
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.
Does it really makes sense?