Changes the Wordpress template so that it uses PersistentVolumeClaims

pull/71/head^2
Robert Leenders 10 years ago
parent 88f6d2169e
commit e5908add8f

@ -18,16 +18,16 @@
{% set MYSQL_DISK_FSTYPE = MYSQL['fstype'] or 'ext4' %} {% set MYSQL_DISK_FSTYPE = MYSQL['fstype'] or 'ext4' %}
imports: imports:
- path: https://raw.githubusercontent.com/kubernetes/deployment-manager/master/types/replicatedservice/v2/replicatedservice.py - path: https://raw.githubusercontent.com/leendersr/deployment-manager/master/templates/replicatedservice/v2/replicatedservice.py
resources: resources:
- name: nfs-server - name: nfs-server
type: https://raw.githubusercontent.com/kubernetes/deployment-manager/master/types/replicatedservice/v2/replicatedservice.py type: https://raw.githubusercontent.com/leendersr/deployment-manager/master/templates/replicatedservice/v2/replicatedservice.py
properties: properties:
service_port: {{ NFS_SERVER_PORT }} service_port: {{ NFS_SERVER_PORT }}
container_port: {{ NFS_SERVER_PORT }} container_port: {{ NFS_SERVER_PORT }}
replicas: 1 # Has to be 1 because of the persistent disk replicas: 1 # Has to be 1 because of the persistent disk
image: jsafrane/nfs-data image: gcr.io/google_containers/volume-nfs
privileged: true privileged: true
cluster_ip: {{ NFS_SERVER_IP }} cluster_ip: {{ NFS_SERVER_IP }}
volumes: volumes:
@ -35,8 +35,36 @@ resources:
gcePersistentDisk: gcePersistentDisk:
pdName: {{ NFS_SERVER_DISK }} pdName: {{ NFS_SERVER_DISK }}
fsType: {{ NFS_SERVER_DISK_FSTYPE }} fsType: {{ NFS_SERVER_DISK_FSTYPE }}
- name: nfs-pvc
type: PersistentVolumeClaim
properties:
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: nfs
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 1Mi
- name: nfs-pv
type: PersistentVolume
properties:
apiVersion: v1
kind: PersistentVolume
metadata:
name: nfs
spec:
capacity:
storage: 1Mi
accessModes:
- ReadWriteMany
nfs:
server: {{ NFS_SERVER_IP }}
path: "/"
- name: nginx - name: nginx
type: https://raw.githubusercontent.com/kubernetes/deployment-manager/master/types/replicatedservice/v2/replicatedservice.py type: https://raw.githubusercontent.com/leendersr/deployment-manager/master/templates/replicatedservice/v2/replicatedservice.py
properties: properties:
service_port: {{ NGINX_PORT }} service_port: {{ NGINX_PORT }}
container_port: {{ NGINX_PORT }} container_port: {{ NGINX_PORT }}
@ -45,11 +73,10 @@ resources:
image: gcr.io/{{ PROJECT }}/nginx:latest image: gcr.io/{{ PROJECT }}/nginx:latest
volumes: volumes:
- mount_path: /var/www/html - mount_path: /var/www/html
nfs: persistentVolumeClaim:
server: {{ NFS_SERVER_IP }} claimName: nfs
path: /
- name: mysql - name: mysql
type: https://raw.githubusercontent.com/kubernetes/deployment-manager/master/types/replicatedservice/v2/replicatedservice.py type: https://raw.githubusercontent.com/leendersr/deployment-manager/master/templates/replicatedservice/v2/replicatedservice.py
properties: properties:
service_port: {{ MYSQL_PORT }} service_port: {{ MYSQL_PORT }}
container_port: {{ MYSQL_PORT }} container_port: {{ MYSQL_PORT }}
@ -64,7 +91,7 @@ resources:
pdName: {{ MYSQL_DISK }} pdName: {{ MYSQL_DISK }}
fsType: {{ MYSQL_DISK_FSTYPE }} fsType: {{ MYSQL_DISK_FSTYPE }}
- name: wordpress-php - name: wordpress-php
type: https://raw.githubusercontent.com/kubernetes/deployment-manager/master/types/replicatedservice/v2/replicatedservice.py type: https://raw.githubusercontent.com/leendersr/deployment-manager/master/templates/replicatedservice/v2/replicatedservice.py
properties: properties:
service_name: wordpress-php service_name: wordpress-php
service_port: {{ WORDPRESS_PHP_PORT }} service_port: {{ WORDPRESS_PHP_PORT }}
@ -78,6 +105,5 @@ resources:
value: mysql-service value: mysql-service
volumes: volumes:
- mount_path: /var/www/html - mount_path: /var/www/html
nfs: persistentVolumeClaim:
server: {{ NFS_SERVER_IP }} claimName: nfs
path: /

Loading…
Cancel
Save