cbiodb-replicaset.yml 2.29 KB
Newer Older
Ľuboslav Pivarč's avatar
init  
Ľuboslav Pivarč committed
1
2
3
4
apiVersion: apps/v1
kind: ReplicaSet
metadata:
  generateName: cbiodb
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
5
  #namespace: cbio-on-demand
Ľuboslav Pivarč's avatar
init  
Ľuboslav Pivarč committed
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
  annotations:
    maintainer: Luboslav Pivarc <456130@muni.cz>
  labels:
    app: cbioDB
    type: ondemand
spec:
  replicas: 1
  selector:
    matchLabels:
      app: cbioDB
      type: ondemand
      # generated by API by user id from request
      #user: Luboslav
      # generated by API unique for user
      #instance: "1"
  template:
    metadata:
      labels:
        app: cbioDB
        type: ondemand
        # generated by API by user id from request
        #user: Luboslav
        # generated by API unique for user
        #instance: "1"
    spec:
31
32
33
34
35
36
37
38
39
40
41
42
43
44
      tolerations:
          - effect: NoSchedule
            key: edirex
            operator: Equal
            value: cbio
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
              - matchExpressions: 
                - key: edirex
                  operator: In
                  values: 
                  - cbio
Ľuboslav Pivarč's avatar
init  
Ľuboslav Pivarč committed
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
70
71
72
73
74
75
76
77
78
79
80
      containers:
        - name: cbio
          image: lpivo/cbiodb:v1
          ports:
            - name: mysql
              containerPort: 3306
          livenessProbe:
            exec:
              command:
                - sh
                - -c
                - "mysqladmin ping -u cbio -pP@ssword1"
            initialDelaySeconds: 30
            periodSeconds: 10
            timeoutSeconds: 5
            successThreshold: 1
            failureThreshold: 3
          readinessProbe:
            exec:
              command:
                - sh
                - -c
                - "mysqladmin ping -u cbio -pP@ssword1"
            initialDelaySeconds:  5
            periodSeconds: 10
            timeoutSeconds: 1
            successThreshold: 1
            failureThreshold: 3
          volumeMounts:
            - name: config
              mountPath: /etc/mysql/mysql.conf.d
              subPath: mysql.conf.d
              readOnly: true
          envFrom:
            - secretRef:
                name: mysql-env
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
81
          resources:
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
82
83
84
            requests:
              memory: "600Mi"
              cpu: "50m"
Ľuboslav Pivarč's avatar
init  
Ľuboslav Pivarč committed
85
86
87
88
89
      # we use 1 config for all on-demand databeses
      volumes:
        - name: config
          configMap:
            name: mysql-cbio-db