Updates README and adds clain-name property to the NFS type

pull/71/head^2
Robert Leenders 10 years ago
parent d56f541ad3
commit af6b5a7a00

@ -62,7 +62,7 @@ The nginx service is a replicated service with 2 replicas:
``` ```
- name: nginx - name: nginx
type: https://raw.githubusercontent.com/kubernetes/deployment-manager/master/templates/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 }}
@ -71,9 +71,8 @@ The nginx service is a replicated service with 2 replicas:
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: /
``` ```
The nginx image builds upon the standard nginx image and simply copies a custom configuration file. The nginx image builds upon the standard nginx image and simply copies a custom configuration file.
@ -83,7 +82,7 @@ The wordpress-php service is a replicated service with 2 replicas:
``` ```
- name: wordpress-php - name: wordpress-php
type: https://raw.githubusercontent.com/kubernetes/deployment-manager/master/templates/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 }}
@ -97,9 +96,8 @@ The wordpress-php service is a replicated service with 2 replicas:
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: /
``` ```
### MySQL service ### MySQL service
@ -124,23 +122,16 @@ The MySQL service is a replicated service with a single replica:
``` ```
### NFS service ### NFS service
The NFS service is a replicated service with a single replica: The NFS service is a replicated service with a single replica that is available as a type:
``` ```
- name: nfs-server - name: nfs
type: https://raw.githubusercontent.com/kubernetes/deployment-manager/master/templates/replicatedservice/v2/replicatedservice.py type: https://raw.githubusercontent.com/leendersr/deployment-manager/master/templates/nfs/v1/nfs.jinja
properties: properties:
service_port: {{ NFS_SERVER_PORT }} ip: {{ NFS_SERVER_IP }}
container_port: {{ NFS_SERVER_PORT }} port: {{ NFS_SERVER_PORT }}
replicas: 1 # Has to be 1 because of the persistent disk disk: {{ NFS_SERVER_DISK }}
image: jsafrane/nfs-data fstype: {{NFS_SERVER_DISK_FSTYPE }}
privileged: true
cluster_ip: {{ NFS_SERVER_IP }}
volumes:
- mount_path: /mnt/data
gcePersistentDisk:
pdName: {{ NFS_SERVER_DISK }}
fsType: {{ NFS_SERVER_DISK_FSTYPE }}
``` ```
## Deploying Wordpress ## Deploying Wordpress

@ -3,9 +3,10 @@
{% set SERVER_PORT = PROPERTIES['port'] or 2049 %} {% set SERVER_PORT = PROPERTIES['port'] or 2049 %}
{% set SERVER_DISK = PROPERTIES['disk'] or 'nfs-disk' %} {% set SERVER_DISK = PROPERTIES['disk'] or 'nfs-disk' %}
{% set SERVER_DISK_FSTYPE = PROPERTIES['fstype'] or 'ext4' %} {% set SERVER_DISK_FSTYPE = PROPERTIES['fstype'] or 'ext4' %}
{% set CLAIM_NAME = PROPERTIES['claim-name'] or 'nfs' %}
resources: resources:
- name: nfs-server - name: nfs
type: https://raw.githubusercontent.com/leendersr/deployment-manager/master/templates/replicatedservice/v2/replicatedservice.py type: https://raw.githubusercontent.com/leendersr/deployment-manager/master/templates/replicatedservice/v2/replicatedservice.py
properties: properties:
service_port: {{ SERVER_PORT }} service_port: {{ SERVER_PORT }}
@ -25,7 +26,7 @@ resources:
kind: PersistentVolumeClaim kind: PersistentVolumeClaim
apiVersion: v1 apiVersion: v1
metadata: metadata:
name: nfs name: {{ CLAIM_NAME }}
spec: spec:
accessModes: accessModes:
- ReadWriteMany - ReadWriteMany
@ -38,7 +39,7 @@ resources:
apiVersion: v1 apiVersion: v1
kind: PersistentVolume kind: PersistentVolume
metadata: metadata:
name: nfs name: {{ CLAIM_NAME }}
spec: spec:
capacity: capacity:
storage: 1Mi storage: 1Mi

Loading…
Cancel
Save