Created
March 27, 2017 13:35
-
-
Save kaparora/57e6cdfbd618712958ff8e25baaad438 to your computer and use it in GitHub Desktop.
Wordpress Mysql kubernetes/Openshift deployment with Gold storage class
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: PersistentVolumeClaim | |
metadata: | |
name: mysql-disk | |
annotations: | |
volume.beta.kubernetes.io/storage-class: gold | |
spec: | |
accessModes: | |
- ReadWriteOnce | |
resources: | |
requests: | |
storage: 50Gi | |
--- | |
apiVersion: v1 | |
kind: PersistentVolumeClaim | |
metadata: | |
name: wordpress-disk | |
annotations: | |
volume.beta.kubernetes.io/storage-class: gold | |
spec: | |
accessModes: | |
- ReadWriteOnce | |
resources: | |
requests: | |
storage: 5Gi | |
--- | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
labels: | |
name: mysql | |
name: mysql | |
spec: | |
ports: | |
# the port that this service should serve on | |
- port: 3306 | |
# label keys and values that must match in order to receive traffic for this service | |
selector: | |
name: mysql | |
--- | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
labels: | |
name: wpfrontend | |
name: wpfrontend | |
spec: | |
ports: | |
# the port that this service should serve on | |
- port: 80 | |
# label keys and values that must match in order to receive traffic for this service | |
selector: | |
name: wordpress | |
type: LoadBalancer | |
--- | |
apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: mysql | |
labels: | |
name: mysql | |
spec: | |
containers: | |
- resources: | |
limits : | |
cpu: 500m | |
memory: 256Mi | |
image: mysql:5.6 | |
name: mysql | |
env: | |
- name: MYSQL_ROOT_PASSWORD | |
# change this | |
value: netapp01 | |
ports: | |
- containerPort: 3306 | |
name: mysql | |
volumeMounts: | |
# name must match the volume name below | |
- name: mysql-persistent-storage | |
# mount path within the container | |
mountPath: /var/lib/mysql | |
volumes: | |
- name: mysql-persistent-storage | |
persistentVolumeClaim: | |
claimName: mysql-disk | |
--- | |
apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: wordpress | |
labels: | |
name: wordpress | |
spec: | |
containers: | |
- image: wordpress | |
name: wordpress | |
env: | |
- name: WORDPRESS_DB_PASSWORD | |
# change this - must match mysql.yaml password | |
value: netapp01 | |
ports: | |
- containerPort: 80 | |
name: wordpress | |
volumeMounts: | |
# name must match the volume name below | |
- name: wordpress-persistent-storage | |
# mount path within the container | |
mountPath: /var/www/html | |
volumes: | |
- name: wordpress-persistent-storage | |
persistentVolumeClaim: | |
claimName: wordpress-disk |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment