parser-worker-template.yaml 1.76 KB
Newer Older
1
2
3
4
5
6
apiVersion: apps/v1
kind: Deployment
metadata:
  name: streams-${deploymentName}-deployment
  namespace: osdu-streams
spec:
Dmitry Kniazev's avatar
Dmitry Kniazev committed
7
  replicas: 0
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
58
59
60
61
62
63
64
65
66
67
68
69
  selector:
    matchLabels:
      run: ${deploymentName}
  template:
    metadata:
      labels:
        run: ${deploymentName}
    spec:
      containers:
        - image: ${image}
          ports:
            - containerPort: ${containerPort}
          env:
            - name: ENV1
              value: "env1_value"
            - name: ENV2
              value: "env2_value"
            - name: SECRET_PASSWORD
                valueFrom:
                  secretKeyRef:
                    name: mysecret
                    key: password
          volumeMounts:
            - name: example-configmap
              mountPath: "/etc/example-configmap"
              readOnly: true
          resources:
            requests:
              memory: "${resources.requests.memory}"
              cpu: "${resources.requests.cpu}"
            limits:
              memory: "${resources.limits.memory}"
              cpu: "${resources.limits.cpu}"
          readinessProbe:
            tcpSocket:
              port: ${readinessProbe.tcpSocket.port}
            initialDelaySeconds: 5
            periodSeconds: 10
          livenessProbe:
            tcpSocket:
              port: ${livenessProbe.tcpSocket.port}
            initialDelaySeconds: 15
            periodSeconds: 20
      volumes:
        - name: example-configmap
          configMap:
            name: myconfigmap
---
apiVersion: v1
kind: Service
metadata:
  name: streams-${deploymentName}-service
  namespace: osdu-streams
  labels:
    run: ${deploymentName}
spec:
  selector:
    run: ${stream.deploymentName}
  ports:
    - port: ${servicePort}
      targetPort: ${containerPort}
      protocol: TCP