Complete the code to specify the rolling update strategy type in a Kubernetes deployment.
strategy:
type: [1]The RollingUpdate strategy allows Kubernetes to update pods gradually without downtime.
Complete the code to set the maximum number of pods that can be unavailable during a rolling update.
strategy:
rollingUpdate:
maxUnavailable: [1]Setting maxUnavailable to 25% means up to 25% of pods can be down during the update.
Fix the error in the rolling update configuration by completing the missing field.
strategy:
rollingUpdate:
maxSurge: [1]The maxSurge field must be a positive integer or percentage. '2' is valid.
Fill both blanks to configure a rolling update with 1 max surge and 0 max unavailable pods.
strategy:
rollingUpdate:
maxSurge: [1]
maxUnavailable: [2]This configuration allows 1 extra pod during update and no pods unavailable.
Fill all three blanks to create a deployment spec with rolling update strategy, max surge 2, and max unavailable 25%.
apiVersion: apps/v1 kind: Deployment metadata: name: example-deployment spec: replicas: 3 strategy: type: [1] rollingUpdate: maxSurge: [2] maxUnavailable: [3]
This deployment uses the rolling update strategy with 2 extra pods allowed and 25% pods can be unavailable during update.