{% set PROJECT = properties['project'] or 'dm-k8s-testing' %} {% set NFS_SERVER = properties['nfs-server'] or {} %} {% set NFS_SERVER_IP = NFS_SERVER['ip'] or '10.0.253.247' %} {% set NFS_SERVER_PORT = NFS_SERVER['port'] or 2049 %} {% set NFS_SERVER_DISK = NFS_SERVER['disk'] or 'nfs-disk' %} {% set NFS_SERVER_DISK_FSTYPE = NFS_SERVER['fstype'] or 'ext4' %} {% set NGINX = properties['nginx'] or {} %} {% set NGINX_PORT = 80 %} {% set NGINX_REPLICAS = NGINX['replicas'] or 2 %} {% set WORDPRESS_PHP = properties['wordpress-php'] or {} %} {% set WORDPRESS_PHP_REPLICAS = WORDPRESS_PHP['replicas'] or 2 %} {% set WORDPRESS_PHP_PORT = WORDPRESS_PHP['port'] or 9000 %} {% set MYSQL = properties['mysql'] or {} %} {% set MYSQL_PORT = MYSQL['port'] or 3306 %} {% set MYSQL_PASSWORD = MYSQL['password'] or 'mysql-password' %} {% 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/types/replicatedservice/v2/replicatedservice.py resources: - name: nfs-server type: https://raw.githubusercontent.com/leendersr/deployment-manager/master/types/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: jsafrane/nfs-data privileged: true cluster_ip: {{ NFS_SERVER_IP }} volumes: - mount_path: /mnt/data gcePersistentDisk: pdName: {{ NFS_SERVER_DISK }} fsType: {{ NFS_SERVER_DISK_FSTYPE }} - name: nginx type: https://raw.githubusercontent.com/leendersr/deployment-manager/master/types/replicatedservice/v2/replicatedservice.py properties: service_port: {{ NGINX_PORT }} container_port: {{ NGINX_PORT }} replicas: {{ NGINX_REPLICAS }} external_service: true image: gcr.io/{{ PROJECT }}/nginx:latest volumes: - mount_path: /var/www/html nfs: server: {{ NFS_SERVER_IP }} path: / - name: mysql type: https://raw.githubusercontent.com/leendersr/deployment-manager/master/types/replicatedservice/v2/replicatedservice.py properties: service_port: {{ MYSQL_PORT }} container_port: {{ MYSQL_PORT }} replicas: 1 image: mysql:5.6 env: - name: MYSQL_ROOT_PASSWORD value: {{ MYSQL_PASSWORD }} volumes: - mount_path: /var/lib/mysql gcePersistentDisk: pdName: {{ MYSQL_DISK }} fsType: {{ MYSQL_DISK_FSTYPE }} - name: wordpress-php type: https://raw.githubusercontent.com/leendersr/deployment-manager/master/types/replicatedservice/v2/replicatedservice.py properties: service_name: wordpress-php service_port: {{ WORDPRESS_PHP_PORT }} container_port: {{ WORDPRESS_PHP_PORT }} replicas: 2 image: wordpress:fpm env: - name: WORDPRESS_DB_PASSWORD value: {{ MYSQL_PASSWORD }} - name: WORDPRESS_DB_HOST value: mysql-service volumes: - mount_path: /var/www/html nfs: server: {{ NFS_SERVER_IP }} path: /