api-deployment.yaml 3.81 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "nomad.fullname" . }}-api
  labels:
    app.kubernetes.io/name: {{ include "nomad.name" . }}-api
    helm.sh/chart: {{ include "nomad.chart" . }}
    app.kubernetes.io/instance: {{ .Release.Name }}
    app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
  replicas: {{ .Values.api.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/name: {{ include "nomad.name" . }}-api
      app.kubernetes.io/instance: {{ .Release.Name }}
  template:
    metadata:
      labels:
        app.kubernetes.io/name: {{ include "nomad.name" . }}-api
        app.kubernetes.io/instance: {{ .Release.Name }}
    spec:
      containers:
      - name: {{ include "nomad.name" . }}-api
        image: "{{ .Values.images.nomad.name }}:{{ .Values.images.nomad.tag }}"
        volumeMounts:
26
        - mountPath: /app/.volumes/fs/public
27
          name: files-volume
28
29
        - mountPath: /nomad
          name: nomad-volume
30
        env:
31
32
        - name: NOMAD_FILES_TMP_DIR
          value: "{{ .Values.volumes.tmp }}"
33
34
        - name: NOMAD_SERVICE
          value: "api"
35
36
        - name: NOMAD_RELEASE
          value: "{{ .Release.Name }}"
37
        - name: NOMAD_LOGSTASH_HOST
38
          value: "{{ .Values.logstash.host }}"
39
        - name: NOMAD_LOGSTASH_TCPPORT
40
          value: "{{ .Values.logstash.port }}"
41
        - name: NOMAD_CONSOLE_LOGLEVEL
42
          value: "{{ .Values.api.console_loglevel }}"
43
        - name: NOMAD_LOGSTASH_LEVEL
44
          value: "{{ .Values.api.logstash_loglevel }}"
45
46
        - name: NOMAD_API_HOST
          value: "{{ .Values.proxy.external.host }}"
47
        - name: NOMAD_API_PORT
48
49
          value: "{{ .Values.proxy.external.port }}"
        - name: NOMAD_API_BASE_PATH
50
          value: "{{ .Values.proxy.external.path }}/api"
51
        - name: NOMAD_API_SECRET
52
          value: "{{ .Values.api.secret }}"
53
54
55
56
        - name: NOMAD_API_ADMIN_PASSWORD
          value: "{{ .Values.api.adminPassword }}"
        - name: NOMAD_API_DISABLE_RESET
          value: "{{ .Values.api.disableReset }}"
57
58
59
60
61
62
63
        - name: NOMAD_RABBITMQ_HOST
          value: "{{ .Release.Name }}-rabbitmq"
        - name: NOMAD_ELASTIC_HOST
          value: "{{ .Values.elastic.host }}"
        - name: NOMAD_ELASTIC_PORT
          value: "{{ .Values.elastic.port }}"
        - name: NOMAD_ELASTIC_INDEX_NAME
64
          value: "{{ .Values.dbname }}"
65
66
67
68
69
        - name: NOMAD_MONGO_HOST
          value: "{{ .Values.mongo.host }}"
        - name: NOMAD_MONGO_PORT
          value: "{{ .Values.mongo.port }}"
        - name: NOMAD_MONGO_DB_NAME
70
          value: "{{ .Values.dbname }}"
71
72
73
74
75
        - name: NOMAD_COE_REPO_DB_HOST
          value: "{{ .Values.postgres.host }}"
        - name: NOMAD_COE_REPO_DB_PORT
          value: "{{ .Values.postgres.port }}"
        - name: NOMAD_COE_REPO_DB_NAME
76
          value: "{{ .Values.dbname }}"
77
78
        - name: NOMAD_CELERY_ROUTING
          value: "worker"
79
        command: ["python", "-m", "gunicorn.app.wsgiapp", "--timeout", "3600", "--log-config", "ops/gunicorn.log.conf", "-w", "{{ .Values.api.worker }}", "-b 0.0.0.0:8000", "nomad.api:app"]
80
81
        livenessProbe:
          httpGet:
82
            path: "{{ .Values.proxy.external.path }}/api/alive"
83
84
85
86
87
            port: 8000
          initialDelaySeconds: 15
          periodSeconds: 15
        readinessProbe:
          httpGet:
88
            path: "{{ .Values.proxy.external.path }}/api/alive"
89
90
91
            port: 8000
          initialDelaySeconds: 5
          periodSeconds: 5
92
93
      nodeSelector:
        nomadtype: public
94
95
      imagePullSecrets:
      - name: {{ .Values.images.secret }}
96
      imagePullPolicy: always
97
98
99
100
101
      volumes:
      - name: files-volume
        hostPath:
          path: {{ .Values.volumes.files }}
          type: Directory
102
103
104
105
      - name: nomad-volume
        hostPath:
          path: {{ .Values.volumes.nomad }}
          type: Directory