Fix SSH permissions via init container copy
This commit is contained in:
@@ -19,15 +19,26 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
serviceAccountName: clawd-sa
|
serviceAccountName: clawd-sa
|
||||||
initContainers:
|
initContainers:
|
||||||
- name: volume-permissions
|
- name: setup-ssh
|
||||||
image: docker.io/alpine:latest
|
image: docker.io/alpine:latest
|
||||||
command:
|
command:
|
||||||
- sh
|
- sh
|
||||||
- -c
|
- -c
|
||||||
- "chown -R 1000:0 /data && chmod -R 775 /data"
|
- |
|
||||||
|
# 1. Fix data volume permissions
|
||||||
|
chown -R 1000:0 /data && chmod -R 775 /data
|
||||||
|
|
||||||
|
# 2. Setup writable SSH tirectory from Secret
|
||||||
|
cp /mnt/keys/authorized_keys /working-ssh/
|
||||||
|
chown 1000:0 /working-ssh/authorized_keys
|
||||||
|
chmod 600 /working-ssh/authorized_keys
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: data-volume
|
- name: data-volume
|
||||||
mountPath: /data
|
mountPath: /data
|
||||||
|
- name: ssh-keys-secret
|
||||||
|
mountPath: /mnt/keys
|
||||||
|
- name: ssh-working
|
||||||
|
mountPath: /working-ssh
|
||||||
containers:
|
containers:
|
||||||
- name: clawdbox
|
- name: clawdbox
|
||||||
image: default-route-openshift-image-registry.apps.lab.apilab.us/clawdbox/clawdbox:latest
|
image: default-route-openshift-image-registry.apps.lab.apilab.us/clawdbox/clawdbox:latest
|
||||||
@@ -39,7 +50,7 @@ spec:
|
|||||||
- mountPath: /data
|
- mountPath: /data
|
||||||
name: data-volume
|
name: data-volume
|
||||||
- mountPath: /home/claw/.ssh
|
- mountPath: /home/claw/.ssh
|
||||||
name: ssh-keys
|
name: ssh-working
|
||||||
resources:
|
resources:
|
||||||
limits:
|
limits:
|
||||||
memory: "2Gi"
|
memory: "2Gi"
|
||||||
@@ -58,7 +69,9 @@ spec:
|
|||||||
- name: data-volume
|
- name: data-volume
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
claimName: clawdbox-pvc
|
claimName: clawdbox-pvc
|
||||||
- name: ssh-keys
|
- name: ssh-keys-secret
|
||||||
secret:
|
secret:
|
||||||
secretName: clawdbox-ssh-keys
|
secretName: clawdbox-ssh-keys
|
||||||
defaultMode: 0600
|
defaultMode: 0600
|
||||||
|
- name: ssh-working
|
||||||
|
emptyDir: {}
|
||||||
Reference in New Issue
Block a user