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