initial commit with apps from course repo
This commit is contained in:
15
camel-timer/src/main/fabric8/deployment.yml
Normal file
15
camel-timer/src/main/fabric8/deployment.yml
Normal file
@@ -0,0 +1,15 @@
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
-
|
||||
resources:
|
||||
requests:
|
||||
cpu: "0.2"
|
||||
# memory: 256Mi
|
||||
limits:
|
||||
cpu: "1.0"
|
||||
# memory: 256Mi
|
||||
env:
|
||||
- name: SPRING_APPLICATION_JSON
|
||||
value: '{"server":{"tomcat":{"max-threads":1}}}'
|
||||
@@ -0,0 +1,40 @@
|
||||
/**
|
||||
* Copyright 2005-2016 Red Hat, Inc.
|
||||
*
|
||||
* Red Hat licenses this file to you under the Apache License, version
|
||||
* 2.0 (the "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
package com.redhat.training.do288.examples;
|
||||
|
||||
import org.apache.camel.builder.RouteBuilder;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.annotation.ImportResource;
|
||||
|
||||
|
||||
@SpringBootApplication
|
||||
@ImportResource({"classpath:spring/camel-context.xml"})
|
||||
public class Application extends RouteBuilder {
|
||||
|
||||
// must have a main method spring-boot can run
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(Application.class, args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configure() throws Exception {
|
||||
|
||||
from("timer://foo?period=5000")
|
||||
.setBody().constant("Hello World")
|
||||
.log(">>> ${body}");
|
||||
}
|
||||
}
|
||||
15
camel-timer/src/main/resources/application.properties
Normal file
15
camel-timer/src/main/resources/application.properties
Normal file
@@ -0,0 +1,15 @@
|
||||
logging.config=classpath:logback.xml
|
||||
|
||||
# the options from org.apache.camel.spring.boot.CamelConfigurationProperties can be configured here
|
||||
camel.springboot.name=MyCamel
|
||||
|
||||
# lets listen on all ports to ensure we can be invoked from the pod IP
|
||||
server.address=0.0.0.0
|
||||
management.address=0.0.0.0
|
||||
|
||||
# lets use a different management port in case you need to listen to HTTP requests on 8080
|
||||
management.port=8081
|
||||
|
||||
# disable all management enpoints except health
|
||||
endpoints.enabled = false
|
||||
endpoints.health.enabled = true
|
||||
17
camel-timer/src/main/resources/logback.xml
Normal file
17
camel-timer/src/main/resources/logback.xml
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE xml>
|
||||
<configuration>
|
||||
|
||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<!-- encoders are assigned the type
|
||||
ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
|
||||
<encoder>
|
||||
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<root level="info">
|
||||
<appender-ref ref="STDOUT" />
|
||||
</root>
|
||||
|
||||
</configuration>
|
||||
18
camel-timer/src/main/resources/spring/camel-context.xml
Normal file
18
camel-timer/src/main/resources/spring/camel-context.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
|
||||
|
||||
<!-- You could also define a traditional camel context here -->
|
||||
<!--
|
||||
<camelContext xmlns="http://camel.apache.org/schema/spring">
|
||||
<route>
|
||||
<from uri="timer://foo?period=1000"/>
|
||||
<setBody><simple>Hello World from camel-contex.xml</simple></setBody>
|
||||
<log message=">>> ${body}"/>
|
||||
</route>
|
||||
</camelContext>
|
||||
-->
|
||||
</beans>
|
||||
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright 2005-2016 Red Hat, Inc.
|
||||
*
|
||||
* Red Hat licenses this file to you under the Apache License, version
|
||||
* 2.0 (the "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
package io.fabric8.tests.integration;
|
||||
|
||||
import io.fabric8.kubernetes.client.KubernetesClient;
|
||||
|
||||
import org.jboss.arquillian.container.test.api.RunAsClient;
|
||||
import org.jboss.arquillian.junit.Arquillian;
|
||||
import org.jboss.arquillian.test.api.ArquillianResource;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static io.fabric8.kubernetes.assertions.Assertions.assertThat;
|
||||
|
||||
@RunWith(Arquillian.class)
|
||||
@RunAsClient
|
||||
public class KubernetesIntegrationKT {
|
||||
|
||||
@ArquillianResource
|
||||
KubernetesClient client;
|
||||
|
||||
@Test
|
||||
public void testAppProvisionsRunningPods() throws Exception {
|
||||
assertThat(client).deployments().pods().isPodReadyForPeriod();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user