|
| 1 | +{{ if .Values.npDiscovery.enabled }} |
| 2 | +{{- $npDiscoveryConfig := (merge (dict "name" "np-discovery" "module" "np-discovery") .) -}} |
| 3 | +apiVersion: apps/v1 |
| 4 | +kind: Deployment |
| 5 | +metadata: |
| 6 | + labels: |
| 7 | + {{- include "fluidos.labels" $npDiscoveryConfig | nindent 4 }} |
| 8 | + name: np-fluidos-discovery |
| 9 | + namespace: {{ .Release.Namespace }} |
| 10 | +spec: |
| 11 | + replicas: 1 |
| 12 | + selector: |
| 13 | + matchLabels: |
| 14 | + {{- include "fluidos.labels" $npDiscoveryConfig | nindent 6 }} |
| 15 | + template: |
| 16 | + metadata: |
| 17 | + {{ if .Values.rearController.pod.annotations }} |
| 18 | + annotations: |
| 19 | + {{- toYaml .Values.rearController.pod.annotations | nindent 8 }} |
| 20 | + {{ end }} |
| 21 | + labels: |
| 22 | + {{- include "fluidos.labels" $npDiscoveryConfig | nindent 8 }} |
| 23 | + {{ if .Values.rearController.pod.labels }} |
| 24 | + {{ toYaml .Values.rearController.pod.labels | nindent 8 }} |
| 25 | + {{ end }} |
| 26 | + spec: |
| 27 | + {{- if gt .Values.rearController.replicas 1.0 }} |
| 28 | + affinity: |
| 29 | + podAntiAffinity: |
| 30 | + preferredDuringSchedulingIgnoredDuringExecution: |
| 31 | + - weight: 100 |
| 32 | + podAffinityTerm: |
| 33 | + labelSelector: |
| 34 | + matchLabels: |
| 35 | + {{- include "fluidos.labels" $npDiscoveryConfig | nindent 18 }} |
| 36 | + topologyKey: kubernetes.io/hostname |
| 37 | + {{- end }} |
| 38 | + securityContext: |
| 39 | + {{- include "fluidos.podSecurityContext" $npDiscoveryConfig | nindent 8 }} |
| 40 | + serviceAccountName: {{ include "fluidos.prefixedName" $npDiscoveryConfig }} |
| 41 | + containers: |
| 42 | + - image: {{ .Values.npDiscovery.imageName }} |
| 43 | + securityContext: |
| 44 | + {{- include "fluidos.containerSecurityContext" $npDiscoveryConfig | nindent 10 }} |
| 45 | + name: {{ .Values.npDiscovery.name }} |
| 46 | + resources: {{- toYaml .Values.rearController.pod.resources | nindent 10 }} |
| 47 | + env: |
| 48 | + - name: NP_BOOTSTRAP_URL |
| 49 | + value: {{ .Values.npDiscovery.np_bootstrap_url | quote }} |
| 50 | + {{- if (.Values.common).nodeSelector }} |
| 51 | + nodeSelector: |
| 52 | + {{- toYaml .Values.common.nodeSelector | nindent 8 }} |
| 53 | + {{- end }} |
| 54 | + {{- if ((.Values.common).tolerations) }} |
| 55 | + tolerations: |
| 56 | + {{- toYaml .Values.common.tolerations | nindent 8 }} |
| 57 | + {{- end }} |
| 58 | + {{- if ((.Values.common).affinity) }} |
| 59 | + affinity: |
| 60 | + {{- toYaml .Values.common.affinity | nindent 8 }} |
| 61 | + {{- end }} |
| 62 | +{{- end }} |
0 commit comments