Advertisement
supermaca

#192 Mount PVC webserver.yml

Apr 4th, 2023
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 KB | None | 0 0
  1. #192 Mount PVC
  2. apiVersion: apps/v1
  3. kind: Deployment
  4. metadata:
  5. name: mywebserver
  6. labels:
  7. app: httpd
  8. spec:
  9. replicas: 5 # Number of replicas to start with
  10. strategy:
  11. type: RollingUpdate # Type of update strategy
  12. rollingUpdate: # Rolling update strategy configuration
  13. maxSurge: 1 # Maximum number of pods that can be created immediately
  14. maxUnavailable: 2 # Maximum number of old pods that can be killed immediately
  15. selector:
  16. matchLabels:
  17. app: httpd
  18. template:
  19. metadata:
  20. labels:
  21. app: httpd
  22. spec:
  23. containers:
  24. - name: myhttpd
  25. image: httpd:2
  26. ports:
  27. - containerPort: 80
  28. volumeMounts:
  29. - name: demovol # Mount the "demovol" volume
  30. mountPath: /data
  31. - name: demo-configmap-vol #(copy from line 38) Mount the "demo-configmap-vol" volume
  32. mountPath: /etc/config
  33. - name: my-secret #mount it copy name from l42
  34. mountPath: /etc/mysecrets
  35. - name: demo-pvc # Mount it just like any other volume
  36. # which path on the container should be mounted
  37. mountPath: /data/clustervol
  38. volumes:
  39. - name: demovol # Define the "demovol" volume
  40. hostPath:
  41. path: /data
  42. type: Directory
  43. - name: demo-configmap-vol # Define the "demo-configmap-vol" volume
  44. configMap:
  45. name: demo-configmap # Mount the "demo-configmap" config map to the volume
  46. - name: my-secret
  47. secret:
  48. secretName: demo-secret # name: demo-secret en 188-secrets.yml
  49. - name: demo-pvc
  50. persistentVolumeClaim:
  51. claimName: demo-pvc #name used in demo-persistent-volume-claim yml
  52.  
  53.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement