Node'un diskine erişmek için, kök yol /'i hedefleyen bir HostPath volume'u olan yeni bir Pod oluşturun.
HostPath volume'u olan bir Pod oluşturmak
sleep-with-hostpath.yaml Pod spec'inde bir HostPath volume'u kullanır.
Pod'u dağıtın:
kubectl apply -f labs/persistentvolumes/solution
Pod container'ı, node'un diskinin kökünü container içindeki /node-root'a mount eder ve root olarak çalışır.
Bu, diskte hemen hemen her şeyi yapabileceğiniz anlamına gelir:
kubectl exec pod/sleep -- ls /node-root
kubectl exec pod/sleep -- mkdir -p /node-root/secret/hacker/tools
kubectl exec pod/sleep -- ls -l /node-root/secret/hacker
Güvenli olmamasının sebebi bu :) Node'un diskine erişmeniz gerekiyorsa, tüm kök sürücü yerine daha kısıtlayıcı kapsamlı bir hostPath kullanmalısınız.
Alıştırmalara geri dön.