Skip to content

Commit

Permalink
Merge pull request #766 from MetaCell/feature/CH-147
Browse files Browse the repository at this point in the history
CH-137 Add namespace to usesvolume labels and pod affinity selectors
  • Loading branch information
filippomc authored Sep 10, 2024
2 parents 8ca94f8 + b972e82 commit f8bf3b2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions deployment-configuration/helm/templates/auto-database.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ metadata:
name: {{ .app.harness.database.name | quote }}
namespace: {{ .root.Values.namespace }}
labels:
usesvolume: {{ .app.harness.database.name }}
usesvolume: {{ .app.harness.database.name }}-{{ .root.Values.namespace }}
spec:
replicas: 1
selector:
Expand All @@ -43,7 +43,7 @@ spec:
labels:
app: {{ .app.harness.database.name | quote }}
service: db
usesvolume: {{ .app.harness.database.name }}
usesvolume: {{ .app.harness.database.name }}-{{ .root.Values.namespace }}
spec:
affinity:
podAffinity:
Expand All @@ -53,7 +53,8 @@ spec:
- key: usesvolume
operator: In
values:
- {{ .app.harness.database.name }}
- {{ .app.harness.database.name }}-{{ .root.Values.namespace }}
- {{ .app.harness.database.name }} # Obsolete, kept for backwards compatability, to be removed at a later date
topologyKey: "kubernetes.io/hostname"
containers:
- name: {{ .app.harness.database.name | quote }}
Expand Down
7 changes: 4 additions & 3 deletions deployment-configuration/helm/templates/auto-deployments.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
labels:
app: {{ .app.harness.deployment.name| quote }}
{{- if .app.harness.deployment.volume }}
usesvolume: {{ .app.harness.deployment.volume.name }}
usesvolume: {{ .app.harness.deployment.volume.name }}-{{ .root.Values.namespace }}
{{- end }}
{{- include "deploy_utils.labels" .root | indent 4 }}
spec:
Expand All @@ -26,7 +26,7 @@ spec:
labels:
app: {{ .app.harness.deployment.name| quote }}
{{- if .app.harness.deployment.volume }}
usesvolume: {{ .app.harness.deployment.volume.name }}
usesvolume: {{ .app.harness.deployment.volume.name }}-{{ .root.Values.namespace }}
{{- end }}
{{- include "deploy_utils.labels" .root | indent 8 }}
spec:
Expand All @@ -44,7 +44,8 @@ spec:
- key: usesvolume
operator: In
values:
- {{ .app.harness.deployment.volume.name }}
- {{ .app.harness.deployment.volume.name }}-{{ .root.Values.namespace }}
- {{ .app.harness.deployment.volume.name }} # Obsolete, kept for backwards compatability, to be removed at a later date
topologyKey: "kubernetes.io/hostname"
{{- end }}
{{- end }}
Expand Down

0 comments on commit f8bf3b2

Please sign in to comment.