Advertisement
supermaca

webserver-186.yml

Mar 21st, 2023
521
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.29 KB | None | 0 0
  1. #186 config maps
  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.       volumes:
  34.         - name: demovol  # Define the "demovol" volume
  35.           hostPath:
  36.             path: /data
  37.             type: Directory
  38.         - name: demo-configmap-vol  # Define the "demo-configmap-vol" volume
  39.           configMap:
  40.             - name: demo-configmap  # Mount the "demo-configmap" config map to the volume
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement