mirror of
https://github.com/wahyd4/charts.git
synced 2026-08-22 03:25:53 +10:00
[bitnami/nginx] Add 'nodeSelector', 'affinity' and 'tolerations' support
Signed-off-by: juan131 <juan@bitnami.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
apiVersion: v1
|
||||
name: nginx
|
||||
version: 4.1.2
|
||||
version: 4.2.0
|
||||
appVersion: 1.16.0
|
||||
description: Chart for the nginx server
|
||||
keywords:
|
||||
|
||||
@@ -55,6 +55,11 @@ The following tables lists the configurable parameters of the NGINX Open Source
|
||||
| `fullnameOverride` | String to fully override nginx.fullname template with a string | `nil` |
|
||||
| `serverBlock` | Custom NGINX server block | `nil` |
|
||||
| `podAnnotations` | Pod annotations | `{}` |
|
||||
| `nodeAffinity` | Node Affinity rules for pod assignment. The value is evaluated as a template | `{}` |
|
||||
| `podAffinity` | Affinity rules for pod assignment. The value is evaluated as a template | `{}` |
|
||||
| `podAntiAffinity` | Anti-Affinity rules for pod assignment. Allowed values: `soft` and `hard` | `soft` |
|
||||
| `nodeSelector` | Node labels for pod assignment. The value is evaluated as a template | `{}` |
|
||||
| `tolerations` | Tolerations for pod assignment. The value is evaluated as a template | `{}` |
|
||||
| `metrics.enabled` | Start a side-car prometheus exporter | `false` |
|
||||
| `metrics.image.registry` | Promethus exporter image registry | `docker.io` |
|
||||
| `metrics.image.repository` | Promethus exporter image name | `bitnami/nginx-exporter` |
|
||||
|
||||
@@ -1,3 +1,35 @@
|
||||
Get the NGINX URL:
|
||||
|
||||
{{- if .Values.ingress.enabled }}
|
||||
|
||||
You should be able to access your new NGINX installation through
|
||||
|
||||
{{- range .Values.ingress.hosts }}
|
||||
{{ if .tls }}https{{ else }}http{{ end }}://{{ .name }}
|
||||
{{- end }}
|
||||
|
||||
{{- else if contains "LoadBalancer" .Values.service.type }}
|
||||
{{- $port:=.Values.service.port | toString }}
|
||||
|
||||
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
|
||||
Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "nginx.fullname" . }}'
|
||||
|
||||
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "nginx.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
|
||||
echo "NGINX URL: http://$SERVICE_IP{{- if ne $port "80" }}:{{ .Values.service.port }}{{ end }}/"
|
||||
|
||||
{{- else if contains "ClusterIP" .Values.service.type }}
|
||||
|
||||
echo "NGINX URL: http://127.0.0.1:8080/"
|
||||
kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "nginx.fullname" . }} 8080:{{ .Values.service.port }}
|
||||
|
||||
{{- else if contains "NodePort" .Values.service.type }}
|
||||
|
||||
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "nginx.fullname" . }})
|
||||
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
|
||||
echo "NGINX URL: http://$NODE_IP:$NODE_PORT/"
|
||||
|
||||
{{- end }}
|
||||
|
||||
{{- if and (contains "bitnami/" .Values.image.repository) (not (.Values.image.tag | toString | regexFind "-r\\d+$|sha256:")) }}
|
||||
|
||||
WARNING: Rolling tag detected ({{ .Values.image.repository }}:{{ .Values.image.tag }}), please note that it is strongly recommended to avoid using rolling tags in a production environment.
|
||||
|
||||
@@ -30,6 +30,38 @@ spec:
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
spec:
|
||||
affinity:
|
||||
{{- with .Values.nodeAffinity }}
|
||||
nodeAffinity: {{ tpl (toYaml .) $ | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- with .Values.podAffinity }}
|
||||
podAffinity: {{ tpl (toYaml .) $ | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- if eq .Values.podAntiAffinity "hard" }}
|
||||
podAntiAffinity:
|
||||
requiredDuringSchedulingIgnoredDuringExecution:
|
||||
- topologyKey: "kubernetes.io/hostname"
|
||||
labelSelector:
|
||||
matchLabels:
|
||||
app: {{ template "nginx.fullname" . }}
|
||||
release: "{{ .Release.Name }}"
|
||||
{{- else if eq .Values.podAntiAffinity "soft" }}
|
||||
podAntiAffinity:
|
||||
preferredDuringSchedulingIgnoredDuringExecution:
|
||||
- weight: 1
|
||||
podAffinityTerm:
|
||||
topologyKey: "kubernetes.io/hostname"
|
||||
labelSelector:
|
||||
matchLabels:
|
||||
app: {{ template "nginx.fullname" . }}
|
||||
release: "{{ .Release.Name }}"
|
||||
{{- end }}
|
||||
{{- with .Values.nodeSelector }}
|
||||
nodeSelector: {{ tpl (toYaml .) $ | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.tolerations }}
|
||||
tolerations: {{ tpl (toYaml .) $ | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- include "nginx.imagePullSecrets" . | indent 6 }}
|
||||
containers:
|
||||
- name: nginx
|
||||
|
||||
@@ -144,6 +144,28 @@ readinessProbe:
|
||||
##
|
||||
podAnnotations: {}
|
||||
|
||||
## Node Affinity. The value is evaluated as a template.
|
||||
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#node-affinity-beta-feature
|
||||
##
|
||||
nodeAffinity: {}
|
||||
## Pod Affinity. The value is evaluated as a template.
|
||||
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
|
||||
##
|
||||
podAffinity: {}
|
||||
## Pod AntiAffinity
|
||||
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
|
||||
##
|
||||
podAntiAffinity: soft
|
||||
|
||||
## Node labels for pod assignment. The value is evaluated as a template.
|
||||
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector
|
||||
##
|
||||
nodeSelector: {}
|
||||
## Tolerations for pod assignment. The value is evaluated as a template.
|
||||
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#taints-and-tolerations-beta-feature
|
||||
##
|
||||
tolerations: {}
|
||||
|
||||
## Resource requests and limits
|
||||
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
|
||||
##
|
||||
|
||||
Reference in New Issue
Block a user