github.com/percona/percona-xtradb-cluster-operator@v1.14.0/e2e-tests/default-cr/compare/statefulset_minimal-cluster-haproxy.yml (about)

     1  apiVersion: apps/v1
     2  kind: StatefulSet
     3  metadata:
     4    generation: 1
     5    name: minimal-cluster-haproxy
     6    ownerReferences:
     7      - controller: true
     8        kind: PerconaXtraDBCluster
     9        name: minimal-cluster
    10  spec:
    11    podManagementPolicy: OrderedReady
    12    replicas: 1
    13    revisionHistoryLimit: 10
    14    selector:
    15      matchLabels:
    16        app.kubernetes.io/component: haproxy
    17        app.kubernetes.io/instance: minimal-cluster
    18        app.kubernetes.io/managed-by: percona-xtradb-cluster-operator
    19        app.kubernetes.io/name: percona-xtradb-cluster
    20        app.kubernetes.io/part-of: percona-xtradb-cluster
    21    serviceName: minimal-cluster-haproxy
    22    template:
    23      metadata:
    24        labels:
    25          app.kubernetes.io/component: haproxy
    26          app.kubernetes.io/instance: minimal-cluster
    27          app.kubernetes.io/managed-by: percona-xtradb-cluster-operator
    28          app.kubernetes.io/name: percona-xtradb-cluster
    29          app.kubernetes.io/part-of: percona-xtradb-cluster
    30      spec:
    31        affinity:
    32          podAntiAffinity:
    33            requiredDuringSchedulingIgnoredDuringExecution:
    34              - labelSelector:
    35                  matchLabels:
    36                    app.kubernetes.io/component: haproxy
    37                    app.kubernetes.io/instance: minimal-cluster
    38                    app.kubernetes.io/managed-by: percona-xtradb-cluster-operator
    39                    app.kubernetes.io/name: percona-xtradb-cluster
    40                    app.kubernetes.io/part-of: percona-xtradb-cluster
    41                topologyKey: kubernetes.io/hostname
    42        containers:
    43          - env:
    44              - name: PXC_SERVICE
    45                value: minimal-cluster-pxc
    46              - name: LIVENESS_CHECK_TIMEOUT
    47                value: "5"
    48              - name: READINESS_CHECK_TIMEOUT
    49                value: "1"
    50            envFrom:
    51              - secretRef:
    52                  name: minimal-cluster-env-vars-haproxy
    53                  optional: true
    54            imagePullPolicy: Always
    55            livenessProbe:
    56              exec:
    57                command:
    58                  - /usr/local/bin/liveness-check.sh
    59              failureThreshold: 4
    60              initialDelaySeconds: 60
    61              periodSeconds: 30
    62              successThreshold: 1
    63              timeoutSeconds: 5
    64            name: haproxy
    65            ports:
    66              - containerPort: 3306
    67                name: mysql
    68                protocol: TCP
    69              - containerPort: 3307
    70                name: mysql-replicas
    71                protocol: TCP
    72              - containerPort: 3309
    73                name: proxy-protocol
    74                protocol: TCP
    75              - containerPort: 33062
    76                name: mysql-admin
    77                protocol: TCP
    78              - containerPort: 33060
    79                name: mysqlx
    80                protocol: TCP
    81            readinessProbe:
    82              exec:
    83                command:
    84                  - /usr/local/bin/readiness-check.sh
    85              failureThreshold: 3
    86              initialDelaySeconds: 15
    87              periodSeconds: 5
    88              successThreshold: 1
    89              timeoutSeconds: 1
    90            resources: {}
    91            terminationMessagePath: /dev/termination-log
    92            terminationMessagePolicy: File
    93            volumeMounts:
    94              - mountPath: /etc/haproxy-custom/
    95                name: haproxy-custom
    96              - mountPath: /etc/haproxy/pxc
    97                name: haproxy-auto
    98              - mountPath: /etc/mysql/mysql-users-secret
    99                name: mysql-users-secret-file
   100              - mountPath: /etc/mysql/haproxy-env-secret
   101                name: minimal-cluster-env-vars-haproxy
   102          - args:
   103              - /usr/bin/peer-list
   104              - -on-change=/usr/bin/add_pxc_nodes.sh
   105              - -service=$(PXC_SERVICE)
   106            env:
   107              - name: PXC_SERVICE
   108                value: minimal-cluster-pxc
   109            envFrom:
   110              - secretRef:
   111                  name: minimal-cluster-env-vars-haproxy
   112                  optional: true
   113            imagePullPolicy: Always
   114            name: pxc-monit
   115            resources: {}
   116            terminationMessagePath: /dev/termination-log
   117            terminationMessagePolicy: File
   118            volumeMounts:
   119              - mountPath: /etc/haproxy-custom/
   120                name: haproxy-custom
   121              - mountPath: /etc/haproxy/pxc
   122                name: haproxy-auto
   123              - mountPath: /etc/mysql/mysql-users-secret
   124                name: mysql-users-secret-file
   125              - mountPath: /etc/mysql/haproxy-env-secret
   126                name: minimal-cluster-env-vars-haproxy
   127        dnsPolicy: ClusterFirst
   128        initContainers:
   129          - command:
   130              - /pxc-init-entrypoint.sh
   131            imagePullPolicy: Always
   132            name: pxc-init
   133            resources:
   134              limits:
   135                cpu: 50m
   136                memory: 50M
   137            terminationMessagePath: /dev/termination-log
   138            terminationMessagePolicy: File
   139            volumeMounts:
   140              - mountPath: /var/lib/mysql
   141                name: bin
   142        restartPolicy: Always
   143        schedulerName: default-scheduler
   144        securityContext: {}
   145        serviceAccount: default
   146        serviceAccountName: default
   147        terminationGracePeriodSeconds: 30
   148        volumes:
   149          - configMap:
   150              defaultMode: 420
   151              name: minimal-cluster-haproxy
   152              optional: true
   153            name: haproxy-custom
   154          - emptyDir: {}
   155            name: haproxy-auto
   156          - name: mysql-users-secret-file
   157            secret:
   158              defaultMode: 420
   159              optional: false
   160              secretName: internal-minimal-cluster
   161          - name: minimal-cluster-env-vars-haproxy
   162            secret:
   163              defaultMode: 420
   164              optional: true
   165              secretName: minimal-cluster-env-vars-haproxy
   166          - emptyDir: {}
   167            name: bin
   168    updateStrategy:
   169      rollingUpdate:
   170        partition: 0
   171      type: RollingUpdate