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