{
    "apiVersion": "template.openshift.io/v1",
    "kind": "Template",
    "message": "Apicurito is now deployed to https://${ROUTE_HOSTNAME}.",
    "metadata": {
        "annotations": {
            "description": "Design beautiful, functional APIs with zero coding, using a visual designer for OpenAPI documents.",
            "iconClass": "icon-rh-integration",
            "openshift.io/display-name": "Red Hat Fuse Apicurito",
            "openshift.io/provider-display-name": "Red Hat, Inc.",
            "tags": "fuse,apicurio,openapi,swagger,api",
            "version": "1.4"
        },
        "labels": {
            "app": "apicurito"
        },
        "name": "apicurito"
    },
    "objects": [
        {
            "apiVersion": "v1",
            "data": {
                "config.js": "var ApicuritoConfig = {\n    \"generators\": [\n        {\n            \"name\":\"Fuse Camel Project\",\n            \"url\":\"/api/v1/generate/camel-project.zip\"\n        }\n    ]\n}\n"
            },
            "kind": "ConfigMap",
            "metadata": {
                "labels": {
                    "app": "apicurito"
                },
                "name": "apicurito-ui-config"
            }
        },
        {
            "apiVersion": "apps.openshift.io/v1",
            "kind": "DeploymentConfig",
            "metadata": {
                "labels": {
                    "app": "apicurito",
                    "component": "apicurito-ui"
                },
                "name": "apicurito-ui"
            },
            "spec": {
                "replicas": 1,
                "selector": {
                    "app": "apicurito",
                    "component": "apicurito-ui"
                },
                "strategy": {
                    "rollingParams": {
                        "intervalSeconds": 1,
                        "maxSurge": "25%",
                        "maxUnavailable": "25%",
                        "timeoutSeconds": 600,
                        "updatePeriodSeconds": 1
                    },
                    "type": "Rolling"
                },
                "template": {
                    "metadata": {
                        "labels": {
                            "app": "apicurito",
                            "component": "apicurito-ui"
                        }
                    },
                    "spec": {
                        "containers": [
                            {
                                "imagePullPolicy": "IfNotPresent",
                                "livenessProbe": {
                                    "httpGet": {
                                        "path": "/",
                                        "port": 8080
                                    },
                                    "initialDelaySeconds": 30
                                },
                                "name": "apicurito-ui",
                                "ports": [
                                    {
                                        "containerPort": 8080
                                    }
                                ],
                                "readinessProbe": {
                                    "httpGet": {
                                        "path": "/",
                                        "port": 8080
                                    },
                                    "initialDelaySeconds": 1
                                },
                                "resources": {
                                    "limits": {
                                        "cpu": "${CPU_LIMIT}",
                                        "memory": "${MEMORY_LIMIT}"
                                    },
                                    "requests": {
                                        "cpu": "${CPU_REQUEST}",
                                        "memory": "${MEMORY_REQUEST}"
                                    }
                                },
                                "volumeMounts": [
                                    {
                                        "mountPath": "/html/config",
                                        "name": "config-volume"
                                    }
                                ]
                            }
                        ],
                        "volumes": [
                            {
                                "configMap": {
                                    "name": "apicurito-ui-config"
                                },
                                "name": "config-volume"
                            }
                        ]
                    }
                },
                "triggers": [
                    {
                        "imageChangeParams": {
                            "automatic": true,
                            "containerNames": [
                                "apicurito-ui"
                            ],
                            "from": {
                                "kind": "ImageStreamTag",
                                "name": "apicurito-ui:${APP_VERSION}",
                                "namespace": "${IMAGE_STREAM_NAMESPACE}"
                            }
                        },
                        "type": "ImageChange"
                    },
                    {
                        "type": "ConfigChange"
                    }
                ]
            }
        },
        {
            "apiVersion": "v1",
            "kind": "Service",
            "metadata": {
                "labels": {
                    "app": "apicurito"
                },
                "name": "apicurito-ui"
            },
            "spec": {
                "ports": [
                    {
                        "port": 80,
                        "protocol": "TCP",
                        "targetPort": 8080
                    }
                ],
                "selector": {
                    "app": "apicurito",
                    "component": "apicurito-ui"
                }
            }
        },
        {
            "apiVersion": "route.openshift.io/v1",
            "kind": "Route",
            "metadata": {
                "annotations": {
                    "console.alpha.openshift.io/overview-app-route": "true"
                },
                "labels": {
                    "app": "apicurito"
                },
                "name": "apicurito"
            },
            "spec": {
                "host": "${ROUTE_HOSTNAME}",
                "tls": {
                    "termination": "edge"
                },
                "to": {
                    "kind": "Service",
                    "name": "apicurito-ui"
                }
            }
        },
        {
            "apiVersion": "apps.openshift.io/v1",
            "kind": "DeploymentConfig",
            "metadata": {
                "labels": {
                    "app": "apicurito",
                    "component": "fuse-apicurito-generator"
                },
                "name": "fuse-apicurito-generator"
            },
            "spec": {
                "replicas": 1,
                "selector": {
                    "app": "apicurito",
                    "component": "fuse-apicurito-generator"
                },
                "strategy": {
                    "rollingParams": {
                        "intervalSeconds": 1,
                        "maxSurge": "25%",
                        "maxUnavailable": "25%",
                        "timeoutSeconds": 600,
                        "updatePeriodSeconds": 1
                    },
                    "type": "Rolling"
                },
                "template": {
                    "metadata": {
                        "labels": {
                            "app": "apicurito",
                            "component": "fuse-apicurito-generator"
                        }
                    },
                    "spec": {
                        "containers": [
                            {
                                "imagePullPolicy": "IfNotPresent",
                                "livenessProbe": {
                                    "failureThreshold": 3,
                                    "httpGet": {
                                        "path": "/health",
                                        "port": 8181,
                                        "scheme": "HTTP"
                                    },
                                    "initialDelaySeconds": 180,
                                    "periodSeconds": 10,
                                    "successThreshold": 1,
                                    "timeoutSeconds": 1
                                },
                                "name": "fuse-apicurito-generator",
                                "ports": [
                                    {
                                        "containerPort": 8080,
                                        "name": "http",
                                        "protocol": "TCP"
                                    },
                                    {
                                        "containerPort": 9779,
                                        "name": "prometheus",
                                        "protocol": "TCP"
                                    },
                                    {
                                        "containerPort": 8778,
                                        "name": "jolokia",
                                        "protocol": "TCP"
                                    }
                                ],
                                "readinessProbe": {
                                    "failureThreshold": 3,
                                    "httpGet": {
                                        "path": "/health",
                                        "port": 8181,
                                        "scheme": "HTTP"
                                    },
                                    "initialDelaySeconds": 10,
                                    "periodSeconds": 10,
                                    "successThreshold": 1,
                                    "timeoutSeconds": 1
                                },
                                "resources": {
                                    "limits": {
                                        "cpu": "${CPU_LIMIT}",
                                        "memory": "${MEMORY_LIMIT}"
                                    },
                                    "requests": {
                                        "cpu": "${CPU_REQUEST}",
                                        "memory": "${MEMORY_REQUEST}"
                                    }
                                }
                            }
                        ]
                    }
                },
                "triggers": [
                    {
                        "imageChangeParams": {
                            "automatic": true,
                            "containerNames": [
                                "fuse-apicurito-generator"
                            ],
                            "from": {
                                "kind": "ImageStreamTag",
                                "name": "fuse-apicurito-generator:${APP_VERSION}",
                                "namespace": "${IMAGE_STREAM_NAMESPACE}"
                            }
                        },
                        "type": "ImageChange"
                    },
                    {
                        "type": "ConfigChange"
                    }
                ]
            }
        },
        {
            "apiVersion": "v1",
            "kind": "Service",
            "metadata": {
                "labels": {
                    "app": "apicurito"
                },
                "name": "fuse-apicurito-generator"
            },
            "spec": {
                "ports": [
                    {
                        "port": 80,
                        "protocol": "TCP",
                        "targetPort": 8080
                    }
                ],
                "selector": {
                    "app": "apicurito",
                    "component": "fuse-apicurito-generator"
                }
            }
        },
        {
            "apiVersion": "route.openshift.io/v1",
            "kind": "Route",
            "metadata": {
                "labels": {
                    "app": "apicurito"
                },
                "name": "fuse-apicurito-generator"
            },
            "spec": {
                "host": "${ROUTE_HOSTNAME}",
                "path": "/api/v1",
                "tls": {
                    "termination": "edge"
                },
                "to": {
                    "kind": "Service",
                    "name": "fuse-apicurito-generator"
                }
            }
        }
    ],
    "parameters": [
        {
            "description": "The application version.",
            "displayName": "Application Version",
            "name": "APP_VERSION",
            "required": true,
            "value": "1.4"
        },
        {
            "description": "Namespace in which the Fuse image streams are installed. These image streams are normally installed in the 'openshift' namespace. You should only need to modify this if you've installed the image streams in a different namespace/project.",
            "displayName": "Image Stream Namespace",
            "name": "IMAGE_STREAM_NAMESPACE",
            "required": true,
            "value": "openshift"
        },
        {
            "description": "The external hostname to access Apicurito",
            "name": "ROUTE_HOSTNAME",
            "required": true
        },
        {
            "description": "The amount of CPU to request for each container.",
            "displayName": "CPU request",
            "name": "CPU_REQUEST",
            "required": true,
            "value": "0.2"
        },
        {
            "description": "The amount of memory required for each container to run.",
            "displayName": "Memory request",
            "name": "MEMORY_REQUEST",
            "required": true,
            "value": "64Mi"
        },
        {
            "description": "The amount of CPU each container is limited to use.",
            "displayName": "CPU limit",
            "name": "CPU_LIMIT",
            "required": true,
            "value": "1.0"
        },
        {
            "description": "The amount of memory each container is limited to use.",
            "displayName": "Memory limit",
            "name": "MEMORY_LIMIT",
            "required": true,
            "value": "256Mi"
        }
    ]
}