Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature - Add nodeSelector, affinity and tolerations to daemonset and deployment templates #456

Merged
merged 5 commits into from
Dec 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deployments/helm-chart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: nginx-ingress
version: 0.2.0
version: 0.3.0
appVersion: edge
description: NGINX Ingress Controller
sources:
Expand Down
3 changes: 2 additions & 1 deletion deployments/helm-chart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ Parameter | Description | Default
`controller.defaultTLS.secret` | The secret with a TLS certificate and key for the default HTTPS server. The value must follow the following format: `<namespace>/<name>`. Used as an alternative to specifiying a certifcate and key using `controller.defaultTLS.cert` and `controller.defaultTLS.key` parameters. | None
`controller.nodeSelector` | The node selector for pod assignment for the Ingress controller pods. | { }
`controller.terminationGracePeriodSeconds` | The termination grace period of the Ingress controller pod. | 30
`controller.tolerations` | The tolerations required for the IBM Cloud Private installation. | None
`controller.tolerations` | The tolerations of the Ingress controller pods. | []
`controller.affinity` | The affinity of the Ingress controller pods. | { }
`controller.replicaCount` | The number of replicas of the Ingress controller deployment. | 1
`controller.service.create` | Creates a service to expose the Ingress controller pods. | true
`controller.service.type` | The type of service to create for the Ingress controller. | LoadBalancer
Expand Down
12 changes: 6 additions & 6 deletions deployments/helm-chart/templates/controller-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ spec:
nodeSelector:
{{ toYaml .Values.controller.nodeSelector | indent 8 }}
{{- end }}
{{- if eq .Values.controller.tolerations "icp" }}
{{- if .Values.controller.tolerations }}
tolerations:
- key: "dedicated"
operator: "Exists"
effect: "NoSchedule"
- key: "CriticalAddonsOnly"
operator: "Exists"
{{ toYaml .Values.controller.tolerations | indent 6 }}
{{- end }}
{{- if .Values.controller.affinity }}
affinity:
{{ toYaml .Values.controller.affinity | indent 8 }}
{{- end }}
hostNetwork: {{ .Values.controller.hostNetwork }}
containers:
Expand Down
12 changes: 12 additions & 0 deletions deployments/helm-chart/templates/controller-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@ spec:
prometheus.io/port: "{{ .Values.prometheus.port }}"
{{- end }}
spec:
{{- if .Values.controller.nodeSelector }}
nodeSelector:
{{ toYaml .Values.controller.nodeSelector | indent 8 }}
{{- end }}
{{- if .Values.controller.tolerations }}
tolerations:
{{ toYaml .Values.controller.tolerations | indent 6 }}
{{- end }}
{{- if .Values.controller.affinity }}
affinity:
{{ toYaml .Values.controller.affinity | indent 8 }}
{{- end }}
serviceAccountName: {{ .Values.controller.serviceAccount.name }}
hostNetwork: {{ .Values.controller.hostNetwork }}
containers:
Expand Down
12 changes: 9 additions & 3 deletions deployments/helm-chart/values-icp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ controller:
image:
repository: mycluster.icp:8500/kube-system/nginx-plus-ingress
tag: "edge"
nodeSelector: { beta.kubernetes.io/arch: "amd64",
proxy: "true" }
nodeSelector:
beta.kubernetes.io/arch: "amd64"
proxy: true
terminationGracePeriodSeconds: 60
tolerations: "icp"
tolerations:
- key: "dedicated"
operator: "Exists"
effect: "NoSchedule"
- key: "CriticalAddonsOnly"
operator: "Exists"
3 changes: 2 additions & 1 deletion deployments/helm-chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ controller:
# secret: <namespace>/<secret_name>
nodeSelector: {}
terminationGracePeriodSeconds: 30
tolerations: ""
tolerations: []
affinity: {}
replicaCount: 1
ingressClass: nginx
useIngressClassOnly: false
Expand Down