|
| 1 | +{ |
| 2 | + "kind": "Template", |
| 3 | + "apiVersion": "template.openshift.io/v1", |
| 4 | + "metadata": { |
| 5 | + "annotations": { |
| 6 | + "iconClass": "icon-rh-tomcat", |
| 7 | + "openshift.io/provider-display-name": "Red Hat, Inc.", |
| 8 | + "tags": "tomcat,tomcat10,java,jboss", |
| 9 | + "version": "6.0", |
| 10 | + "openshift.io/display-name": "JBoss Web Server 6.0 Apache Tomcat 10 OpenJDK21 on UBI8 (no https)", |
| 11 | + "description": "An example JBoss Web Server application. For more information about using this template, see https://github.com/jboss-openshift/application-templates.", |
| 12 | + "template.openshift.io/long-description": "This template defines resources needed to develop Red Hat JBoss Web Server 6.0 Apache Tomcat 10 based application, including a build configuration, and an application deployment configuration.", |
| 13 | + "template.openshift.io/documentation-url": "https://access.redhat.com/documentation/en/red-hat-jboss-web-server/", |
| 14 | + "template.openshift.io/support-url": "https://access.redhat.com" |
| 15 | + }, |
| 16 | + "name": "jws60-openjdk21-tomcat10-ubi8-basic-s2i" |
| 17 | + }, |
| 18 | + "labels": { |
| 19 | + "template": "jws60-openjdk21-tomcat10-ubi8-basic-s2i", |
| 20 | + "jws60jdk21ubi8": "6.0.3" |
| 21 | + }, |
| 22 | + "message": "A new JWS application for Apache Tomcat 10 has been created in your project.", |
| 23 | + "parameters": [ |
| 24 | + { |
| 25 | + "displayName": "Application Name", |
| 26 | + "description": "The name for the application.", |
| 27 | + "name": "APPLICATION_NAME", |
| 28 | + "value": "jws-app", |
| 29 | + "required": true |
| 30 | + }, |
| 31 | + { |
| 32 | + "displayName": "Custom http Route Hostname", |
| 33 | + "description": "Custom hostname for http service route. Leave blank for default hostname, e.g.: <application-name>-<project>.<default-domain-suffix>", |
| 34 | + "name": "HOSTNAME_HTTP", |
| 35 | + "value": "", |
| 36 | + "required": false |
| 37 | + }, |
| 38 | + { |
| 39 | + "displayName": "Git Repository URL", |
| 40 | + "description": "Git source URI for application", |
| 41 | + "name": "SOURCE_REPOSITORY_URL", |
| 42 | + "value": "https://github.com/web-servers/tomcat-websocket-chat-quickstart.git", |
| 43 | + "required": true |
| 44 | + }, |
| 45 | + { |
| 46 | + "displayName": "Git Reference", |
| 47 | + "description": "Git branch/tag reference", |
| 48 | + "name": "SOURCE_REPOSITORY_REF", |
| 49 | + "value": "main", |
| 50 | + "required": false |
| 51 | + }, |
| 52 | + { |
| 53 | + "displayName": "Context Directory", |
| 54 | + "description": "Path within Git project to build; empty for root project directory.", |
| 55 | + "name": "CONTEXT_DIR", |
| 56 | + "value": "tomcat-websocket-chat", |
| 57 | + "required": false |
| 58 | + }, |
| 59 | + { |
| 60 | + "displayName": "Github Webhook Secret", |
| 61 | + "description": "GitHub trigger secret", |
| 62 | + "name": "GITHUB_WEBHOOK_SECRET", |
| 63 | + "from": "[a-zA-Z0-9]{8}", |
| 64 | + "generate": "expression", |
| 65 | + "required": true |
| 66 | + }, |
| 67 | + { |
| 68 | + "displayName": "Generic Webhook Secret", |
| 69 | + "description": "Generic build trigger secret", |
| 70 | + "name": "GENERIC_WEBHOOK_SECRET", |
| 71 | + "from": "[a-zA-Z0-9]{8}", |
| 72 | + "generate": "expression", |
| 73 | + "required": true |
| 74 | + }, |
| 75 | + { |
| 76 | + "displayName": "ImageStream Namespace", |
| 77 | + "description": "Namespace in which the ImageStreams for Red Hat Middleware images 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.", |
| 78 | + "name": "IMAGE_STREAM_NAMESPACE", |
| 79 | + "value": "openshift", |
| 80 | + "required": true |
| 81 | + }, |
| 82 | + { |
| 83 | + "displayName": "Maven mirror URL", |
| 84 | + "description": "Maven mirror to use for S2I builds", |
| 85 | + "name": "MAVEN_MIRROR_URL", |
| 86 | + "value": "", |
| 87 | + "required": false |
| 88 | + }, |
| 89 | + { |
| 90 | + "description": "List of directories from which archives will be copied into the deployment folder. If unspecified, all archives in /target will be copied.", |
| 91 | + "name": "ARTIFACT_DIR", |
| 92 | + "value": "", |
| 93 | + "required": false |
| 94 | + } |
| 95 | + ], |
| 96 | + "objects": [ |
| 97 | + { |
| 98 | + "kind": "Service", |
| 99 | + "apiVersion": "v1", |
| 100 | + "spec": { |
| 101 | + "ports": [ |
| 102 | + { |
| 103 | + "port": 8080, |
| 104 | + "targetPort": 8080 |
| 105 | + } |
| 106 | + ], |
| 107 | + "selector": { |
| 108 | + "deploymentConfig": "${APPLICATION_NAME}" |
| 109 | + } |
| 110 | + }, |
| 111 | + "metadata": { |
| 112 | + "name": "${APPLICATION_NAME}", |
| 113 | + "labels": { |
| 114 | + "application": "${APPLICATION_NAME}" |
| 115 | + }, |
| 116 | + "annotations": { |
| 117 | + "description": "The web server's http port." |
| 118 | + } |
| 119 | + } |
| 120 | + }, |
| 121 | + { |
| 122 | + "kind": "Route", |
| 123 | + "apiVersion": "route.openshift.io/v1", |
| 124 | + "id": "${APPLICATION_NAME}-http", |
| 125 | + "metadata": { |
| 126 | + "name": "${APPLICATION_NAME}", |
| 127 | + "labels": { |
| 128 | + "application": "${APPLICATION_NAME}" |
| 129 | + }, |
| 130 | + "annotations": { |
| 131 | + "description": "Route for application's http service." |
| 132 | + } |
| 133 | + }, |
| 134 | + "spec": { |
| 135 | + "host": "${HOSTNAME_HTTP}", |
| 136 | + "to": { |
| 137 | + "name": "${APPLICATION_NAME}" |
| 138 | + } |
| 139 | + } |
| 140 | + }, |
| 141 | + { |
| 142 | + "kind": "ImageStream", |
| 143 | + "apiVersion": "image.openshift.io/v1", |
| 144 | + "metadata": { |
| 145 | + "name": "${APPLICATION_NAME}", |
| 146 | + "labels": { |
| 147 | + "application": "${APPLICATION_NAME}" |
| 148 | + } |
| 149 | + } |
| 150 | + }, |
| 151 | + { |
| 152 | + "kind": "BuildConfig", |
| 153 | + "apiVersion": "build.openshift.io/v1", |
| 154 | + "metadata": { |
| 155 | + "name": "${APPLICATION_NAME}", |
| 156 | + "labels": { |
| 157 | + "application": "${APPLICATION_NAME}" |
| 158 | + } |
| 159 | + }, |
| 160 | + "spec": { |
| 161 | + "source": { |
| 162 | + "type": "Git", |
| 163 | + "git": { |
| 164 | + "uri": "${SOURCE_REPOSITORY_URL}", |
| 165 | + "ref": "${SOURCE_REPOSITORY_REF}" |
| 166 | + }, |
| 167 | + "contextDir": "${CONTEXT_DIR}" |
| 168 | + }, |
| 169 | + "strategy": { |
| 170 | + "type": "Source", |
| 171 | + "sourceStrategy": { |
| 172 | + "env": [ |
| 173 | + { |
| 174 | + "name": "MAVEN_MIRROR_URL", |
| 175 | + "value": "${MAVEN_MIRROR_URL}" |
| 176 | + }, |
| 177 | + { |
| 178 | + "name": "ARTIFACT_DIR", |
| 179 | + "value": "${ARTIFACT_DIR}" |
| 180 | + } |
| 181 | + ], |
| 182 | + "forcePull": true, |
| 183 | + "from": { |
| 184 | + "kind": "ImageStreamTag", |
| 185 | + "namespace": "${IMAGE_STREAM_NAMESPACE}", |
| 186 | + "name": "jboss-webserver60-openjdk21-tomcat10-openshift-ubi8:6.0.3" |
| 187 | + } |
| 188 | + } |
| 189 | + }, |
| 190 | + "output": { |
| 191 | + "to": { |
| 192 | + "kind": "ImageStreamTag", |
| 193 | + "name": "${APPLICATION_NAME}:latest" |
| 194 | + } |
| 195 | + }, |
| 196 | + "triggers": [ |
| 197 | + { |
| 198 | + "type": "GitHub", |
| 199 | + "github": { |
| 200 | + "secret": "${GITHUB_WEBHOOK_SECRET}" |
| 201 | + } |
| 202 | + }, |
| 203 | + { |
| 204 | + "type": "Generic", |
| 205 | + "generic": { |
| 206 | + "secret": "${GENERIC_WEBHOOK_SECRET}" |
| 207 | + } |
| 208 | + }, |
| 209 | + { |
| 210 | + "type": "ImageChange", |
| 211 | + "imageChange": {} |
| 212 | + }, |
| 213 | + { |
| 214 | + "type": "ConfigChange" |
| 215 | + } |
| 216 | + ] |
| 217 | + } |
| 218 | + }, |
| 219 | + { |
| 220 | + "kind": "DeploymentConfig", |
| 221 | + "apiVersion": "apps.openshift.io/v1", |
| 222 | + "metadata": { |
| 223 | + "name": "${APPLICATION_NAME}", |
| 224 | + "labels": { |
| 225 | + "application": "${APPLICATION_NAME}" |
| 226 | + } |
| 227 | + }, |
| 228 | + "spec": { |
| 229 | + "strategy": { |
| 230 | + "type": "Recreate" |
| 231 | + }, |
| 232 | + "triggers": [ |
| 233 | + { |
| 234 | + "type": "ImageChange", |
| 235 | + "imageChangeParams": { |
| 236 | + "automatic": true, |
| 237 | + "containerNames": [ |
| 238 | + "${APPLICATION_NAME}" |
| 239 | + ], |
| 240 | + "from": { |
| 241 | + "kind": "ImageStreamTag", |
| 242 | + "name": "${APPLICATION_NAME}:latest" |
| 243 | + } |
| 244 | + } |
| 245 | + }, |
| 246 | + { |
| 247 | + "type": "ConfigChange" |
| 248 | + } |
| 249 | + ], |
| 250 | + "replicas": 1, |
| 251 | + "selector": { |
| 252 | + "deploymentConfig": "${APPLICATION_NAME}" |
| 253 | + }, |
| 254 | + "template": { |
| 255 | + "metadata": { |
| 256 | + "name": "${APPLICATION_NAME}", |
| 257 | + "labels": { |
| 258 | + "deploymentConfig": "${APPLICATION_NAME}", |
| 259 | + "application": "${APPLICATION_NAME}" |
| 260 | + } |
| 261 | + }, |
| 262 | + "spec": { |
| 263 | + "terminationGracePeriodSeconds": 60, |
| 264 | + "containers": [ |
| 265 | + { |
| 266 | + "name": "${APPLICATION_NAME}", |
| 267 | + "image": "${APPLICATION_NAME}", |
| 268 | + "imagePullPolicy": "Always", |
| 269 | + "readinessProbe": { |
| 270 | + "exec": { |
| 271 | + "command": [ |
| 272 | + "/bin/bash", |
| 273 | + "-c", |
| 274 | + "curl --noproxy '*' -is 'http://localhost:8080/health' | grep -iq '\"status\": \"UP\"'" |
| 275 | + ] |
| 276 | + } |
| 277 | + }, |
| 278 | + "ports": [ |
| 279 | + { |
| 280 | + "name": "jolokia", |
| 281 | + "containerPort": 8778, |
| 282 | + "protocol": "TCP" |
| 283 | + }, |
| 284 | + { |
| 285 | + "name": "http", |
| 286 | + "containerPort": 8080, |
| 287 | + "protocol": "TCP" |
| 288 | + } |
| 289 | + ] |
| 290 | + } |
| 291 | + ] |
| 292 | + } |
| 293 | + } |
| 294 | + } |
| 295 | + } |
| 296 | + ] |
| 297 | +} |
0 commit comments