{
	"kind": "Template",
	"apiVersion": "v1",
	"metadata": {
		"name": "fuse77-console",
		"creationTimestamp": null,
		"labels": {
			"template": "fuse-console"
		},
		"annotations": {
			"description": "The Red Hat Fuse Console eases the discovery and management of Fuse applications deployed on OpenShift.",
			"iconClass": "icon-rh-integration",
			"openshift.io/display-name": "Red Hat Fuse 7.7 Console",
			"openshift.io/provider-display-name": "Red Hat, Inc.",
			"tags": "hawtio,java,fis,jboss-fuse",
			"version": "1.7"
		}
	},
	"objects": [
		{
			"apiVersion": "v1",
			"data": {
				"hawtconfig.json": "{\n  \"about\": {\n    \"title\": \"Red Hat Fuse Console\",\n    \"productInfo\": [],\n    \"additionalInfo\": \"The Red Hat Fuse Console eases the discovery and management of Fuse applications deployed on OpenShift.\",\n    \"copyright\": \"\",\n    \"imgSrc\": \"../online/img/Logo-RedHat-A-Reverse-RGB.png\"\n  },\n  \"branding\": {\n    \"appName\": \"Fuse Console\",\n    \"appLogoUrl\": \"../online/img/Logo-Red_Hat-Fuse-A-Reverse-RGB.png\"\n  },\n  \"disabledRoutes\": [\n    \"/camel/source\",\n    \"/diagnostics\",\n    \"/jvm/discover\",\n    \"/jvm/local\"\n  ]\n}\n"
			},
			"kind": "ConfigMap",
			"metadata": {
				"name": "${APP_NAME}-config"
			}
		},
		{
			"apiVersion": "v1",
			"kind": "Route",
			"metadata": {
				"labels": {
					"app": "${APP_NAME}",
					"component": "${APP_NAME}",
					"group": "console",
					"version": "${APP_VERSION}"
				},
				"name": "${APP_NAME}-route"
			},
			"spec": {
				"host": "${ROUTE_HOSTNAME}",
				"tls": {
					"insecureEdgeTerminationPolicy": "Redirect",
					"termination": "reencrypt"
				},
				"to": {
					"kind": "Service",
					"name": "${APP_NAME}-service"
				}
			}
		},
		{
			"apiVersion": "v1",
			"kind": "Service",
			"metadata": {
				"annotations": {
					"service.alpha.openshift.io/serving-cert-secret-name": "${APP_NAME}-tls"
				},
				"labels": {
					"app": "${APP_NAME}",
					"component": "${APP_NAME}",
					"group": "console",
					"version": "${APP_VERSION}"
				},
				"name": "${APP_NAME}-service"
			},
			"spec": {
				"ports": [
					{
						"port": 443,
						"protocol": "TCP",
						"targetPort": "nginx"
					}
				],
				"selector": {
					"app": "${APP_NAME}",
					"component": "${APP_NAME}",
					"group": "console"
				}
			}
		},
		{
			"apiVersion": "v1",
			"kind": "ServiceAccount",
			"metadata": {
				"annotations": {
					"serviceaccounts.openshift.io/oauth-redirectreference.route": "{\"kind\": \"OAuthRedirectReference\", \"apiVersion\": \"v1\", \"reference\": {\"kind\": \"Route\", \"name\": \"${APP_NAME}-route\"}}",
					"serviceaccounts.openshift.io/oauth-redirecturi.route": "https://"
				},
				"labels": {
					"app": "${APP_NAME}",
					"component": "${APP_NAME}",
					"group": "console",
					"version": "${APP_VERSION}"
				},
				"name": "${APP_NAME}-service-account"
			}
		},
		{
			"apiVersion": "v1",
			"kind": "DeploymentConfig",
			"metadata": {
				"creationTimestamp": null,
				"labels": {
					"app": "${APP_NAME}",
					"component": "${APP_NAME}",
					"group": "console",
					"version": "${APP_VERSION}"
				},
				"name": "${APP_NAME}"
			},
			"spec": {
				"replicas": 1,
				"selector": {
					"app": "${APP_NAME}",
					"component": "${APP_NAME}",
					"deploymentconfig": "${APP_NAME}",
					"group": "console",
					"version": "${APP_VERSION}"
				},
				"template": {
					"metadata": {
						"creationTimestamp": null,
						"labels": {
							"app": "${APP_NAME}",
							"component": "${APP_NAME}",
							"deploymentconfig": "${APP_NAME}",
							"group": "console",
							"version": "${APP_VERSION}"
						}
					},
					"spec": {
						"containers": [
							{
								"env": [
									{
										"name": "HAWTIO_ONLINE_MODE",
										"value": "namespace"
									},
									{
										"name": "HAWTIO_ONLINE_NAMESPACE",
										"valueFrom": {
											"fieldRef": {
												"fieldPath": "metadata.namespace"
											}
										}
									},
									{
										"name": "HAWTIO_OAUTH_CLIENT_ID",
										"value": "${APP_NAME}-service-account"
									}
								],
								"image": "fuse7-console:${APP_VERSION}",
								"livenessProbe": {
									"httpGet": {
										"path": "/online",
										"port": "nginx",
										"scheme": "HTTPS"
									},
									"initialDelaySeconds": 10,
									"periodSeconds": 10
								},
								"name": "${APP_NAME}",
								"ports": [
									{
										"containerPort": 8443,
										"name": "nginx"
									}
								],
								"readinessProbe": {
									"httpGet": {
										"path": "/online",
										"port": "nginx",
										"scheme": "HTTPS"
									},
									"initialDelaySeconds": 5
								},
								"resources": {
									"limits": {
										"cpu": "${CPU_LIMIT}",
										"memory": "${MEMORY_LIMIT}"
									},
									"requests": {
										"cpu": "${CPU_REQUEST}",
										"memory": "${MEMORY_REQUEST}"
									}
								},
								"volumeMounts": [
									{
										"mountPath": "/opt/app-root/src/online/hawtconfig.json",
										"name": "${APP_NAME}-config",
										"subPath": "hawtconfig.json"
									},
									{
										"mountPath": "/opt/app-root/src/integration/hawtconfig.json",
										"name": "${APP_NAME}-config",
										"subPath": "hawtconfig.json"
									},
									{
										"mountPath": "/etc/tls/private/serving",
										"name": "${APP_NAME}-tls"
									}
								]
							}
						],
						"volumes": [
							{
								"configMap": {
									"name": "${APP_NAME}-config"
								},
								"name": "${APP_NAME}-config"
							},
							{
								"name": "${APP_NAME}-tls",
								"secret": {
									"secretName": "${APP_NAME}-tls"
								}
							}
						]
					}
				},
				"triggers": [
					{
						"type": "ConfigChange"
					},
					{
						"imageChangeParams": {
							"automatic": true,
							"containerNames": [
								"${APP_NAME}"
							],
							"from": {
								"kind": "ImageStreamTag",
								"name": "fuse7-console:${APP_VERSION}",
								"namespace": "${IMAGE_STREAM_NAMESPACE}"
							}
						},
						"type": "ImageChange"
					}
				]
			}
		}
	],
	"parameters": [
		{
			"name": "APP_NAME",
			"displayName": "Application Name",
			"description": "The name assigned to the application.",
			"value": "fuse77-console",
			"required": true
		},
		{
			"name": "APP_VERSION",
			"displayName": "Application Version",
			"description": "The application version.",
			"value": "1.7",
			"required": true
		},
		{
			"name": "IMAGE_STREAM_NAMESPACE",
			"displayName": "Image Stream Namespace",
			"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.",
			"value": "openshift",
			"required": true
		},
		{
			"name": "ROUTE_HOSTNAME",
			"description": "The externally-reachable host name that routes to the Red Hat Fuse console service"
		},
		{
			"name": "CPU_REQUEST",
			"displayName": "CPU request",
			"description": "The amount of CPU to request.",
			"value": "0.2",
			"required": true
		},
		{
			"name": "MEMORY_REQUEST",
			"displayName": "Memory request",
			"description": "The amount of memory required for the container to run.",
			"value": "32Mi",
			"required": true
		},
		{
			"name": "CPU_LIMIT",
			"displayName": "CPU limit",
			"description": "The amount of CPU the container is limited to use.",
			"value": "1.0",
			"required": true
		},
		{
			"name": "MEMORY_LIMIT",
			"displayName": "Memory limit",
			"description": "The amount of memory the container is limited to use.",
			"value": "200Mi",
			"required": true
		}
	]
}