kubectl config view
~~> rien
cp .../gX-YY.kubeconfig ~/.kube/config
kubectl config view
~~> user gX-YY (with token)
namespace gX-YY
cluster https://kube.enib.fr:6443 (with CA certificate)
kubectl get persistentvolumeclaims
~~> storage
alpine.yaml
~~~~~~~~~~~
apiVersion: apps/v1
kind: Deployment
metadata:
name: alpine-dpl
namespace: g1-01-ns
spec:
replicas: 1
selector:
matchLabels:
app: alpine
template:
metadata:
labels:
app: alpine
spec:
terminationGracePeriodSeconds: 1
containers:
- name: alpine
image: alpine
command: ["/bin/sh", "-c", "while true ; do sleep 2 ; done"]
volumeMounts:
- mountPath: /mnt
name: storage-mount
volumes:
- name: storage-mount
persistentVolumeClaim:
claimName: storage
kubectl apply -f alpine.yaml
kubectl get deployments
kubectl get pods
kubectl exec pod/alpine-dpl-79b767fcdc-5xzw2 -it -- sh
df -h / /mnt
echo 'File 1' >/root/file1.txt
echo 'File 2' >/mnt/file2.txt
kubectl delete pod/alpine-dpl-79b767fcdc-5xzw2
kubectl get pods
~~> nouveau pod recréé
kubectl exec pod/alpine-dpl-6fd895c947-xswrf -it -- ls -la /root /mnt
~~> /root perdu, /mnt conservé
FIXME: BLABLA