|
| 1 | +apiVersion: apps/v1 |
| 2 | +kind: Deployment |
| 3 | +metadata: |
| 4 | + name: {{ .Chart.Name }} |
| 5 | + namespace: kube-system |
| 6 | + labels: |
| 7 | + {{- include "node-agent.labels" . | nindent 4 }} |
| 8 | +spec: |
| 9 | + {{- if not .Values.autoscaling.enabled }} |
| 10 | + replicas: {{ .Values.replicaCount }} |
| 11 | + {{- end }} |
| 12 | + selector: |
| 13 | + matchLabels: |
| 14 | + {{- include "node-agent.selectorLabels" . | nindent 6 }} |
| 15 | + template: |
| 16 | + metadata: |
| 17 | + {{- with .Values.podAnnotations }} |
| 18 | + annotations: |
| 19 | + {{- toYaml . | nindent 8 }} |
| 20 | + {{- end }} |
| 21 | + labels: |
| 22 | + {{- include "node-agent.labels" . | nindent 8 }} |
| 23 | + {{- with .Values.podLabels }} |
| 24 | + {{- toYaml . | nindent 8 }} |
| 25 | + {{- end }} |
| 26 | + spec: |
| 27 | + {{- with .Values.imagePullSecrets }} |
| 28 | + imagePullSecrets: |
| 29 | + {{- toYaml . | nindent 8 }} |
| 30 | + {{- end }} |
| 31 | + serviceAccountName: {{ include "node-agent.serviceAccountName" . }} |
| 32 | + {{- with .Values.podSecurityContext }} |
| 33 | + securityContext: |
| 34 | + {{- toYaml . | nindent 8 }} |
| 35 | + {{- end }} |
| 36 | + containers: |
| 37 | + - name: {{ .Chart.Name }} |
| 38 | + env: |
| 39 | + - name: CIVO_API_KEY |
| 40 | + valueFrom: |
| 41 | + secretKeyRef: |
| 42 | + name: civo-node-agent |
| 43 | + key: civo-api-key |
| 44 | + - name: CIVO_API_URL |
| 45 | + valueFrom: |
| 46 | + secretKeyRef: |
| 47 | + name: civo-api-access |
| 48 | + key: api-url |
| 49 | + - name: CIVO_CLUSTER_ID |
| 50 | + valueFrom: |
| 51 | + secretKeyRef: |
| 52 | + name: civo-api-access |
| 53 | + key: cluster-id |
| 54 | + - name: CIVO_REGION |
| 55 | + valueFrom: |
| 56 | + secretKeyRef: |
| 57 | + name: civo-api-access |
| 58 | + key: region |
| 59 | + - name: CIVO_NODE_POOL_ID |
| 60 | + valueFrom: |
| 61 | + secretKeyRef: |
| 62 | + name: civo-node-agent |
| 63 | + key: node-pool-id |
| 64 | + - name: CIVO_NODE_DESIRED_GPU_COUNT |
| 65 | + valueFrom: |
| 66 | + secretKeyRef: |
| 67 | + name: civo-node-agent |
| 68 | + key: desired-gpu-count |
| 69 | + {{- with .Values.securityContext }} |
| 70 | + securityContext: |
| 71 | + {{- toYaml . | nindent 12 }} |
| 72 | + {{- end }} |
| 73 | + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" |
| 74 | + imagePullPolicy: {{ .Values.image.pullPolicy }} |
| 75 | + {{- with .Values.resources }} |
| 76 | + resources: |
| 77 | + {{- toYaml . | nindent 12 }} |
| 78 | + {{- end }} |
| 79 | + {{- with .Values.volumeMounts }} |
| 80 | + volumeMounts: |
| 81 | + {{- toYaml . | nindent 12 }} |
| 82 | + {{- end }} |
| 83 | + {{- with .Values.volumes }} |
| 84 | + volumes: |
| 85 | + {{- toYaml . | nindent 8 }} |
| 86 | + {{- end }} |
| 87 | + {{- with .Values.nodeSelector }} |
| 88 | + nodeSelector: |
| 89 | + {{- toYaml . | nindent 8 }} |
| 90 | + {{- end }} |
| 91 | + {{- with .Values.affinity }} |
| 92 | + affinity: |
| 93 | + {{- toYaml . | nindent 8 }} |
| 94 | + {{- end }} |
| 95 | + {{- with .Values.tolerations }} |
| 96 | + tolerations: |
| 97 | + {{- toYaml . | nindent 8 }} |
| 98 | + {{- end }} |
| 99 | + |
| 100 | + |
0 commit comments