aboutsummaryrefslogtreecommitdiffstats
path: root/kubernetes/namespaces/databases/mongodb/deployment.yaml
blob: 8df4ebbd98a7337e078be70194d360ef760fee05 (plain) (blame)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
apiVersion: apps/v1
kind: Deployment
metadata:
  name: mongodb
  namespace: databases
spec:
  replicas: 1
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app: mongodb
  template:
    metadata:
      labels:
        app: mongodb
    spec:
      containers:
        - name: mongodb
          image: mongo:4.4
          imagePullPolicy: Always
          ports:
            - containerPort: 27017
          resources:
            requests:
              cpu: 100m
              memory: 300Mi
            limits:
              cpu: 200m
              memory: 500Mi
          volumeMounts:
            - mountPath: /data/db
              name: mongodb-volume
            - mountPath: /tmp
              name: mongo-temp
          envFrom:
          - secretRef:
              name: mongo-credentials
          securityContext:
            readOnlyRootFilesystem: true
      volumes:
        - name: mongodb-volume
          persistentVolumeClaim:
            claimName: mongodb-storage
        - name: mongo-temp
          emptyDir:
            medium: Memory