Created
June 4, 2018 03:40
-
-
Save kokhang/1cfec7f6094f0ab9681cc97ae68ad132 to your computer and use it in GitHub Desktop.
mysql-ebs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: wordpress-mysql-ebs | |
labels: | |
app: wordpress | |
spec: | |
ports: | |
- port: 3306 | |
selector: | |
app: wordpress | |
tier: mysql | |
clusterIP: None | |
--- | |
apiVersion: v1 | |
kind: PersistentVolumeClaim | |
metadata: | |
name: mysql-pv-claim-ebs | |
labels: | |
app: wordpress | |
spec: | |
storageClassName: ebs-block | |
accessModes: | |
- ReadWriteOnce | |
resources: | |
requests: | |
storage: 20Gi | |
--- | |
apiVersion: apps/v1beta1 | |
kind: Deployment | |
metadata: | |
name: wordpress-mysql-ebs | |
labels: | |
app: wordpress | |
spec: | |
strategy: | |
type: Recreate | |
template: | |
metadata: | |
labels: | |
app: wordpress | |
tier: mysql | |
spec: | |
containers: | |
- image: mysql:5.6 | |
name: mysql | |
env: | |
- name: MYSQL_ROOT_PASSWORD | |
value: changeme | |
ports: | |
- containerPort: 3306 | |
name: mysql | |
volumeMounts: | |
- name: mysql-persistent-storage | |
mountPath: /var/lib/mysql | |
volumes: | |
- name: mysql-persistent-storage | |
persistentVolumeClaim: | |
claimName: mysql-pv-claim-ebs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment