Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions deploy/helm_charts/mixer/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ spec:
type: RollingUpdate
rollingUpdate:
# maximum number of Pods that can be created over the desired number of Pods
# 25% of default pods (+1 in case default < 4)
maxSurge: {{ $group.maxSurge | default (div $group.replicas 4 | add 1) }}
# Set to 1 to reduce resource overhead during deployment
maxSurge: 1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Hardcoding maxSurge to 1 removes the ability to customize the rollout strategy per service group and environment. This change ignores existing configurations such as maxSurge: 0 in deploy/helm_charts/envs/mixer_staging.yaml. Additionally, for large deployments (e.g., the recon group with 90 replicas in production), a maxSurge of 1 will significantly slow down the rollout process as it only creates one new pod at a time. It is recommended to use 1 as a default while still allowing overrides from values.yaml.

      # Set to 1 to reduce resource overhead during deployment, but allow overrides.
      maxSurge: {{ $group.maxSurge | default 1 }}
References
  1. For mixer container deployments, configuration keys can be added to the base values.yaml file to provide default values that are then overridden by environment-specific files.

# Maximum number of pods that can be unavailable during the update process
# 25% of default pods (+1 in case default < 4)
maxUnavailable: {{ div $group.replicas 4 | add 1 }}
Expand All @@ -60,6 +60,24 @@ spec:
nodeSelector:
cloud.google.com/gke-nodepool: {{ $group.nodePool }}
{{- end }}
{{- if $group.enableAntiAffinity }}
# Soft pod anti-affinity at the node level.
# Encourages the scheduler to place each replica of this service on a distinct node.
# This is a soft rule, so if there are not enough nodes, the scheduler will schedule pods
# on the same node rather than letting them get stuck in a Pending state.
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: service
operator: In
values:
- {{ include "mixer.fullname" $ }}-{{ $serviceName }}
topologyKey: "kubernetes.io/hostname"
{{- end}}
serviceAccountName: {{ $.Values.serviceAccount.name }}
volumes:
- name: schema-mapping
Expand Down
6 changes: 6 additions & 0 deletions deploy/helm_charts/mixer/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,7 @@ serviceGroups:
resources:
memoryRequest: "8G"
memoryLimit: "8G"
cpuRequest: "100m"
cacheSVG: true
# If the name of the recon service is changed here,
# please also change the name in the deployment.yaml template.
Expand All @@ -448,6 +449,7 @@ serviceGroups:
resources:
memoryRequest: "2G"
memoryLimit: "2G"
cpuRequest: "100m"
observation:
urlPaths:
- "/bulk/stats"
Expand All @@ -459,6 +461,8 @@ serviceGroups:
resources:
memoryRequest: "4G"
memoryLimit: "8G"
cpuRequest: "1"
enableAntiAffinity: true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Pod anti-affinity is currently only enabled for the observation group. Given that other service groups like recon and node also have a high number of replicas in production (90 and 60 respectively), it is recommended to enable anti-affinity for them as well. This ensures that replicas are spread across different nodes, improving the service's resilience to node failures.

References
  1. Configuration keys for mixer deployments can be added to the base values.yaml file to establish default behaviors across environments.

node:
urlPaths:
- "/node/*"
Expand All @@ -473,6 +477,7 @@ serviceGroups:
resources:
memoryRequest: "8G"
memoryLimit: "8G"
cpuRequest: "500m"
cacheSVG: true
default:
urlPaths:
Expand All @@ -481,3 +486,4 @@ serviceGroups:
resources:
memoryRequest: "2G"
memoryLimit: "2G"
cpuRequest: "100m"
Loading