Skip to content

Commit

Permalink
Add support to custom affinity
Browse files Browse the repository at this point in the history
  • Loading branch information
mmadoo committed Nov 13, 2023
1 parent ccc0205 commit 6595ebf
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
7 changes: 4 additions & 3 deletions docs_src/tutorials/kubernetes.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ to be installed from the source code.
| `serviceMonitor.relabelings` | Allow to add extra labels to metrics | Add node metrics |

#### Other parameters
| Name | Description | Value |
| ------------------------------------------ | ----------------------------------------------------------------------------| ------------------------- |
| `tolerations` | Tolerations for pod assignment. Evaluated as a template. | `- operator: "Exists"` |
| Name | Description | Value |
| ------------------------------------------ | ------------------------------------------------------------------------------------------------| ------------------------- |
| `affinity` | Pod scheduling preference. Can be used for instance when some node does not support scaphandre. | `{}` |
| `tolerations` | Tolerations for pod assignment. Evaluated as a template. | `- operator: "Exists"` |

## Install Prometheus

Expand Down
4 changes: 4 additions & 0 deletions helm/scaphandre/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ spec:
runAsUser: {{ .Values.userID }}
runAsGroup: {{ .Values.userGroup }}
serviceAccountName: {{ template "scaphandre.name" . }}
affinity:
{{- with .Values.affinity }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
Expand Down
4 changes: 4 additions & 0 deletions helm/scaphandre/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ spec:
interval: {{ .Values.serviceMonitor.interval }}
{{- end }}
scrapeTimeout: {{ .Values.serviceMonitor.scrapeTimeout }}
{{- if .Values.serviceMonitor.relabelings }}
relabelings:
{{ toYaml .Values.serviceMonitor.relabelings | nindent 8 }}
{{- end }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
Expand Down
2 changes: 2 additions & 0 deletions helm/scaphandre/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ serviceMonitor:
- __meta_kubernetes_pod_node_name
targetLabel: node

affinity: {}

tolerations:
# Tolerate all taints for observability
- operator: "Exists"

0 comments on commit 6595ebf

Please sign in to comment.