Skip to content

Commit

Permalink
Merge branch 'master' into feature/agent-indexmanager/add-save-index-…
Browse files Browse the repository at this point in the history
…daemon
  • Loading branch information
Yusuke Kato authored May 18, 2020
2 parents 6f344ca + e1d42bc commit 58041dc
Show file tree
Hide file tree
Showing 25 changed files with 86 additions and 3 deletions.
4 changes: 4 additions & 0 deletions charts/vald/templates/agent/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ spec:
{{- $initContainers := dict "initContainers" .Values.agent.initContainers "Values" .Values "namespace" .Release.Namespace -}}
{{- include "vald.initContainers" $initContainers | trim | nindent 8 }}
{{- end }}
affinity:
{{- include "vald.affinity" .Values.agent.affinity | nindent 8 }}
topologySpreadConstraints:
{{- toYaml .Values.agent.topologySpreadConstraints | nindent 8 }}
containers:
- name: {{ .Values.agent.name }}
image: "{{ .Values.agent.image.repository }}:{{ default .Values.defaults.image.tag .Values.agent.image.tag }}"
Expand Down
2 changes: 2 additions & 0 deletions charts/vald/templates/agent/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ spec:
{{- end }}
affinity:
{{- include "vald.affinity" .Values.agent.affinity | nindent 8 }}
topologySpreadConstraints:
{{- toYaml .Values.agent.topologySpreadConstraints | nindent 8 }}
containers:
- name: {{ .Values.agent.name }}
image: "{{ .Values.agent.image.repository }}:{{ default .Values.defaults.image.tag .Values.agent.image.tag }}"
Expand Down
2 changes: 2 additions & 0 deletions charts/vald/templates/agent/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ spec:
{{- end }}
affinity:
{{- include "vald.affinity" .Values.agent.affinity | nindent 8 }}
topologySpreadConstraints:
{{- toYaml .Values.agent.topologySpreadConstraints | nindent 8 }}
containers:
- name: {{ .Values.agent.name }}
image: "{{ .Values.agent.image.repository }}:{{ default .Values.defaults.image.tag .Values.agent.image.tag }}"
Expand Down
4 changes: 4 additions & 0 deletions charts/vald/templates/discoverer/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ spec:
{{- $initContainers := dict "initContainers" .Values.discoverer.initContainers "Values" .Values "namespace" .Release.Namespace -}}
{{- include "vald.initContainers" $initContainers | trim | nindent 8 }}
{{- end }}
affinity:
{{- include "vald.affinity" .Values.discoverer.affinity | nindent 8 }}
topologySpreadConstraints:
{{- toYaml .Values.discoverer.topologySpreadConstraints | nindent 8 }}
containers:
- name: {{ .Values.discoverer.name }}
image: "{{ .Values.discoverer.image.repository }}:{{ default .Values.defaults.image.tag .Values.discoverer.image.tag }}"
Expand Down
2 changes: 2 additions & 0 deletions charts/vald/templates/discoverer/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ spec:
{{- end }}
affinity:
{{- include "vald.affinity" .Values.discoverer.affinity | nindent 8 }}
topologySpreadConstraints:
{{- toYaml .Values.discoverer.topologySpreadConstraints | nindent 8 }}
containers:
- name: {{ .Values.discoverer.name }}
image: "{{ .Values.discoverer.image.repository }}:{{ default .Values.defaults.image.tag .Values.discoverer.image.tag }}"
Expand Down
4 changes: 4 additions & 0 deletions charts/vald/templates/gateway/vald/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ spec:
{{- $initContainers := dict "initContainers" .Values.gateway.initContainers "Values" .Values "namespace" .Release.Namespace -}}
{{- include "vald.initContainers" $initContainers | trim | nindent 8 }}
{{- end }}
affinity:
{{- include "vald.affinity" .Values.gateway.affinity | nindent 8 }}
topologySpreadConstraints:
{{- toYaml .Values.gateway.topologySpreadConstraints | nindent 8 }}
containers:
- name: {{ .Values.gateway.name }}
image: "{{ .Values.gateway.image.repository }}:{{ default .Values.defaults.image.tag .Values.gateway.image.tag }}"
Expand Down
2 changes: 2 additions & 0 deletions charts/vald/templates/gateway/vald/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ spec:
{{- end }}
affinity:
{{- include "vald.affinity" .Values.gateway.affinity | nindent 8 }}
topologySpreadConstraints:
{{- toYaml .Values.gateway.topologySpreadConstraints | nindent 8 }}
containers:
- name: {{ .Values.gateway.name }}
image: "{{ .Values.gateway.image.repository }}:{{ default .Values.defaults.image.tag .Values.gateway.image.tag }}"
Expand Down
4 changes: 4 additions & 0 deletions charts/vald/templates/manager/backup/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ spec:
{{- $initContainers := dict "initContainers" .Values.backupManager.initContainers "Values" .Values "namespace" .Release.Namespace -}}
{{- include "vald.initContainers" $initContainers | trim | nindent 8 }}
{{- end }}
affinity:
{{- include "vald.affinity" .Values.backupManager.affinity | nindent 8 }}
topologySpreadConstraints:
{{- toYaml .Values.backupManager.topologySpreadConstraints | nindent 8 }}
containers:
- name: {{ .Values.backupManager.name }}
image: "{{ .Values.backupManager.image.repository }}:{{ default .Values.defaults.image.tag .Values.backupManager.image.tag }}"
Expand Down
2 changes: 2 additions & 0 deletions charts/vald/templates/manager/backup/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ spec:
{{- end }}
affinity:
{{- include "vald.affinity" .Values.backupManager.affinity | nindent 8 }}
topologySpreadConstraints:
{{- toYaml .Values.backupManager.topologySpreadConstraints | nindent 8 }}
containers:
- name: {{ .Values.backupManager.name }}
image: "{{ .Values.backupManager.image.repository }}:{{ default .Values.defaults.image.tag .Values.backupManager.image.tag }}"
Expand Down
4 changes: 4 additions & 0 deletions charts/vald/templates/manager/compressor/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ spec:
{{- $initContainers := dict "initContainers" .Values.compressor.initContainers "Values" .Values "namespace" .Release.Namespace -}}
{{- include "vald.initContainers" $initContainers | trim | nindent 8 }}
{{- end }}
affinity:
{{- include "vald.affinity" .Values.compressor.affinity | nindent 8 }}
topologySpreadConstraints:
{{- toYaml .Values.compressor.topologySpreadConstraints | nindent 8 }}
containers:
- name: {{ .Values.compressor.name }}
image: "{{ .Values.compressor.image.repository }}:{{ default .Values.defaults.image.tag .Values.compressor.image.tag }}"
Expand Down
2 changes: 2 additions & 0 deletions charts/vald/templates/manager/compressor/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ spec:
{{- end }}
affinity:
{{- include "vald.affinity" .Values.compressor.affinity | nindent 8 }}
topologySpreadConstraints:
{{- toYaml .Values.compressor.topologySpreadConstraints | nindent 8 }}
containers:
- name: {{ .Values.compressor.name }}
image: "{{ .Values.compressor.image.repository }}:{{ default .Values.defaults.image.tag .Values.compressor.image.tag }}"
Expand Down
4 changes: 4 additions & 0 deletions charts/vald/templates/manager/index/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ spec:
{{- $initContainers := dict "initContainers" .Values.indexManager.initContainers "Values" .Values "namespace" .Release.Namespace -}}
{{- include "vald.initContainers" $initContainers | trim | nindent 8 }}
{{- end }}
affinity:
{{- include "vald.affinity" .Values.indexManager.affinity | nindent 8 }}
topologySpreadConstraints:
{{- toYaml .Values.indexManager.topologySpreadConstraints | nindent 8 }}
containers:
- name: {{ .Values.indexManager.name }}
image: "{{ .Values.indexManager.image.repository }}:{{ default .Values.defaults.image.tag .Values.indexManager.image.tag }}"
Expand Down
2 changes: 2 additions & 0 deletions charts/vald/templates/manager/index/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ spec:
{{- end }}
affinity:
{{- include "vald.affinity" .Values.indexManager.affinity | nindent 8 }}
topologySpreadConstraints:
{{- toYaml .Values.indexManager.topologySpreadConstraints | nindent 8 }}
containers:
- name: {{ .Values.indexManager.name }}
image: "{{ .Values.indexManager.image.repository }}:{{ default .Values.defaults.image.tag .Values.indexManager.image.tag }}"
Expand Down
4 changes: 4 additions & 0 deletions charts/vald/templates/meta/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ spec:
{{- $initContainers := dict "initContainers" .Values.meta.initContainers "Values" .Values "namespace" .Release.Namespace -}}
{{- include "vald.initContainers" $initContainers | trim | nindent 8 }}
{{- end }}
affinity:
{{- include "vald.affinity" .Values.meta.affinity | nindent 8 }}
topologySpreadConstraints:
{{- toYaml .Values.meta.topologySpreadConstraints | nindent 8 }}
containers:
- name: {{ .Values.meta.name }}
image: "{{ .Values.meta.image.repository }}:{{ default .Values.defaults.image.tag .Values.meta.image.tag }}"
Expand Down
2 changes: 2 additions & 0 deletions charts/vald/templates/meta/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ spec:
{{- end }}
affinity:
{{- include "vald.affinity" .Values.meta.affinity | nindent 8 }}
topologySpreadConstraints:
{{- toYaml .Values.meta.topologySpreadConstraints | nindent 8 }}
containers:
- name: {{ .Values.meta.name }}
image: "{{ .Values.meta.image.repository }}:{{ default .Values.defaults.image.tag .Values.meta.image.tag }}"
Expand Down
14 changes: 14 additions & 0 deletions charts/vald/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,8 @@ gateway:
- vald-gateway
# gateway.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution -- pod anti-affinity required scheduling terms
requiredDuringSchedulingIgnoredDuringExecution: []
# gateway.topologySpreadConstraints -- topology spread constraints of gateway pods
topologySpreadConstraints: []
# gateway.server_config -- server config (overrides defaults.server_config)
server_config:
servers:
Expand Down Expand Up @@ -715,6 +717,8 @@ agent:
- vald-agent-ngt
# agent.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution -- pod anti-affinity required scheduling terms
requiredDuringSchedulingIgnoredDuringExecution: []
# agent.topologySpreadConstraints -- topology spread constraints for agent pods
topologySpreadConstraints: []
# agent.server_config -- server config (overrides defaults.server_config)
server_config:
servers:
Expand Down Expand Up @@ -869,6 +873,8 @@ discoverer:
- vald-discoverer
# discoverer.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution -- pod anti-affinity required scheduling terms
requiredDuringSchedulingIgnoredDuringExecution: []
# discoverer.topologySpreadConstraints -- topology spread constraints of discoverer pods
topologySpreadConstraints: []
# discoverer.server_config -- server config (overrides defaults.server_config)
server_config:
servers:
Expand Down Expand Up @@ -1013,6 +1019,8 @@ compressor:
preferredDuringSchedulingIgnoredDuringExecution: []
# compressor.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution -- pod anti-affinity required scheduling terms
requiredDuringSchedulingIgnoredDuringExecution: []
# compressor.topologySpreadConstraints -- topology spread constraints of compressor pods
topologySpreadConstraints: []
# compressor.server_config -- server config (overrides defaults.server_config)
server_config:
servers:
Expand Down Expand Up @@ -1209,6 +1217,8 @@ backupManager:
preferredDuringSchedulingIgnoredDuringExecution: []
# backupManager.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution -- pod anti-affinity required scheduling terms
requiredDuringSchedulingIgnoredDuringExecution: []
# backupManager.topologySpreadConstraints -- topology spread constraints of backup manager pods
topologySpreadConstraints: []
# backupManager.server_config -- server config (overrides defaults.server_config)
server_config:
servers:
Expand Down Expand Up @@ -1506,6 +1516,8 @@ indexManager:
preferredDuringSchedulingIgnoredDuringExecution: []
# indexManager.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution -- pod anti-affinity required scheduling terms
requiredDuringSchedulingIgnoredDuringExecution: []
# indexManager.topologySpreadConstraints -- topology spread constraints of index manager pods
topologySpreadConstraints: []
# indexManager.server_config -- server config (overrides defaults.server_config)
server_config:
servers:
Expand Down Expand Up @@ -1699,6 +1711,8 @@ meta:
preferredDuringSchedulingIgnoredDuringExecution: []
# meta.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution -- pod anti-affinity required scheduling terms
requiredDuringSchedulingIgnoredDuringExecution: []
# meta.topologySpreadConstraints -- topology spread constraints of meta pods
topologySpreadConstraints: []
# meta.server_config -- server config (overrides defaults.server_config)
server_config:
servers:
Expand Down
22 changes: 20 additions & 2 deletions docs/guides/configurations.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,10 @@ Pod priorities are also useful for saving agent pods from eviction.
By default, very high priority is set to agent pods in the Chart.


