{
  "apiVersion": "v1",
  "kind": "Template",
  "metadata": {
    "annotations": {
      "openshift.io/display-name": "Red Hat Fuse 7.8 Camel log with Karaf",
      "openshift.io/provider-display-name": "Red Hat, Inc.",
      "description": "A simple Camel route in Karaf container. This quickstart shows a simple Apache Camel application that logs a message to the server log every 5th second.",
      "tags": "quickstart,java,karaf,fis,jboss-fuse",
      "iconClass": "icon-rh-integration",
      "version": "1.8"
    },
    "name": "s2i-fuse78-karaf-camel-log"
  },
  "labels": {
    "template": "s2i-fuse78-karaf-camel-log"
  },
  "parameters": [
    {
      "name": "APP_NAME",
      "displayName": "Application Name",
      "required": true,
      "value": "s2i-fuse78-karaf-camel-log",
      "description": "The name assigned to the application."
    },
    {
      "name": "GIT_REPO",
      "displayName": "Git Repository URL",
      "value": "https://github.com/fabric8-quickstarts/karaf-camel-log.git",
      "required": true,
      "description": "The URL of the repository with your application source code."
    },
    {
      "name": "GIT_REF",
      "displayName": "Git Reference",
      "value": "karaf-camel-log-7.8.0.fuse-sb2-780030-redhat-00002",
      "description": "Set this to a branch name, tag or other ref of your repository if you are not using the default branch."
    },
    {
      "name": "BUILDER_VERSION",
      "displayName": "Builder version",
      "value": "1.8",
      "description": "The version of the FIS S2I builder image to use."
    },
    {
      "name": "APP_VERSION",
      "displayName": "Application Version",
      "value": "7.8.0.fuse-sb2-780030-redhat-00002",
      "description": "The application version."
    },
    {
      "name": "MAVEN_ARGS",
      "displayName": "Maven Arguments",
      "value": "install -DskipTests -Dfabric8.skip -e -B",
      "description": "Arguments passed to mvn in the build."
    },
    {
      "name": "MAVEN_ARGS_APPEND",
      "displayName": "Extra Maven Arguments",
      "description": "Extra arguments passed to mvn, e.g. for multi-module builds."
    },
    {
      "displayName": "Maven mirror URL",
      "description": "Maven mirror to use for S2I builds.",
      "name": "MAVEN_MIRROR_URL",
      "required": false
    },
    {
      "name": "ARTIFACT_DIR",
      "displayName": "Maven build directory",
      "description": "Directory of the artifact to be built, e.g. for multi-module builds."
    },
    {
      "name": "IMAGE_STREAM_NAMESPACE",
      "displayName": "Image Stream Namespace",
      "value": "openshift",
      "required": true,
      "description": "Namespace in which the Fuse ImageStreams are installed. These ImageStreams are normally installed in the openshift namespace. You should only need to modify this if you've installed the ImageStreams in a different namespace/project."
    },
    {
      "name": "BUILD_SECRET",
      "displayName": "Git Build Secret",
      "generate": "expression",
      "description": "The secret needed to trigger a build.",
      "from": "[a-zA-Z0-9]{40}"
    },
    {
      "name": "CPU_REQUEST",
      "displayName": "CPU request",
      "value": "0.2",
      "required": true,
      "description": "The amount of CPU to request."
    },
    {
      "name": "MEMORY_REQUEST",
      "displayName": "Memory request",
      "value": "128Mi",
      "required": true,
      "description": "The amount of memory required for the container to run."
    },
    {
      "name": "CPU_LIMIT",
      "displayName": "CPU limit",
      "value": "1.0",
      "required": true,
      "description": "The amount of CPU the container is limited to use."
    },
    {
      "name": "MEMORY_LIMIT",
      "displayName": "Memory limit",
      "value": "512Mi",
      "required": true,
      "description": "The amount of memory the container is limited to use."
    },
    {
      "name": "BUILD_MEMORY_REQUEST",
      "displayName": "Build Memory request",
      "value": "0.7G",
      "required": true,
      "description": "The amount of memory to request for builds."
    },
    {
      "name": "BUILD_MEMORY_LIMIT",
      "displayName": "Build Memory limit",
      "value": "1G",
      "required": true,
      "description": "The amount of memory the build container is limited to use."
    }
  ],
  "objects": [
    {
      "kind": "ImageStream",
      "apiVersion": "v1",
      "metadata": {
        "name": "${APP_NAME}",
        "creationTimestamp": null,
        "labels": {
          "component": "${APP_NAME}",
          "container": "karaf",
          "group": "quickstarts",
          "app": "${APP_NAME}",
          "provider": "s2i",
          "version": "${APP_VERSION}"
        }
      },
      "spec": {},
      "status": {
        "dockerImageRepository": ""
      }
    },
    {
      "kind": "BuildConfig",
      "apiVersion": "v1",
      "metadata": {
        "name": "${APP_NAME}",
        "creationTimestamp": null,
        "labels": {
          "component": "${APP_NAME}",
          "container": "karaf",
          "group": "quickstarts",
          "app": "${APP_NAME}",
          "provider": "s2i",
          "version": "${APP_VERSION}"
        }
      },
      "spec": {
        "triggers": [
          {
            "type": "GitHub",
            "github": {
              "secret": "${BUILD_SECRET}"
            }
          },
          {
            "type": "Generic",
            "generic": {
              "secret": "${BUILD_SECRET}"
            }
          },
          {
            "type": "ConfigChange"
          },
          {
            "type": "ImageChange",
            "imageChange": {}
          }
        ],
        "source": {
          "type": "Git",
          "git": {
            "uri": "${GIT_REPO}",
            "ref": "${GIT_REF}"
          }
        },
        "strategy": {
          "type": "Source",
          "sourceStrategy": {
            "from": {
              "kind": "ImageStreamTag",
              "namespace": "${IMAGE_STREAM_NAMESPACE}",
              "name": "fuse7-karaf-openshift:${BUILDER_VERSION}"
            },
            "forcePull": true,
            "incremental": true,
            "env": [
              {
                "name": "BUILD_LOGLEVEL",
                "value": "5"
              },
              {
                "name": "ARTIFACT_DIR",
                "value": "${ARTIFACT_DIR}"
              },
              {
                "name": "MAVEN_ARGS",
                "value": "${MAVEN_ARGS}"
              },
              {
                "name": "MAVEN_ARGS_APPEND",
                "value": "${MAVEN_ARGS_APPEND}"
              },
              {
                "name": "MAVEN_MIRROR_URL",
                "value": "${MAVEN_MIRROR_URL}"
              }
            ]
          }
        },
        "output": {
          "to": {
            "kind": "ImageStreamTag",
            "name": "${APP_NAME}:latest"
          }
        },
        "resources": {
          "requests": {
            "memory": "${BUILD_MEMORY_REQUEST}"
          },
          "limits": {
            "memory": "${BUILD_MEMORY_LIMIT}"
          }
        }
      },
      "status": {
        "lastVersion": 0
      }
    },
    {
      "kind": "DeploymentConfig",
      "apiVersion": "v1",
      "metadata": {
        "name": "${APP_NAME}",
        "creationTimestamp": null,
        "labels": {
          "component": "${APP_NAME}",
          "container": "karaf",
          "group": "quickstarts",
          "app": "${APP_NAME}",
          "provider": "s2i",
          "version": "${APP_VERSION}"
        }
      },
      "spec": {
        "triggers": [
          {
            "type": "ConfigChange"
          },
          {
            "type": "ImageChange",
            "imageChangeParams": {
              "automatic": true,
              "containerNames": [
                "${APP_NAME}"
              ],
              "from": {
                "kind": "ImageStreamTag",
                "name": "${APP_NAME}:latest"
              }
            }
          }
        ],
        "replicas": 1,
        "selector": {
          "component": "${APP_NAME}",
          "container": "karaf",
          "deploymentconfig": "${APP_NAME}",
          "group": "quickstarts",
          "app": "${APP_NAME}",
          "provider": "s2i",
          "version": "${APP_VERSION}"
        },
        "template": {
          "metadata": {
            "creationTimestamp": null,
            "labels": {
              "component": "${APP_NAME}",
              "container": "karaf",
              "deploymentconfig": "${APP_NAME}",
              "group": "quickstarts",
              "app": "${APP_NAME}",
              "provider": "s2i",
              "version": "${APP_VERSION}",
              "com.company": "Red_Hat",
              "rht.prod_name": "Red_Hat_Integration",
              "rht.prod_ver": "7.8",
              "rht.comp": "${APP_NAME}",
              "rht.comp_ver": "${APP_VERSION}"
            }
          },
          "spec": {
            "containers": [
              {
                "name": "${APP_NAME}",
                "image": "library/${APP_NAME}:latest",
                "readinessProbe" : {
                  "httpGet" : {
                    "path" : "/readiness-check",
                    "port" : 8181
                  },
                  "initialDelaySeconds" : 10
                },
                "livenessProbe" : {
                  "httpGet" : {
                    "path" : "/health-check",
                    "port" : 8181
                  },
                  "initialDelaySeconds" : 180
                },
                "ports": [
                  {
                    "containerPort": 8181,
                    "name": "http"
                  },
                  {
                    "containerPort": 8778,
                    "name": "jolokia"
                  }
                ],
                "env" : [ {
                  "name" : "KUBERNETES_NAMESPACE",
                  "valueFrom" : {
                    "fieldRef" : {
                      "fieldPath" : "metadata.namespace"
                    }
                  }
                } ],
                "resources": {
                  "requests": {
                    "cpu": "${CPU_REQUEST}",
                    "memory": "${MEMORY_REQUEST}"
                  },
                  "limits": {
                    "cpu": "${CPU_LIMIT}",
                    "memory": "${MEMORY_LIMIT}"
                  }
                }
              }
            ]
          }
        }
      }
    }
  ]
}
