api-deployment.yaml 3.62 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
26
27
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:
        - mountPath: /app/.volumes/fs
          name: files-volume
28
29
        - mountPath: /nomad
          name: nomad-volume
30
31
32
        env:
        - name: NOMAD_SERVICE
          value: "api"
33
34
        - name: NOMAD_RELEASE
          value: "{{ .Release.Name }}"
35
        - name: NOMAD_LOGSTASH_HOST
36
          value: "{{ .Values.logstash.host }}"
37
        - name: NOMAD_LOGSTASH_TCPPORT
38
          value: "{{ .Values.logstash.port }}"
39
        - name: NOMAD_CONSOLE_LOGLEVEL
40
          value: "{{ .Values.api.console_loglevel }}"
41
        - name: NOMAD_LOGSTASH_LEVEL
42
          value: "{{ .Values.api.logstash_loglevel }}"
43
44
        - name: NOMAD_API_HOST
          value: "{{ .Values.proxy.external.host }}"
45
        - name: NOMAD_API_PORT
46
47
          value: "{{ .Values.proxy.external.port }}"
        - name: NOMAD_API_BASE_PATH
48
          value: "{{ .Values.proxy.external.path }}/api"
49
        - name: NOMAD_API_SECRET
50
          value: "{{ .Values.api.secret }}"
51
52
53
54
        - name: NOMAD_API_ADMIN_PASSWORD
          value: "{{ .Values.api.adminPassword }}"
        - name: NOMAD_API_DISABLE_RESET
          value: "{{ .Values.api.disableReset }}"
55
56
57
58
59
60
61
        - 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
62
          value: "{{ .Values.dbname }}"
63
64
65
66
67
        - name: NOMAD_MONGO_HOST
          value: "{{ .Values.mongo.host }}"
        - name: NOMAD_MONGO_PORT
          value: "{{ .Values.mongo.port }}"
        - name: NOMAD_MONGO_DB_NAME
68
          value: "{{ .Values.dbname }}"
69
70
71
72
73
        - 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
74
          value: "{{ .Values.dbname }}"
75
        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"]
76
77
        livenessProbe:
          httpGet:
78
            path: "{{ .Values.proxy.external.path }}/api/alive"
79
80
81
82
83
            port: 8000
          initialDelaySeconds: 15
          periodSeconds: 15
        readinessProbe:
          httpGet:
84
            path: "{{ .Values.proxy.external.path }}/api/alive"
85
86
87
            port: 8000
          initialDelaySeconds: 5
          periodSeconds: 5
88
89
      imagePullSecrets:
      - name: {{ .Values.images.secret }}
90
      imagePullPolicy: always
91
92
93
94
95
      volumes:
      - name: files-volume
        hostPath:
          path: {{ .Values.volumes.files }}
          type: Directory
96
97
98
99
      - name: nomad-volume
        hostPath:
          path: {{ .Values.volumes.nomad }}
          type: Directory