summaryrefslogtreecommitdiff
path: root/f3s/ychat/helm-chart/templates/deployment.yaml
blob: 7879dcea34b8e629db147488302502199ac09702 (plain)
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
48
49
50
51
52
53
54
55
56
57
apiVersion: apps/v1
kind: Deployment
metadata:
  name: ychat
  namespace: services
spec:
  replicas: 1
  # Recreate: single-instance stateful-in-memory chat; avoid two pods racing
  # for the same Service while the old one drains its sessions.
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app: ychat
  template:
    metadata:
      labels:
        app: ychat
    spec:
      securityContext:
        runAsNonRoot: true
        runAsUser: 1000
        runAsGroup: 1000
        fsGroup: 1000
      containers:
        - name: ychat
          image: registry.lan.buetow.org:30001/ychat:2adb923
          imagePullPolicy: IfNotPresent
          securityContext:
            allowPrivilegeEscalation: false
            readOnlyRootFilesystem: true
            runAsNonRoot: true
            runAsUser: 1000
            runAsGroup: 1000
          ports:
            - containerPort: 2000
              name: http
          # No liveness/readiness probes: yChat segfaults on an empty TCP
          # open+close (a TCP-socket probe would kill it). It serves real HTTP
          # requests fine, and kubelet restarts the pod if the process exits.
          resources:
            requests:
              memory: 32Mi
              cpu: 25m
            limits:
              memory: 128Mi
              cpu: 250m
          volumeMounts:
            - name: log
              mountPath: /app/log
            - name: tmp
              mountPath: /tmp
      volumes:
        - name: log
          emptyDir: {}
        - name: tmp
          emptyDir: {}