diff --git a/examples/wordpress/wordpress.jinja b/examples/wordpress/wordpress.jinja index 45cdcb89f..4c409e02b 100644 --- a/examples/wordpress/wordpress.jinja +++ b/examples/wordpress/wordpress.jinja @@ -17,52 +17,14 @@ {% set MYSQL_DISK = MYSQL['disk'] or 'mysql-disk' %} {% set MYSQL_DISK_FSTYPE = MYSQL['fstype'] or 'ext4' %} -imports: -- path: https://raw.githubusercontent.com/leendersr/deployment-manager/master/templates/replicatedservice/v2/replicatedservice.py - resources: -- name: nfs-server - type: https://raw.githubusercontent.com/leendersr/deployment-manager/master/templates/replicatedservice/v2/replicatedservice.py - properties: - service_port: {{ NFS_SERVER_PORT }} - container_port: {{ NFS_SERVER_PORT }} - replicas: 1 # Has to be 1 because of the persistent disk - image: gcr.io/google_containers/volume-nfs - privileged: true - cluster_ip: {{ NFS_SERVER_IP }} - volumes: - - mount_path: /mnt/data - gcePersistentDisk: - pdName: {{ NFS_SERVER_DISK }} - 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 +- name: nfs + type: https://raw.githubusercontent.com/leendersr/deployment-manager/master/templates/nfs/v1/nfs.jinja properties: - apiVersion: v1 - kind: PersistentVolume - metadata: - name: nfs - spec: - capacity: - storage: 1Mi - accessModes: - - ReadWriteMany - nfs: - server: {{ NFS_SERVER_IP }} - path: "/" + ip: {{ NFS_SERVER_IP }} + port: {{ NFS_SERVER_PORT }} + disk: {{ NFS_SERVER_DISK }} + fstype: {{NFS_SERVER_DISK_FSTYPE }} - name: nginx type: https://raw.githubusercontent.com/leendersr/deployment-manager/master/templates/replicatedservice/v2/replicatedservice.py properties: diff --git a/templates/nfs/v1/nfs.jinja b/templates/nfs/v1/nfs.jinja new file mode 100644 index 000000000..11ee661a2 --- /dev/null +++ b/templates/nfs/v1/nfs.jinja @@ -0,0 +1,49 @@ +{% set PROPERTIES = properties or {} %} +{% set SERVER_IP = PROPERTIES['ip'] or '10.0.253.247' %} +{% set SERVER_PORT = PROPERTIES['port'] or 2049 %} +{% set SERVER_DISK = PROPERTIES['disk'] or 'nfs-disk' %} +{% set SERVER_DISK_FSTYPE = PROPERTIES['fstype'] or 'ext4' %} + +resources: +- name: nfs-server + type: https://raw.githubusercontent.com/leendersr/deployment-manager/master/templates/replicatedservice/v2/replicatedservice.py + properties: + service_port: {{ SERVER_PORT }} + container_port: {{ SERVER_PORT }} + replicas: 1 # Has to be 1 because of the persistent disk + image: gcr.io/google_containers/volume-nfs + privileged: true + cluster_ip: {{ SERVER_IP }} + volumes: + - mount_path: /mnt/data + gcePersistentDisk: + pdName: {{ SERVER_DISK }} + fsType: {{ 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: {{ SERVER_IP }} + path: "/" diff --git a/templates/nfs/v1/nfs.schema b/templates/nfs/v1/nfs.schema new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/templates/nfs/v1/nfs.schema @@ -0,0 +1 @@ + diff --git a/templates/nfs/v1/nfs.yaml b/templates/nfs/v1/nfs.yaml new file mode 100644 index 000000000..4d5c68d8a --- /dev/null +++ b/templates/nfs/v1/nfs.yaml @@ -0,0 +1,2 @@ +- name: nfs + type: https://raw.githubusercontent.com/leendersr/deployment-manager/master/templates/nfs/v1/nfs.jinja