From ba5e98b2129c855028746dcb69640f1aa2d01d96 Mon Sep 17 00:00:00 2001 From: Brendan Burns Date: Sat, 19 Aug 2017 21:58:56 -0700 Subject: [PATCH] Create 13-6-mysql-replicaset.yaml --- 13-6-mysql-replicaset.yaml | 43 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 13-6-mysql-replicaset.yaml diff --git a/13-6-mysql-replicaset.yaml b/13-6-mysql-replicaset.yaml new file mode 100644 index 0000000..fe70d29 --- /dev/null +++ b/13-6-mysql-replicaset.yaml @@ -0,0 +1,43 @@ +apiVersion: extensions/v1beta1 +kind: ReplicaSet +metadata: + name: mysql + # labels so that we can bind a Service to this Pod + labels: + app: mysql +spec: + replicas: 1 + selector: + matchLabels: + app: mysql + template: + metadata: + labels: + app: mysql + spec: + containers: + - name: database + image: mysql + resources: + requests: + cpu: 1 + memory: 2Gi + env: + # Environment variables are not a best practice for security, + # but we're using them here for brevity in the example. + # See Chapter 11 for better options. + - name: MYSQL_ROOT_PASSWORD + value: some-password-here + livenessProbe: + tcpSocket: + port: 3306 + ports: + - containerPort: 3306 + volumeMounts: + - name: database + # /var/lib/mysql is where MySQL stores its databases + mountPath: "/var/lib/mysql" + volumes: + - name: database + persistentVolumeClaim: + claimName: database