Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
Merge pull request #138 from kangshung/feature/affinity
Browse files Browse the repository at this point in the history
Add affinity support for NiFi
  • Loading branch information
banzo authored May 28, 2021
2 parents 2e40d72 + f38d88f commit e179ede
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
apiVersion: v2
name: nifi
version: 0.7.1
version: 0.7.2
appVersion: 1.12.1
description: Apache NiFi is a software project from the Apache Software Foundation designed to automate the flow of data between software systems.
keywords:
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ The following table lists the configurable parameters of the nifi chart and the
| `resources` | Pod resource requests and limits for logs | `{}` |
| **logResources** |
| `logresources.` | Pod resource requests and limits | `{}` |
| **affinity** |
| `affinity` | Pod affinity scheduling rules | `{}` |
| **nodeSelector** |
| `nodeSelector` | Node labels for pod assignment | `{}` |
| **terminationGracePeriodSeconds** |
Expand Down
10 changes: 7 additions & 3 deletions templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ spec:
dnsPolicy: ClusterFirstWithHostNet
{{- end }}
serviceAccountName: {{ include "apache-nifi.serviceAccountName" . }}
{{- if eq .Values.sts.AntiAffinity "hard"}}
{{- if eq .Values.sts.AntiAffinity "hard" }}
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
Expand All @@ -47,7 +47,7 @@ spec:
values:
- {{ include "apache-nifi.name" . | quote }}
topologyKey: "kubernetes.io/hostname"
{{- else if eq .Values.sts.AntiAffinity "soft"}}
{{- else if eq .Values.sts.AntiAffinity "soft" }}
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
Expand All @@ -60,7 +60,11 @@ spec:
values:
- {{ include "apache-nifi.name" . | quote }}
topologyKey: "kubernetes.io/hostname"
{{- end}}
{{- end }}
{{- if and .Values.affinity (and (ne .Values.sts.AntiAffinity "hard") (ne .Values.sts.AntiAffinity "soft")) }}
affinity:
{{ toYaml .Values.affinity | indent 8 }}
{{- end }}
{{- if .Values.terminationGracePeriodSeconds }}
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
{{- end }}
Expand Down
4 changes: 4 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,10 @@ logresources:
cpu: 50m
memory: 50Mi

## Enables setting your own affinity. Mutually exclusive with sts.AntiAffinity
## You need to set the value of sts.AntiAffinity other than "soft" and "hard"
affinity: {}

nodeSelector: {}

tolerations: []
Expand Down

0 comments on commit e179ede

Please sign in to comment.