mirror of
https://github.com/outbackdingo/cozystack.git
synced 2026-01-27 18:18:41 +00:00
34 lines
969 B
YAML
34 lines
969 B
YAML
{{- if .Values.sshKeys }}
|
|
---
|
|
apiVersion: v1
|
|
kind: Secret
|
|
metadata:
|
|
name: {{ include "virtual-machine.fullname" $ }}-ssh-keys
|
|
stringData:
|
|
{{- range $k, $v := .Values.sshKeys }}
|
|
key{{ $k }}: {{ quote $v }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- if or .Values.cloudInit .Values.sshKeys }}
|
|
---
|
|
apiVersion: v1
|
|
kind: Secret
|
|
metadata:
|
|
name: {{ include "virtual-machine.fullname" . }}-cloud-init
|
|
stringData:
|
|
userdata: |
|
|
{{- if .Values.cloudInit }}
|
|
{{- .Values.cloudInit | nindent 4 }}
|
|
{{- else if and (.Values.sshKeys) (not .Values.cloudInit) }}
|
|
{{- /*
|
|
We usually provide ssh keys in cloud-init metadata, because userdata it not typed and can be used for any purpose.
|
|
However, if user provides ssh keys but not cloud-init, we still need to provide a minimal cloud-init config to avoid errors.
|
|
*/}}
|
|
#cloud-config
|
|
ssh_authorized_keys:
|
|
{{- range .Values.sshKeys }}
|
|
- {{ quote . }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- end }}
|