#### Pod anti-affinity
#### Pod scheduling

It is recommended to schedule agent pods on different nodes as much as possible.
To achieve this, the following podAntiAffinity is set by default.
To achieve this, the following [podAntiAffinity][k8s-affinity-antiaffinity] is set by default.

```yaml
agent:
Expand All @@ -218,6 +218,22 @@ agent:
- vald-agent-ngt
```

It can be also achieved by using [pod topology spread constraints][k8s-topology-spread-constraints].

```yaml
agent:
topologySpreadConstraints:
- topologyKey: node
maxSkew: 1
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels:
app: vald-agent-ngt
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution: [] # to disable default settings
```

### Gateway

#### Ingress
Expand Down Expand Up @@ -399,5 +415,7 @@ For further details, there are references of Helm values in GitHub Vald reposito
[google-pprof]: https://github.com/google/pprof
[prometheus-io]: https://prometheus.io/
[k8s-liveness-readiness]: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/
[k8s-affinity-antiaffinity]: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity
[k8s-topology-spread-constraints]: https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/
[yj-ngt]: https://github.com/yahoojapan/NGT
[yj-ngt-wiki]: https://github.com/yahoojapan/NGT/wiki
2 changes: 1 addition & 1 deletion example/helm/values-scylla.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ agent:
# The number of dimensions for feature vector of fashion-mnist dataset.
dimension: 784
# We use L2-Norm for distance_type.
distance_type: 12
distance_type: l2
# the type of fashion-mnist's feature vectors.
object_type: float

