Skip to content

Commit

Permalink
Make deployment strategy of hyades services configurable (#162)
Browse files Browse the repository at this point in the history
For Kafka consumers, it can be desirable to *not* do `RollingUpdate`s in order to prevent repetetive rebalances. Since those services are not user-facing anyway, there's no downtime involved in following a `Recreate` strategy instead.

Signed-off-by: nscuro <[email protected]>
  • Loading branch information
nscuro authored Sep 25, 2024
1 parent 3d70639 commit df9faec
Show file tree
Hide file tree
Showing 8 changed files with 86 additions and 0 deletions.
1 change: 1 addition & 0 deletions charts/hyades/templates/api-server/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ metadata:
labels: {{- include "hyades.apiServerLabels" . | nindent 4 }}
spec:
replicas: {{ .Values.apiServer.replicaCount }}
strategy: {{- toYaml .Values.apiServer.deployment.strategy | nindent 4 }}
selector:
matchLabels: {{- include "hyades.apiServerSelectorLabels" . | nindent 6 }}
template:
Expand Down
1 change: 1 addition & 0 deletions charts/hyades/templates/frontend/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ metadata:
labels: {{- include "hyades.frontendLabels" . | nindent 4 }}
spec:
replicas: {{ .Values.frontend.replicaCount }}
strategy: {{- toYaml .Values.frontend.deployment.strategy | nindent 4 }}
selector:
matchLabels: {{- include "hyades.frontendSelectorLabels" . | nindent 6 }}
template:
Expand Down
1 change: 1 addition & 0 deletions charts/hyades/templates/mirror-service/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ metadata:
labels: {{- include "hyades.mirrorServiceLabels" . | nindent 4 }}
spec:
replicas: {{ .Values.mirrorService.replicaCount }}
strategy: {{- toYaml .Values.mirrorService.deployment.strategy | nindent 4 }}
selector:
matchLabels: {{- include "hyades.mirrorServiceSelectorLabels" . | nindent 6 }}
template:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ metadata:
labels: {{- include "hyades.notificationPublisherLabels" . | nindent 4 }}
spec:
replicas: {{ .Values.notificationPublisher.replicaCount }}
strategy: {{- toYaml .Values.notificationPublisher.deployment.strategy | nindent 4 }}
selector:
matchLabels: {{- include "hyades.notificationPublisherSelectorLabels" . | nindent 6 }}
template:
Expand Down
1 change: 1 addition & 0 deletions charts/hyades/templates/repo-meta-analyzer/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ metadata:
labels: {{- include "hyades.repoMetaAnalyzerLabels" . | nindent 4 }}
spec:
replicas: {{ .Values.repoMetaAnalyzer.replicaCount }}
strategy: {{- toYaml .Values.repoMetaAnalyzer.deployment.strategy | nindent 4 }}
selector:
matchLabels: {{- include "hyades.repoMetaAnalyzerSelectorLabels" . | nindent 6 }}
template:
Expand Down
1 change: 1 addition & 0 deletions charts/hyades/templates/vuln-analyzer/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ metadata:
labels: {{- include "hyades.vulnAnalyzerLabels" . | nindent 4 }}
spec:
replicas: {{ .Values.vulnAnalyzer.replicaCount }}
strategy: {{- toYaml .Values.vulnAnalyzer.deployment.strategy | nindent 4 }}
selector:
matchLabels: {{- include "hyades.vulnAnalyzerSelectorLabels" . | nindent 6 }}
template:
Expand Down
48 changes: 48 additions & 0 deletions charts/hyades/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,14 @@
"replicaCount": {
"type": "integer"
},
"deployment": {
"type": "object",
"properties": {
"strategy": {
"type": "object"
}
}
},
"annotations": {
"type": "object"
},
Expand Down Expand Up @@ -213,6 +221,14 @@
"replicaCount": {
"type": "number"
},
"deployment": {
"type": "object",
"properties": {
"strategy": {
"type": "object"
}
}
},
"annotations": {
"type": "object"
},
Expand Down Expand Up @@ -283,6 +299,14 @@
"minimum": 0,
"maximum": 1
},
"deployment": {
"type": "object",
"properties": {
"strategy": {
"type": "object"
}
}
},
"annotations": {
"type": "object"
},
Expand Down Expand Up @@ -345,6 +369,14 @@
"replicaCount": {
"type": "integer"
},
"deployment": {
"type": "object",
"properties": {
"strategy": {
"type": "object"
}
}
},
"annotations": {
"type": "object"
},
Expand Down Expand Up @@ -407,6 +439,14 @@
"replicaCount": {
"type": "integer"
},
"deployment": {
"type": "object",
"properties": {
"strategy": {
"type": "object"
}
}
},
"annotations": {
"type": "object"
},
Expand Down Expand Up @@ -472,6 +512,14 @@
"replicaCount": {
"type": "integer"
},
"deployment": {
"type": "object",
"properties": {
"strategy": {
"type": "object"
}
}
},
"annotations": {
"type": "object"
},
Expand Down
32 changes: 32 additions & 0 deletions charts/hyades/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ apiServer:
# -- Whether the API server shall be deployed.
enabled: true
replicaCount: 1
deployment:
# -- The deployment strategy to use.
strategy:
type: RollingUpdate
annotations: {}
image: &apiServerImage
# -- Override common.image.registry for the API server.
Expand Down Expand Up @@ -158,6 +162,10 @@ frontend:
# -- Whether the frontend shall be deployed.
enabled: true
replicaCount: 1
deployment:
# -- The deployment strategy to use.
strategy:
type: RollingUpdate
annotations: {}
image:
# -- Override common.image.registry for the API frontend.
Expand Down Expand Up @@ -222,6 +230,12 @@ mirrorService:
enabled: true
# -- Number of replicas. Should be <= 1.
replicaCount: 1
deployment:
# -- The deployment strategy to use. `Recreate` is recommended because the service
# does not serve user-traffic, and `RollingUpdate` will cause undesired
# Kafka consumer rebalances.
strategy:
type: Recreate
annotations: {}
image:
# -- Override common.image.registry for the mirror service.
Expand Down Expand Up @@ -270,6 +284,12 @@ notificationPublisher:
# -- Whether the notification publisher shall be deployed.
enabled: true
replicaCount: 1
deployment:
# -- The deployment strategy to use. `Recreate` is recommended because the service
# does not serve user-traffic, and `RollingUpdate` will cause undesired
# Kafka consumer rebalances.
strategy:
type: Recreate
annotations: {}
image:
# -- Override common.image.registry for the notification publisher.
Expand Down Expand Up @@ -319,6 +339,12 @@ repoMetaAnalyzer:
enabled: true
annotations: {}
replicaCount: 1
deployment:
# -- The deployment strategy to use. `Recreate` is recommended because the service
# does not serve user-traffic, and `RollingUpdate` will cause undesired
# Kafka consumer rebalances.
strategy:
type: Recreate
image:
# -- Override common.image.registry for the repository metadata analyzer.
registry: ""
Expand Down Expand Up @@ -372,6 +398,12 @@ vulnAnalyzer:
useStatefulSet: false
annotations: {}
replicaCount: 1
deployment:
# -- The deployment strategy to use. `Recreate` is recommended because the service
# does not serve user-traffic, and `RollingUpdate` will cause undesired
# Kafka consumer rebalances.
strategy:
type: Recreate
image:
# -- Override common.image.registry for the vulnerability analyzer.
registry: ""
Expand Down

0 comments on commit df9faec

Please sign in to comment.