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