Expand Down
1 change: 1 addition & 0 deletions k8s/agent/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ spec:
topologyKey: kubernetes.io/hostname
weight: 100
requiredDuringSchedulingIgnoredDuringExecution: []
topologySpreadConstraints: []
containers:
- name: vald-agent-ngt
image: "vdaas/vald-agent-ngt:nightly"
Expand Down
1 change: 1 addition & 0 deletions k8s/discoverer/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ spec:
topologyKey: kubernetes.io/hostname
weight: 100
requiredDuringSchedulingIgnoredDuringExecution: []
topologySpreadConstraints: []
containers:
- name: vald-discoverer
image: "vdaas/vald-discoverer-k8s:nightly"
Expand Down
1 change: 1 addition & 0 deletions k8s/gateway/vald/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ spec:
topologyKey: kubernetes.io/hostname
weight: 100
requiredDuringSchedulingIgnoredDuringExecution: []
topologySpreadConstraints: []
containers:
- name: vald-gateway
image: "vdaas/vald-gateway:nightly"
Expand Down
1 change: 1 addition & 0 deletions k8s/manager/backup/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ spec:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution: []
requiredDuringSchedulingIgnoredDuringExecution: []
topologySpreadConstraints: []
containers:
- name: vald-manager-backup
image: "vdaas/vald-manager-backup-mysql:nightly"
Expand Down
1 change: 1 addition & 0 deletions k8s/manager/compressor/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ spec:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution: []
requiredDuringSchedulingIgnoredDuringExecution: []
topologySpreadConstraints: []
containers:
- name: vald-manager-compressor
image: "vdaas/vald-manager-compressor:nightly"
Expand Down
1 change: 1 addition & 0 deletions k8s/manager/index/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ spec:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution: []
requiredDuringSchedulingIgnoredDuringExecution: []
topologySpreadConstraints: []
containers:
- name: vald-manager-index
image: "vdaas/vald-manager-index:nightly"
Expand Down
1 change: 1 addition & 0 deletions k8s/meta/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ spec:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution: []
requiredDuringSchedulingIgnoredDuringExecution: []
topologySpreadConstraints: []
containers:
- name: vald-meta
image: "vdaas/vald-meta-redis:nightly"
Expand Down

0 comments on commit 58041dc

Please sign in to comment.