Bu lab henuz cevrilmedi - Ingilizce surumu gosteriliyor.
Bu lab modernize edildi ama ucтan uca dogrulanmadi. Takilirsaniz bize bildirin.
StatefulSets
Lab Solution
You need to define a StatefulSet - the spec is very similar to the Deployment, but you need a Service and you'll replace the emptyDir volume with a mount and a volumeClaimTemplate:
- solution/service.yaml - headless Service for the StatefulSet
- solution/statefulset.yaml - StatefulSet with PVC template and parallel management policy
You'll need to remove your Deployment before you create the StatefulSet:
kubectl delete deploy simple-proxy
kubectl apply -f labs/statefulsets/solutionWatch the Pods - these are created in parallel:
kubectl get po -l app=simple-proxy --watch
# Ctrl-C when the Pods are running
kubectl get pvc -l app=simple-proxyEach Pod has a PVC, which is mounted into the
/cachefolder
Try the proxy:
curl -v localhost:8040
# OR
curl -v localhost:30040Repeat and you'll see
X-Cache: HITin the response headers
The cache is in the volume for each Pod:
kubectl exec simple-proxy-0 -- ls /cache
kubectl exec simple-proxy-1 -- ls /cacheBack to the exercises.