{
    "properties": {
        "configurations": {
            "description": "Kong configuration properties.",
            "properties": {
                "cassandra": {
                    "description": "Cassandra connection properties.",
                    "properties": {
                        "contact-points": {
                            "default": "node.cassandra.l4lb.thisdcos.directory",
                            "description": "A comma-separated list of contact points.",
                            "type": "string"
                        },
                        "keyspace": {
                            "default": "kong",
                            "description": "Cassandra keyspace.",
                            "type": "string"
                        },
                        "port": {
                            "default": 9042,
                            "description": "The port on which cassandra nodes are listening on.",
                            "type": "integer"
                        }
                    },
                    "type": "object"
                },
                "custom-envs": {
                    "description": "A space-separated list Kong configurations. Please avoid updating properties which already being set through other properties above.",
                    "pattern": "^(KONG_\\w+=\\S+)*(\\sKONG_\\w+=\\S+)*$",
                    "type": "string"
                },
                "database": {
                    "description": "Database properties.",
                    "properties": {
                        "migrations": {
                            "default": true,
                            "description": "Enable or disable Kong migrations. Recommended if Kong being run with clean backing datastore.",
                            "title": "Run Kong migrations",
                            "type": "boolean"
                        },
                        "use-cassandra": {
                            "default": false,
                            "description": "If true, Cassandra is used as Kong backing datastore.",
                            "title": "Use Cassandra as Kong backing datastore?",
                            "type": "boolean"
                        },
                        "use-postgres": {
                            "default": true,
                            "description": "If true, Postgres is used as Kong backing datastore.",
                            "title": "Use Postgres as Kong backing datastore?",
                            "type": "boolean"
                        }
                    },
                    "type": "object"
                },
                "log-level": {
                    "default": "notice",
                    "description": "Log level of the Kong server.",
                    "type": "string"
                },
                "postgres": {
                    "description": "Postgres connection properties.",
                    "properties": {
                        "database": {
                            "default": "kong",
                            "description": "Postgres database name.",
                            "type": "string"
                        },
                        "host": {
                            "default": "postgresql.marathon.l4lb.thisdcos.directory",
                            "description": "Postgres host address.",
                            "type": "string"
                        },
                        "password": {
                            "default": "kong",
                            "description": "Postgres password.",
                            "type": "string"
                        },
                        "port": {
                            "default": 5432,
                            "description": "Postgres port.",
                            "type": "integer"
                        },
                        "user": {
                            "default": "kong",
                            "description": "Postgres user.",
                            "type": "string"
                        }
                    },
                    "type": "object"
                }
            },
            "type": "object"
        },
        "networking": {
            "description": "Marathon-LB service configuration properties.",
            "properties": {
                "admin": {
                    "description": "Kong's Admin port configuration.",
                    "properties": {
                        "external-access": {
                            "default": false,
                            "description": "Enable or disable creating a VIP for external access through a public node running Marathon-LB.",
                            "title": "Allow external access",
                            "type": "boolean"
                        },
                        "https-redirect": {
                            "default": false,
                            "description": "Whether Marathon-lb should redirect HTTP traffic to HTTPS. This requires 'virtual-host' to be set.",
                            "type": "boolean"
                        },
                        "service-port": {
                            "default": 10202,
                            "description": "Port number to be used for external traffic to cluster through Marathon-LB load balancer.",
                            "type": "integer"
                        },
                        "vip-port": {
                            "default": 8001,
                            "description": "Port number to be used for communication internally to the cluster. Default is 8001.",
                            "type": "number"
                        },
                        "vip-port-ssl": {
                            "default": 8444,
                            "description": "Port number to be used for secure communication internally to the cluster. Default is 8444.",
                            "type": "number"
                        },
                        "virtual-host": {
                            "description": "The virtual host address to integrate Kong proxy port with Marathon-lb.",
                            "type": "string"
                        }
                    },
                    "type": "object"
                },
                "proxy": {
                    "description": "Kong's Proxy port configuration.",
                    "properties": {
                        "external-access": {
                            "default": true,
                            "description": "Enable or disable creating a VIP for external access through a public node running Marathon-LB.",
                            "title": "Allow external access",
                            "type": "boolean"
                        },
                        "https-redirect": {
                            "default": false,
                            "description": "Whether Marathon-lb should redirect HTTP traffic to HTTPS. This requires 'virtual-host' to be set.",
                            "type": "boolean"
                        },
                        "service-port": {
                            "default": 10201,
                            "description": "Port number to be used for external traffic to cluster through Marathon-LB load balancer.",
                            "type": "integer"
                        },
                        "vip-port": {
                            "default": 8000,
                            "description": "Port number to be used for communication internally to the cluster. Default is 8000.",
                            "type": "number"
                        },
                        "vip-port-ssl": {
                            "default": 8443,
                            "description": "Port number to be used for secure communication internally to the cluster. Default is 8443.",
                            "type": "number"
                        },
                        "virtual-host": {
                            "description": "The virtual host address to integrate Kong proxy port with Marathon-lb.",
                            "type": "string"
                        }
                    },
                    "type": "object"
                }
            },
            "type": "object"
        },
        "service": {
            "description": "DC/OS service configuration properties",
            "properties": {
                "cpus": {
                    "default": 1,
                    "description": "CPU shares to allocate to each instance.",
                    "minimum": 1,
                    "type": "number"
                },
                "instances": {
                    "default": 1,
                    "description": "Number of instances to run.",
                    "minimum": 1,
                    "type": "integer"
                },
                "mem": {
                    "default": 512,
                    "description": "Memory (MB) to allocate to each task.",
                    "minimum": 512,
                    "type": "number"
                },
                "name": {
                    "default": "kong",
                    "description": "The name of this Kong instance.",
                    "type": "string"
                },
                "role": {
                    "default": "*",
                    "description": "Deploy Kong only on nodes with this role.",
                    "type": "string"
                }
            },
            "required": [
                "name",
                "instances",
                "cpus",
                "mem",
                "role"
            ],
            "type": "object"
        }
    },
    "type": "object"
}