(fix) Fix crashloop on chown
- Currently the start.sh script is crashlooping because it is attempting to chown files and failing due to a read-only filesystem. Rather than mounting the files in place directly, they can be copied in the container and permissions and ownership set. Change-Id: I1da93dd7c177c027457c640a4254357f29c97a5b
This commit is contained in:
parent
eb73ba58b5
commit
8805637db5
|
@ -19,10 +19,18 @@ set -ex
|
||||||
# show env
|
# show env
|
||||||
env > /tmp/env
|
env > /tmp/env
|
||||||
|
|
||||||
if [[ -d ~maas/.ssh ]]
|
# MAAS must be able to ssh to libvirt hypervisors
|
||||||
|
# to control VMs
|
||||||
|
|
||||||
|
if [[ -d ~maas/keys ]]
|
||||||
then
|
then
|
||||||
|
mkdir -p ~maas/.ssh
|
||||||
|
cp ~maas/keys/* ~maas/.ssh/
|
||||||
chown -R maas:maas ~maas/.ssh
|
chown -R maas:maas ~maas/.ssh
|
||||||
|
chmod 700 ~maas/.ssh
|
||||||
|
chmod 600 ~maas/.ssh/*
|
||||||
fi
|
fi
|
||||||
|
|
||||||
chsh -s /bin/bash maas
|
chsh -s /bin/bash maas
|
||||||
|
|
||||||
exec /bin/systemd --system
|
exec /bin/systemd --system
|
||||||
|
|
|
@ -89,10 +89,10 @@ spec:
|
||||||
readOnly: true
|
readOnly: true
|
||||||
{{- if .Values.manifests.secret_ssh_key }}
|
{{- if .Values.manifests.secret_ssh_key }}
|
||||||
- name: maas-ssh
|
- name: maas-ssh
|
||||||
mountPath: /var/lib/maas/.ssh
|
mountPath: /var/lib/maas/keys
|
||||||
- name: priv-key
|
- name: priv-key
|
||||||
subPath: PRIVATE_KEY
|
subPath: PRIVATE_KEY
|
||||||
mountPath: /var/lib/maas/.ssh/id_rsa
|
mountPath: /var/lib/maas/keys/id_rsa
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{ if $mounts_maas_rack.volumeMounts }}{{ toYaml $mounts_maas_rack.volumeMounts | indent 12 }}{{ end }}
|
{{ if $mounts_maas_rack.volumeMounts }}{{ toYaml $mounts_maas_rack.volumeMounts | indent 12 }}{{ end }}
|
||||||
volumes:
|
volumes:
|
||||||
|
|
Loading…
Reference in New Issue