github.com/percona/percona-xtradb-cluster-operator@v1.14.0/e2e-tests/affinity/compare/statefulset_custom-pxc-oc.yml (about)

     1  apiVersion: apps/v1
     2  kind: StatefulSet
     3  metadata:
     4    generation: 1
     5    name: custom-pxc
     6    ownerReferences:
     7      - controller: true
     8        kind: PerconaXtraDBCluster
     9        name: custom
    10  spec:
    11    podManagementPolicy: OrderedReady
    12    replicas: 3
    13    revisionHistoryLimit: 10
    14    selector:
    15      matchLabels:
    16        app.kubernetes.io/component: pxc
    17        app.kubernetes.io/instance: custom
    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: custom-pxc
    22    template:
    23      metadata:
    24        labels:
    25          app.kubernetes.io/component: pxc
    26          app.kubernetes.io/instance: custom
    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          nodeAffinity:
    33            preferredDuringSchedulingIgnoredDuringExecution:
    34              - preference:
    35                  matchExpressions:
    36                    - key: another-node-label-key
    37                      operator: In
    38                      values:
    39                        - another-node-label-value
    40                weight: 1
    41            requiredDuringSchedulingIgnoredDuringExecution:
    42              nodeSelectorTerms:
    43                - matchExpressions:
    44                    - key: kubernetes.io/e2e-az-name
    45                      operator: In
    46                      values:
    47                        - e2e-az1
    48                        - e2e-az2
    49          podAffinity:
    50            requiredDuringSchedulingIgnoredDuringExecution:
    51              - labelSelector:
    52                  matchExpressions:
    53                    - key: security
    54                      operator: In
    55                      values:
    56                        - S1
    57                topologyKey: failure-domain.beta.kubernetes.io/zone
    58          podAntiAffinity:
    59            preferredDuringSchedulingIgnoredDuringExecution:
    60              - podAffinityTerm:
    61                  labelSelector:
    62                    matchExpressions:
    63                      - key: security
    64                        operator: In
    65                        values:
    66                          - S2
    67                  topologyKey: kubernetes.io/hostname
    68                weight: 100
    69        containers:
    70          - args:
    71              - mysqld
    72            command:
    73              - /var/lib/mysql/pxc-entrypoint.sh
    74            env:
    75              - name: PXC_SERVICE
    76                value: custom-pxc-unready
    77              - name: MONITOR_HOST
    78                value: '%'
    79              - name: MYSQL_ROOT_PASSWORD
    80                valueFrom:
    81                  secretKeyRef:
    82                    key: root
    83                    name: internal-custom
    84              - name: XTRABACKUP_PASSWORD
    85                valueFrom:
    86                  secretKeyRef:
    87                    key: xtrabackup
    88                    name: internal-custom
    89              - name: MONITOR_PASSWORD
    90                valueFrom:
    91                  secretKeyRef:
    92                    key: monitor
    93                    name: internal-custom
    94              - name: OPERATOR_ADMIN_PASSWORD
    95                valueFrom:
    96                  secretKeyRef:
    97                    key: operator
    98                    name: internal-custom
    99              - name: LIVENESS_CHECK_TIMEOUT
   100                value: "5"
   101              - name: READINESS_CHECK_TIMEOUT
   102                value: "15"
   103              - name: DEFAULT_AUTHENTICATION_PLUGIN
   104                value: mysql_native_password
   105            envFrom:
   106              - secretRef:
   107                  name: custom-env-vars-pxc
   108                  optional: true
   109            imagePullPolicy: Always
   110            livenessProbe:
   111              exec:
   112                command:
   113                  - /var/lib/mysql/liveness-check.sh
   114              failureThreshold: 3
   115              initialDelaySeconds: 300
   116              periodSeconds: 10
   117              successThreshold: 1
   118              timeoutSeconds: 5
   119            name: pxc
   120            ports:
   121              - containerPort: 3306
   122                name: mysql
   123                protocol: TCP
   124              - containerPort: 4444
   125                name: sst
   126                protocol: TCP
   127              - containerPort: 4567
   128                name: write-set
   129                protocol: TCP
   130              - containerPort: 4568
   131                name: ist
   132                protocol: TCP
   133              - containerPort: 33062
   134                name: mysql-admin
   135                protocol: TCP
   136              - containerPort: 33060
   137                name: mysqlx
   138                protocol: TCP
   139            readinessProbe:
   140              exec:
   141                command:
   142                  - /var/lib/mysql/readiness-check.sh
   143              failureThreshold: 5
   144              initialDelaySeconds: 15
   145              periodSeconds: 30
   146              successThreshold: 1
   147              timeoutSeconds: 15
   148            resources:
   149              limits:
   150                cpu: "1"
   151                memory: 1G
   152              requests:
   153                cpu: 600m
   154                memory: 1G
   155            terminationMessagePath: /dev/termination-log
   156            terminationMessagePolicy: File
   157            volumeMounts:
   158              - mountPath: /var/lib/mysql
   159                name: datadir
   160              - mountPath: /etc/percona-xtradb-cluster.conf.d
   161                name: config
   162              - mountPath: /tmp
   163                name: tmp
   164              - mountPath: /etc/mysql/ssl
   165                name: ssl
   166              - mountPath: /etc/mysql/ssl-internal
   167                name: ssl-internal
   168              - mountPath: /etc/mysql/mysql-users-secret
   169                name: mysql-users-secret-file
   170              - mountPath: /etc/my.cnf.d
   171                name: auto-config
   172              - mountPath: /etc/mysql/vault-keyring-secret
   173                name: vault-keyring-secret
   174              - mountPath: /etc/mysql/init-file
   175                name: mysql-init-file
   176        dnsPolicy: ClusterFirst
   177        initContainers:
   178          - command:
   179              - /pxc-init-entrypoint.sh
   180            imagePullPolicy: Always
   181            name: pxc-init
   182            resources:
   183              limits:
   184                cpu: 50m
   185                memory: 50M
   186            terminationMessagePath: /dev/termination-log
   187            terminationMessagePolicy: File
   188            volumeMounts:
   189              - mountPath: /var/lib/mysql
   190                name: datadir
   191        restartPolicy: Always
   192        schedulerName: default-scheduler
   193        securityContext:
   194          supplementalGroups:
   195            - 1001
   196        serviceAccount: default
   197        serviceAccountName: default
   198        terminationGracePeriodSeconds: 600
   199        volumes:
   200          - emptyDir: {}
   201            name: tmp
   202          - configMap:
   203              defaultMode: 420
   204              name: custom-pxc
   205              optional: true
   206            name: config
   207          - name: ssl-internal
   208            secret:
   209              defaultMode: 420
   210              optional: true
   211              secretName: custom-ssl-internal
   212          - name: ssl
   213            secret:
   214              defaultMode: 420
   215              optional: false
   216              secretName: some-name-ssl
   217          - configMap:
   218              defaultMode: 420
   219              name: auto-custom-pxc
   220              optional: true
   221            name: auto-config
   222          - name: vault-keyring-secret
   223            secret:
   224              defaultMode: 420
   225              optional: true
   226              secretName: custom-vault
   227          - name: mysql-users-secret-file
   228            secret:
   229              defaultMode: 420
   230              optional: false
   231              secretName: internal-custom
   232          - name: mysql-init-file
   233            secret:
   234              defaultMode: 420
   235              optional: true
   236              secretName: custom-mysql-init
   237    updateStrategy:
   238      rollingUpdate:
   239        partition: 0
   240      type: RollingUpdate
   241    volumeClaimTemplates:
   242      - metadata:
   243          name: datadir
   244        spec:
   245          accessModes:
   246            - ReadWriteOnce
   247          resources:
   248            requests:
   249              storage: 2Gi
   250        status:
   251          phase: Pending