spec:
volumeMounts:
- name: git-secret
mountPath: /root/.ssh/id_ed25519
subPath: git-secret
volumes:
- name: git-secret
secret:
secretName: git-secret
items:
- key: git-secret
path: git-secret
+ git clone ssh://git@<gitlab-url>:2222/test.git -b master
Cloning into 'manifest'...
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for '/root/.ssh/id_ed25519' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
Load key "/root/.ssh/id_ed25519": bad permissions
git@<gitlab-url>: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
默认权限是644 要改为600
volumes:
- name: git-secret
secret:
secretName: git-secret
items:
- key: git-secret
path: git-secret
defaultMode: 0600