# k8s_examples_pxc-node2.yaml
apiVersion: v1
kind: Service
metadata:
  name: pxc-node2
  labels:
    node: pxc-node2
spec:
  ports:
    - port: 3306
      name: mysql
    - port: 4444
      name: state-snapshot-transfer
    - port: 4567
      name: replication-traffic
    - port: 4568
      name: incremental-state-transfer
  selector:
    node: pxc-node2

---
apiVersion: v1
kind: ReplicationController
metadata:
  name: pxc-node2
spec:
  replicas: 1
  template:
    metadata:
      labels:
        node: pxc-node2
        unit: pxc-cluster
    spec:
      containers:
        - resources:
            limits:
              cpu: 0.3
          image: capttofu/percona_xtradb_cluster_5_6:beta
          name: pxc-node2
          ports:
            - containerPort: 3306
            - containerPort: 4444
            - containerPort: 4567
            - containerPort: 4568
          env:
            - name: GALERA_CLUSTER
              value: "true"
            - name: WSREP_CLUSTER_ADDRESS
              value: gcomm://
            - name: WSREP_SST_USER
              value: sst
            - name: WSREP_SST_PASSWORD
              value: sst
            - name: MYSQL_USER
              value: mysql
            - name: MYSQL_PASSWORD
              value: mysql
            - name: MYSQL_ROOT_PASSWORD
              value: c-krit