apiVersion: template.openshift.io/v1 kind: Template labels: template: s2i-microservices-fuse74-spring-boot-camel metadata: annotations: description: Spring Boot and Camel QuickStart. This example demonstrates how you can use Apache Camel with Spring Boot on OpenShift. The quickstart uses Spring Boot to configure an application which includes a Camel route that triggers a message every 5th second, and routes the message to a log. iconClass: icon-rh-integration openshift.io/display-name: Red Hat Fuse 7.4 Camel with Spring Boot openshift.io/provider-display-name: Red Hat, Inc. tags: microservices,java,springboot,fis,jboss-fuse version: "1.4" name: s2i-microservices-fuse74-spring-boot-camel selfLink: /apis/template.openshift.io/v1/namespaces/openshift/templates/s2i-microservices-fuse74-spring-boot-camel objects: # ---------------- imageStream - apiVersion: v1 kind: ImageStream metadata: creationTimestamp: null labels: app: ${APP_NAME} component: ${APP_NAME} group: ${APP_GROUP} provider: s2i version: ${APP_VERSION} name: ${APP_NAME} spec: {} status: dockerImageRepository: "" # --------------- buildConfig - apiVersion: v1 kind: BuildConfig metadata: creationTimestamp: null labels: app: ${APP_NAME} component: ${APP_NAME} group: ${APP_GROUP} provider: s2i version: ${APP_VERSION} name: ${APP_NAME} spec: output: to: kind: ImageStreamTag name: ${APP_NAME}:latest resources: limits: memory: ${BUILD_MEMORY_LIMIT} requests: memory: ${BUILD_MEMORY_REQUEST} source: git: ref: ${GIT_REF} uri: ${GIT_REPO} type: Git strategy: sourceStrategy: 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} forcePull: true from: kind: ImageStreamTag name: fuse7-java-openshift:${BUILDER_VERSION} namespace: ${IMAGE_STREAM_NAMESPACE} incremental: true type: Source triggers: - github: secret: ${BUILD_SECRET} type: GitHub - generic: secret: ${BUILD_SECRET} type: Generic - type: ConfigChange - imageChange: {} type: ImageChange status: lastVersion: 0 # --------------- deploymentConfig - apiVersion: v1 kind: DeploymentConfig metadata: creationTimestamp: null labels: app: ${APP_NAME} component: ${APP_NAME} group: ${APP_GROUP} provider: s2i version: ${APP_VERSION} name: ${APP_NAME} spec: replicas: 1 selector: app: ${APP_NAME} component: ${APP_NAME} deploymentconfig: ${APP_NAME} group: ${APP_GROUP} provider: s2i version: ${APP_VERSION} template: metadata: creationTimestamp: null labels: app: ${APP_NAME} component: ${APP_NAME} deploymentconfig: ${APP_NAME} group: ${APP_GROUP} provider: s2i version: ${APP_VERSION} spec: containers: - env: - name: KUBERNETES_NAMESPACE valueFrom: fieldRef: fieldPath: metadata.namespace image: library/${APP_NAME}:latest livenessProbe: httpGet: path: /health port: 8081 initialDelaySeconds: 180 name: ${APP_NAME} ports: - containerPort: 8778 name: jolokia readinessProbe: httpGet: path: /health port: 8081 initialDelaySeconds: 10 resources: limits: cpu: ${CPU_LIMIT} memory: ${MEMORY_LIMIT} requests: cpu: ${CPU_REQUEST} memory: ${MEMORY_REQUEST} triggers: - type: ConfigChange - imageChangeParams: automatic: true containerNames: - ${APP_NAME} from: kind: ImageStreamTag name: ${APP_NAME}:latest type: ImageChange # --------------- com.microservices.apigateway.security.service - apiVersion: v1 kind: Service metadata: annotations: prometheus.io/scrape: "true" prometheus.io/port: "9779" labels: expose: "true" app: ${APP_NAME} provider: s2i version: ${APP_VERSION} group: ${APP_GROUP} name: ${APP_NAME} spec: ports: - name: http port: 8080 protocol: TCP targetPort: 8080 selector: app: ${APP_NAME} provider: s2i group: ${APP_GROUP} type: ClusterIP sessionAffinity: "None" - apiVersion: v1 kind: Service metadata: annotations: prometheus.io/scrape: "true" prometheus.io/port: "9779" labels: expose: "true" app: ${APP_NAME} provider: s2i version: ${APP_VERSION} group: ${APP_GROUP} name: ${APP_NAME}-metrics spec: ports: - name: http port: 8081 protocol: TCP targetPort: 8081 selector: app: ${APP_NAME} provider: s2i group: ${APP_GROUP} type: ClusterIP sessionAffinity: "None" # --------------- route com.microservices.apigateway.security.configuration block (only 8080 will be exposed) - apiVersion: route.openshift.io/v1 kind: Route metadata: labels: expose: "true" app: ${APP_NAME} provider: s2i version: ${APP_VERSION} group: ${APP_GROUP} name: ${APP_NAME} spec: port: targetPort: http to: kind: Service name: ${APP_NAME} parameters: - description: The name assigned to the application. displayName: Application Name name: APP_NAME required: true value: s2i-fuse74-spring-boot-camel - description: The URL of the com.microservices.apigateway.security.repository with your application source code. displayName: Git Repository URL name: GIT_REPO required: true value: https://github.com/fabric8-quickstarts/spring-boot-camel.git - description: Set this to a branch name, tag or other ref of your com.microservices.apigateway.security.repository if you are not using the default branch. displayName: Git Reference name: GIT_REF value: spring-boot-camel-1.0.0.fuse-740016-redhat-00002 - description: The version of the FIS S2I builder image to use. displayName: Builder version name: BUILDER_VERSION value: "1.4" - description: The application version. displayName: Application Version name: APP_VERSION value: 1.0.0.fuse-740016-redhat-00002 - description: Arguments passed to mvn in the build. displayName: Maven Arguments name: MAVEN_ARGS value: package -DskipTests -Dfabric8.skip -e -B - description: Extra arguments passed to mvn, e.g. for multi-module builds. displayName: Extra Maven Arguments name: MAVEN_ARGS_APPEND - description: Directory of the artifact to be built, e.g. for multi-module builds. displayName: Maven build directory name: ARTIFACT_DIR - 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. displayName: Image Stream Namespace name: IMAGE_STREAM_NAMESPACE required: true value: openshift - description: The secret needed to trigger a build. displayName: Git Build Secret from: '[a-zA-Z0-9]{40}' generate: expression name: BUILD_SECRET - description: The amount of CPU to request. displayName: CPU request name: CPU_REQUEST required: true value: "0.2" - description: The amount of memory required for the container to run. displayName: Memory request name: MEMORY_REQUEST required: true value: 256Mi - description: The amount of CPU the container is limited to use. displayName: CPU limit name: CPU_LIMIT required: true value: "1.0" - description: The amount of memory the container is limited to use. displayName: Memory limit name: MEMORY_LIMIT required: true value: 256Mi - description: The amount of memory to request for builds. displayName: Build Memory request name: BUILD_MEMORY_REQUEST required: true value: 0.7G - description: The amount of memory the build container is limited to use. displayName: Build Memory limit name: BUILD_MEMORY_LIMIT required: true value: 0.8G - description: The application group, e.g. com.redhat.blueprint, com.redhat.microservices. displayName: Application Group name: APP_GROUP value: com.redhat.microservices