├── .gitignore
├── .mvn
└── wrapper
│ ├── maven-wrapper.jar
│ └── maven-wrapper.properties
├── jenkins-ci
├── docs
│ └── images
│ │ ├── jenkins-global-read.png
│ │ ├── jenkins-install-1.png
│ │ ├── jenkins-install-2.png
│ │ ├── jenkins-install-3.png
│ │ ├── jenkins-install-4.png
│ │ ├── jenkins-job-details.png
│ │ ├── jenkins-tools-jdk8.png
│ │ ├── jenkins-github-token.png
│ │ └── jenkins-tools-maven-3_5_0.png
├── push-logs.sh
├── jaeger-agent-template.yml
├── README.md
└── Jenkinsfile
├── .travis.yml
├── header.txt
├── .github
├── PULL_REQUEST_TEMPLATE.md
└── ISSUE_TEMPLATE.md
├── all-in-one
├── src
│ └── test
│ │ ├── resources
│ │ └── arquillian.xml
│ │ └── java
│ │ └── io
│ │ └── jaegertracing
│ │ └── openshift
│ │ └── AllInOneETest.java
├── pom.xml
└── jaeger-all-in-one-template.yml
├── production
├── configmap-elasticsearch.yml
├── configmap-cassandra.yml
├── elasticsearch.yml
├── cassandra-template.yml
└── jaeger-production-template.yml
├── pom.xml
├── mvnw.cmd
├── mvnw
├── README.md
└── LICENSE
/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | *.jar
3 | !.mvn/wrapper/maven-wrapper.jar
4 | target
5 | .project
6 | .classpath
7 | .settings
8 |
--------------------------------------------------------------------------------
/.mvn/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaegertracing/jaeger-openshift/HEAD/.mvn/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.0/apache-maven-3.5.0-bin.zip
--------------------------------------------------------------------------------
/jenkins-ci/docs/images/jenkins-global-read.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaegertracing/jaeger-openshift/HEAD/jenkins-ci/docs/images/jenkins-global-read.png
--------------------------------------------------------------------------------
/jenkins-ci/docs/images/jenkins-install-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaegertracing/jaeger-openshift/HEAD/jenkins-ci/docs/images/jenkins-install-1.png
--------------------------------------------------------------------------------
/jenkins-ci/docs/images/jenkins-install-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaegertracing/jaeger-openshift/HEAD/jenkins-ci/docs/images/jenkins-install-2.png
--------------------------------------------------------------------------------
/jenkins-ci/docs/images/jenkins-install-3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaegertracing/jaeger-openshift/HEAD/jenkins-ci/docs/images/jenkins-install-3.png
--------------------------------------------------------------------------------
/jenkins-ci/docs/images/jenkins-install-4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaegertracing/jaeger-openshift/HEAD/jenkins-ci/docs/images/jenkins-install-4.png
--------------------------------------------------------------------------------
/jenkins-ci/docs/images/jenkins-job-details.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaegertracing/jaeger-openshift/HEAD/jenkins-ci/docs/images/jenkins-job-details.png
--------------------------------------------------------------------------------
/jenkins-ci/docs/images/jenkins-tools-jdk8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaegertracing/jaeger-openshift/HEAD/jenkins-ci/docs/images/jenkins-tools-jdk8.png
--------------------------------------------------------------------------------
/jenkins-ci/docs/images/jenkins-github-token.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaegertracing/jaeger-openshift/HEAD/jenkins-ci/docs/images/jenkins-github-token.png
--------------------------------------------------------------------------------
/jenkins-ci/docs/images/jenkins-tools-maven-3_5_0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaegertracing/jaeger-openshift/HEAD/jenkins-ci/docs/images/jenkins-tools-maven-3_5_0.png
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | dist: trusty
2 | sudo: required
3 |
4 | language: java
5 | jdk:
6 | - oraclejdk8
7 |
8 | cache:
9 | directories:
10 | - $HOME/.m2/repository
11 |
12 | script:
13 | - ./mvnw clean test
14 |
15 | env:
16 | global:
17 |
--------------------------------------------------------------------------------
/header.txt:
--------------------------------------------------------------------------------
1 | Copyright ${license.git.copyrightYears} The Jaeger Authors
2 |
3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
4 | in compliance with the License. You may obtain a copy of the License at
5 |
6 | http://www.apache.org/licenses/LICENSE-2.0
7 |
8 | Unless required by applicable law or agreed to in writing, software distributed under the License
9 | is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
10 | or implied. See the License for the specific language governing permissions and limitations under
11 | the License.
12 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 |
13 |
14 | ## Which problem is this PR solving?
15 | -
16 |
17 | ## Short description of the changes
18 | -
19 |
--------------------------------------------------------------------------------
/all-in-one/src/test/resources/arquillian.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/production/configmap-elasticsearch.yml:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2017-2018 The Jaeger Authors
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | # in compliance with the License. You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software distributed under the License
10 | # is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11 | # or implied. See the License for the specific language governing permissions and limitations under
12 | # the License.
13 | #
14 |
15 | apiVersion: v1
16 | kind: ConfigMap
17 | metadata:
18 | name: jaeger-configuration
19 | labels:
20 | app: jaeger
21 | jaeger-infra: configuration
22 | data:
23 | span-storage-type: elasticsearch
24 | collector: |
25 | collector:
26 | zipkin:
27 | http-port: 9411
28 | es:
29 | server-urls: http://elasticsearch:9200
30 | query: |
31 | es:
32 | server-urls: http://elasticsearch:9200
33 |
--------------------------------------------------------------------------------
/production/configmap-cassandra.yml:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2017-2018 The Jaeger Authors
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | # in compliance with the License. You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software distributed under the License
10 | # is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11 | # or implied. See the License for the specific language governing permissions and limitations under
12 | # the License.
13 | #
14 |
15 | apiVersion: v1
16 | kind: ConfigMap
17 | metadata:
18 | name: jaeger-configuration
19 | labels:
20 | app: jaeger
21 | jaeger-infra: configuration
22 | data:
23 | span-storage-type: cassandra
24 | collector: |
25 | collector:
26 | zipkin:
27 | http-port: 9411
28 | cassandra:
29 | servers: cassandra
30 | keyspace: jaeger_v1_dc1
31 | query: |
32 | cassandra:
33 | servers: cassandra
34 | keyspace: jaeger_v1_dc1
35 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 |
12 |
13 | ## Requirement - what kind of business use case are you trying to solve?
14 |
15 |
16 |
17 | ## Problem - what in Jaeger blocks you from solving the requirement?
18 |
19 |
20 |
21 |
22 | ## Proposal - what do you suggest to solve the problem or improve the existing situation?
23 |
24 |
25 |
26 | ## Any open questions to address
27 |
28 |
29 |
--------------------------------------------------------------------------------
/jenkins-ci/push-logs.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | #
3 | # Copyright 2017 The Jaeger Authors
4 | #
5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
6 | # in compliance with the License. You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software distributed under the License
11 | # is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12 | # or implied. See the License for the specific language governing permissions and limitations under
13 | # the License.
14 | #
15 |
16 | JOB_STATUS=$1
17 | if [ -n "${CHANGE_URL}" ]; then
18 | # download jq file if it is not available
19 | if [ ! -e /tmp/jq-linux64 ]; then
20 | echo "jq file not found! downloading jq to '/tmp/jq-linux64'"
21 | curl -sL https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64 > /tmp/jq-linux64
22 | chmod +x /tmp/jq-linux64
23 | fi
24 | if [ ! -e jq ]; then
25 | echo "jq file 'soft link' not found! creating it on '$(pwd)/jq'"
26 | ln -s /tmp/jq-linux64 jq
27 | fi
28 | ./jq --version
29 | consoleUrl=$(echo "${BUILD_URL}consoleText")
30 | echo "URL:[console:${consoleUrl}]"
31 | consoleLogJson=$(curl -G ${consoleUrl} --insecure | ./jq --slurp --raw-input '.')
32 | echo "{\"title\": \"${JOB_NAME}:build#${BUILD_ID}\", \"contents\": $consoleLogJson}" > consolelog.json
33 | echo "Job status: ${JOB_STATUS}"
34 | fpasteResponse=$(curl -X POST -H "Content-Type:application/json" https://paste.fedoraproject.org/api/paste/submit -d @consolelog.json)
35 | FPASTE_URL=$(echo $fpasteResponse | ./jq '.url' -r)
36 | if [ "${JOB_STATUS}" = "FAILURE" ]; then
37 | BUILD_STATUS_ICON=":red_circle:"
38 | elif [ "${JOB_STATUS}" = "SUCCESS" ]; then
39 | BUILD_STATUS_ICON=":white_check_mark:"
40 | else
41 | BUILD_STATUS_ICON=":question:"
42 | fi
43 | echo "Console log on fpaste: ${FPASTE_URL}"
44 | curl -H "Content-Type: application/json" \
45 | -u $AUTHTOKEN \
46 | -X POST \
47 | -d "{\"body\":\"${BUILD_STATUS_ICON} Jenkins CI Build\`#${BUILD_ID}\`: Console log: [external](${FPASTE_URL}), [internal](${RUN_DISPLAY_URL})\"}" \
48 | "$(echo $CHANGE_URL | sed 's/github.com/api.github.com\/repos/g; s/pull\//issues\//g;')/comments"
49 | env
50 | else
51 | echo "Looks like this not a PR request!"
52 | fi
53 |
--------------------------------------------------------------------------------
/production/elasticsearch.yml:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2017-2018 The Jaeger Authors
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | # in compliance with the License. You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software distributed under the License
10 | # is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11 | # or implied. See the License for the specific language governing permissions and limitations under
12 | # the License.
13 | #
14 |
15 | apiVersion: v1
16 | kind: List
17 | items:
18 | - apiVersion: apps/v1beta1
19 | kind: StatefulSet
20 | metadata:
21 | name: elasticsearch
22 | labels:
23 | app: jaeger
24 | jaeger-infra: elasticsearch-statefulset
25 | spec:
26 | serviceName: elasticsearch
27 | replicas: 1
28 | template:
29 | metadata:
30 | labels:
31 | app: jaeger-elasticsearch
32 | jaeger-infra: elasticsearch-replica
33 | spec:
34 | containers:
35 | - name: elasticsearch
36 | image: quay.io/pires/docker-elasticsearch-kubernetes:5.6.2
37 | imagePullPolicy: Always
38 | command:
39 | - bin/elasticsearch
40 | args:
41 | - "-Ehttp.host=0.0.0.0"
42 | - "-Etransport.host=127.0.0.1"
43 | env:
44 | - name: NODE_NAME
45 | value: master
46 | volumeMounts:
47 | - name: data
48 | mountPath: /data
49 | readinessProbe:
50 | exec:
51 | command:
52 | - wget
53 | - -O
54 | - /dev/null
55 | - localhost:9200
56 | initialDelaySeconds: 5
57 | periodSeconds: 5
58 | timeoutSeconds: 4
59 | volumes:
60 | - name: data
61 | emptyDir: {}
62 | - apiVersion: v1
63 | kind: Service
64 | metadata:
65 | name: elasticsearch
66 | labels:
67 | app: jaeger
68 | jaeger-infra: elasticsearch-service
69 | spec:
70 | clusterIP: None
71 | selector:
72 | app: jaeger-elasticsearch
73 | ports:
74 | - port: 9200
75 | name: elasticsearch
76 | - port: 9300
77 | name: transport
78 |
--------------------------------------------------------------------------------
/jenkins-ci/jaeger-agent-template.yml:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2017 The Jaeger Authors
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | # in compliance with the License. You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software distributed under the License
10 | # is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11 | # or implied. See the License for the specific language governing permissions and limitations under
12 | # the License.
13 | #
14 |
15 | apiVersion: v1
16 | kind: Template
17 | metadata:
18 | name: jaeger-agent-template
19 | annotations:
20 | description: Jaeger Agent
21 | iconClass: icon-go-gopher
22 | openshift.io/display-name: Jaeger-Agent
23 | tags: instant-app,tracing,opentracing,jaeger,agent
24 | parameters:
25 | - description: The name of the Jaeger Service.
26 | displayName: Jaeger Service Name
27 | name: JAEGER_SERVICE_NAME
28 | required: true
29 | value: jaeger
30 | - description: The Jaeger image version to use
31 | displayName: Image version
32 | name: IMAGE_VERSION
33 | required: false
34 | value: "0.5"
35 |
36 | labels:
37 | template: jaeger-agent
38 |
39 | objects:
40 | - apiVersion: v1
41 | kind: Service
42 | metadata:
43 | name: ${JAEGER_SERVICE_NAME}-agent
44 | labels:
45 | app: jaeger
46 | jaeger-infra: agent-service
47 | spec:
48 | ports:
49 | - name: agent-zipkin-thrift
50 | port: 5775
51 | protocol: UDP
52 | targetPort: 5775
53 | - name: agent-compact
54 | port: 6831
55 | protocol: UDP
56 | targetPort: 6831
57 | - name: agent-binary
58 | port: 6832
59 | protocol: UDP
60 | targetPort: 6832
61 | selector:
62 | jaeger-infra: ${JAEGER_SERVICE_NAME}-agent
63 | clusterIP: None
64 |
65 | - apiVersion: extensions/v1beta1
66 | kind: Deployment
67 | metadata:
68 | name: ${JAEGER_SERVICE_NAME}-agent
69 | labels:
70 | app: jaeger
71 | jaeger-infra: ${JAEGER_SERVICE_NAME}-agent-deployment
72 | spec:
73 | replicas: 1
74 | strategy:
75 | type: Recreate
76 | template:
77 | metadata:
78 | labels:
79 | app: jaeger
80 | jaeger-infra: ${JAEGER_SERVICE_NAME}-agent
81 | spec:
82 | containers:
83 | - name: agent-instance
84 | image: jaegertracing/jaeger-agent:${IMAGE_VERSION}
85 | imagePullPolicy: Always
86 | command:
87 | - "/go/bin/agent-linux"
88 | - "--collector.host-port=jaeger-collector:14267"
89 | ports:
90 | - containerPort: 5775
91 | protocol: UDP
92 | - containerPort: 6831
93 | protocol: UDP
94 | - containerPort: 6832
95 | protocol: UDP
96 |
--------------------------------------------------------------------------------
/all-in-one/src/test/java/io/jaegertracing/openshift/AllInOneETest.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2017 The Jaeger Authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License
10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11 | * or implied. See the License for the specific language governing permissions and limitations under
12 | * the License.
13 | */
14 | package io.jaegertracing.openshift;
15 |
16 | import static org.awaitility.Awaitility.await;
17 | import static org.junit.Assert.assertEquals;
18 | import static org.junit.Assert.assertTrue;
19 |
20 | import java.io.IOException;
21 | import java.net.URL;
22 | import java.util.concurrent.TimeUnit;
23 |
24 | import org.arquillian.cube.kubernetes.annotations.Named;
25 | import org.arquillian.cube.kubernetes.annotations.Port;
26 | import org.arquillian.cube.kubernetes.annotations.PortForward;
27 | import org.arquillian.cube.requirement.ArquillianConditionalRunner;
28 | import org.jboss.arquillian.test.api.ArquillianResource;
29 | import org.junit.Assert;
30 | import org.junit.Test;
31 | import org.junit.runner.RunWith;
32 |
33 | import brave.Tracing;
34 | import io.fabric8.kubernetes.api.model.v2_2.Service;
35 | import okhttp3.OkHttpClient;
36 | import okhttp3.Request;
37 | import okhttp3.Response;
38 | import zipkin.reporter.AsyncReporter;
39 | import zipkin.reporter.okhttp3.OkHttpSender;
40 |
41 | /**
42 | * @author Pavol Loffay
43 | */
44 | @RunWith(ArquillianConditionalRunner.class)
45 | public class AllInOneETest {
46 | private static final String SERVICE_NAME = "jaeger-query";
47 | private static final String ZIPKIN_SERVICE_NAME = "zipkin";
48 |
49 | private OkHttpClient okHttpClient = new OkHttpClient.Builder()
50 | .build();
51 |
52 | @Named(SERVICE_NAME)
53 | @ArquillianResource
54 | private Service jaegerService;
55 |
56 | @Named(SERVICE_NAME)
57 | @PortForward
58 | @ArquillianResource
59 | private URL jaegerUiUrl;
60 |
61 | @Port(9411)
62 | @Named(ZIPKIN_SERVICE_NAME)
63 | @PortForward
64 | @ArquillianResource
65 | private URL zipkinUrl;
66 |
67 | @Test
68 | public void testUiResponds() throws IOException, InterruptedException {
69 | Request request = new Request.Builder()
70 | .url(jaegerUiUrl)
71 | .get()
72 | .build();
73 |
74 | try (Response response = okHttpClient.newCall(request).execute()) {
75 | Assert.assertEquals(200, response.code());
76 | }
77 | }
78 |
79 | @Test
80 | public void testReportZipkinSpanToCollector() throws IOException, InterruptedException {
81 | Tracing tracing = createZipkinTracer("service2");
82 | tracing.tracer().newTrace().name("foo").start().finish();
83 | tracing.close();
84 |
85 | Request request = new Request.Builder()
86 | .url(jaegerUiUrl + "api/traces?service=service2")
87 | .get()
88 | .build();
89 |
90 | await().atMost(5, TimeUnit.SECONDS).until(() -> {
91 | Response response = okHttpClient.newCall(request).execute();
92 | String body = response.body().string();
93 | return body.contains("foo");
94 | });
95 |
96 | try (Response response = okHttpClient.newCall(request).execute()) {
97 | assertEquals(200, response.code());
98 | assertTrue(response.body().string().contains("foo"));
99 | }
100 | }
101 |
102 | protected Tracing createZipkinTracer(String serviceName) {
103 | return Tracing.newBuilder()
104 | .localServiceName(serviceName)
105 | .reporter(AsyncReporter.builder(OkHttpSender.create(zipkinUrl + "api/v1/spans"))
106 | .build()).build();
107 | }
108 | }
109 |
--------------------------------------------------------------------------------
/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 | 4.0.0
19 | io.jaegertracing.openshift
20 | jaegertracing-openshift-parent
21 | 0.0.1-SNAPSHOT
22 | pom
23 |
24 |
25 | 1.8
26 | 1.8
27 | UTF-8
28 | UTF-8
29 | ${project.basedir}
30 |
31 | 3.8.0
32 | 4.5.1
33 | 1.0.0
34 | 4.12
35 | 3.0.0
36 | 1.4.0
37 | 1.1.13.Final
38 |
39 |
40 | 3.0
41 | 1.6.0
42 | 0.3.4
43 | 2.20
44 | 2.20
45 |
46 |
47 | 2017
48 |
49 |
50 | all-in-one
51 |
52 |
53 |
54 |
55 |
56 | org.arquillian.cube
57 | arquillian-cube-bom
58 | ${version.org.arquillian.cube}
59 | import
60 | pom
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 | io.takari
71 | maven
72 | ${version.maven-plugin}
73 |
74 |
75 |
76 |
77 |
78 | com.mycila
79 | license-maven-plugin
80 | ${version.maven-license-plugin}
81 |
82 | ${rootProject.basedir}/header.txt
83 |
84 | .travis.yml
85 | .gitignore
86 | .mvn/**
87 | mvnw*
88 | header.txt
89 | LICENSE
90 | **/*.md
91 | jenkins-ci/Jenkinsfile
92 |
93 | true
94 |
95 |
96 |
97 | com.mycila
98 | license-maven-plugin-git
99 | ${version.maven-license-plugin}
100 |
101 |
102 |
103 |
104 |
105 | check
106 |
107 | compile
108 |
109 |
110 |
111 |
112 | maven-surefire-plugin
113 | ${version.maven-surefire-plugin}
114 |
115 | true
116 |
117 |
118 |
119 |
120 |
121 |
--------------------------------------------------------------------------------
/all-in-one/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 | 4.0.0
19 |
20 | io.jaegertracing.openshift
21 | jaegertracing-openshift-parent
22 | 0.0.1-SNAPSHOT
23 |
24 |
25 |
26 | ${project.basedir}/..
27 | jaeger-all-in-one-template.yml
28 |
29 |
30 | jaegertracing-openshift-all-in-one
31 |
32 |
33 |
34 | org.jboss.arquillian.junit
35 | arquillian-junit-standalone
36 | ${version.org.jboss.arquillian}
37 | test
38 |
39 |
40 | org.arquillian.cube
41 | arquillian-cube-requirement
42 | test
43 |
44 |
45 | org.arquillian.cube
46 | arquillian-cube-openshift
47 | test
48 |
49 |
50 |
51 | io.zipkin.brave
52 | brave
53 | ${version.io.zipkin.brave}
54 | test
55 |
56 |
57 | io.zipkin.reporter
58 | zipkin-sender-okhttp3
59 | ${version.io.zipkin.reporter}
60 | test
61 |
62 |
63 |
64 | com.squareup.okhttp3
65 | okhttp
66 | ${version.com.squareup.okhttp3-okhttp}
67 | test
68 |
69 |
70 | org.awaitility
71 | awaitility
72 | ${version.org.awaitility-awaitility}
73 | test
74 |
75 |
76 |
77 |
78 |
79 | e2e
80 |
81 |
82 |
83 |
84 | org.codehaus.mojo
85 | exec-maven-plugin
86 | ${version.maven-exec-plugin}
87 |
88 |
89 | process-oc-template
90 | process-test-resources
91 |
92 | exec
93 |
94 |
95 | oc
96 | process -f ${project.basedir}/${template.name} -o=yaml
97 | ${project.build.testOutputDirectory}/${template.name}
98 |
99 |
100 |
101 |
102 |
103 | maven-failsafe-plugin
104 | ${version.maven-failsafe-plugin}
105 |
106 |
107 | run-integration-tests
108 |
109 | integration-test
110 |
111 |
112 |
113 | **/*ETest.java
114 |
115 |
116 |
117 | env.config.resource.name
118 | ${template.name}
119 |
120 |
121 |
122 |
123 |
124 | verify
125 |
126 | verify
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
--------------------------------------------------------------------------------
/jenkins-ci/README.md:
--------------------------------------------------------------------------------
1 | # Jenkins CI
2 | This module can be used to run basic tests of the Jaeger all-in-one and production templates for OpenShift. The `Jenkinsfile`
3 | can be used to deploy Jaeger to OpenShift using each of these templates and verify them by running a basic set of
4 | functional tests from [jaeger-java-test](https://github.com/Hawkular-QE/jaeger-java-test) repository.
5 |
6 | ## How to setup Jenkins CI
7 | These test require an OpenShift instance of version 3.6.0 or later. See [openshift](https://github.com/openshift/origin)
8 | for more information.
9 |
10 | ### Create a Jenkins instance on OpenShift
11 | OpenShift offers two versions of Jenkins, one with persistent storage and the other with ephemeral storage. These instructions
12 | use the ephemeral version, but the persistent version would be preferred. For more information on Jenkins on Openshift see [this page](https://github.com/openshift/origin/tree/master/examples/jenkins)
13 |
14 | NOTE: Jenkins on OpenShift defaults to using `512Mi` of memory. These tests require a minimum of `1024Mi` but `2048Mi` may be preferred.
15 |
16 | * If necessary create an OpenShift user for running these tests
17 | * Login to the OpenShift console
18 | * Create a project for testing. (The name `jaeger-ci` is used below but is not required)
19 | * Click on `Add to project` and follow the screens below.
20 |
21 | 
22 |
23 | 
24 |
25 | 
26 |
27 | 
28 |
29 | ### Update Jenkins plugins
30 | * Login to Jenkins using the link that appears in your new project in the openshift console or get the ip address
31 | from the `oc get routes` command.
32 | * Update all of the plugins by clicking on `Manage Jenkins` and `Manage Plugins`. Click the `All` link next to `Select`
33 | at the bottom of the page, then click the `Download now and install after restart` button. Finally check the `Restart Jenkins...`
34 | checkbox. Jenkins will install all required updates and restart. This make take a few minutes.
35 |
36 | ### Setup Jenkins tools [`maven-3.5.0` and `jdk8`]
37 | * Log back into Jenkins
38 | * Go to `Manage Jenkins` >> `Global Tool Configuration`
39 | * Under `JDK` click `JDK installations...` and add the latest JDK8 version with the name `jdk8`. Don't forget to click
40 | the license checkbox.
41 | * Under `Maven` click `Maven installations`. Add maven 3.5.0 and name it `maven-3.5.0`.
42 |
43 | NOTE: The names `jdk8` and `maven-3.5.0` are used in the Jenkinsfile. If you wish to move to newer versions, they
44 | will need to be changed there also.
45 |
46 | 
47 |
48 | 
49 |
50 |
51 | ### Enable Anonymous read permission on Jenkins server
52 | We have a [script](push-logs.sh) to publish console log to the world from internal Jenkins server.
53 | This requires global anonymous read permission.
54 |
55 | * Login to Jenkins console
56 | * Go to `Manage Jenkins` >> `Configure Global Security`
57 | * Under the section `Access Control`, `Authorization`, `Matrix based security` enable `read` permission for `Anonymous` user
58 | in both the `Overall` and `Job` categories
59 | * Click on the `Save` button at the bottom of the page.
60 |
61 | 
62 |
63 | ### Setup GitHub access token on Jenkins server credentials
64 | To publish PR status and console log back to GitHub, Jenkins needs GitHub authentication token with required permission.
65 | To create GitHub access token follow [this document](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/)
66 |
67 | When creating the token, choose the following permissions under `Select scopes`
68 | * repo
69 | * admin:repo_hook
70 | * notifications
71 |
72 | Then create a credential on Jenkins:
73 |
74 | * Login to Jenkins console
75 | * Go to `Credentials` >> `System` >> `Global credentials (unrestricted)` >> `Add Credentials`
76 | * Select `Kind` as `Username with password`
77 | * Enter GitHub username on `Username` field
78 | * Enter GitHub access token on `Password` field
79 | * Enter `jaegertracing_gh_token` on `ID` field. (**Important:** `jaegertracing_gh_token` id is required by [Jenkinsfile](Jenkinsfile).
80 | Do not use different ID or leave this field as blank)
81 | * To save this configuration click on `OK` button.
82 |
83 | 
84 |
85 | ### Create Jenkins job with existing pipeline scripts
86 | Jenkins pipeline script is located [here](/jenkins-ci/Jenkinsfile)
87 |
88 | * Login to Jenkins console
89 | * Click on `New Item`
90 | * Enter `Enter an item name` (for example: jaegertracing-ci)
91 | * Select project type as `Multibranch Pipeline` and click `OK`
92 | * Set the project source
93 | * Under `Branch Sources` click `Add source` and select `GitHub`
94 | * Select the user created above in the`Credentials` box
95 | * Enter `jaegertracing` as the owner
96 | * Select `jaeger-openshift` in the `Repository` field
97 | * Under `Scan Multibranch Pipeline Triggers` click on the checkbox next to `Periodically if not otherwise run` and then
98 | set the `Interval` to `1 minute`
99 | * Under `Build Configuration` >> `Mode` change `Script Path` to `jenkins-ci/Jenkinsfile`
100 | * Under `Orphaned Item Strategy` set `Discard old items` as needed, depending on how much storage you have available.
101 | * Save the project
102 |
103 | 
104 |
105 | All set ready :)
--------------------------------------------------------------------------------
/mvnw.cmd:
--------------------------------------------------------------------------------
1 | @REM ----------------------------------------------------------------------------
2 | @REM Licensed to the Apache Software Foundation (ASF) under one
3 | @REM or more contributor license agreements. See the NOTICE file
4 | @REM distributed with this work for additional information
5 | @REM regarding copyright ownership. The ASF licenses this file
6 | @REM to you under the Apache License, Version 2.0 (the
7 | @REM "License"); you may not use this file except in compliance
8 | @REM with the License. You may obtain a copy of the License at
9 | @REM
10 | @REM http://www.apache.org/licenses/LICENSE-2.0
11 | @REM
12 | @REM Unless required by applicable law or agreed to in writing,
13 | @REM software distributed under the License is distributed on an
14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | @REM KIND, either express or implied. See the License for the
16 | @REM specific language governing permissions and limitations
17 | @REM under the License.
18 | @REM ----------------------------------------------------------------------------
19 |
20 | @REM ----------------------------------------------------------------------------
21 | @REM Maven2 Start Up Batch script
22 | @REM
23 | @REM Required ENV vars:
24 | @REM JAVA_HOME - location of a JDK home dir
25 | @REM
26 | @REM Optional ENV vars
27 | @REM M2_HOME - location of maven2's installed home dir
28 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
29 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
30 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
31 | @REM e.g. to debug Maven itself, use
32 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
33 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
34 | @REM ----------------------------------------------------------------------------
35 |
36 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
37 | @echo off
38 | @REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
39 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
40 |
41 | @REM set %HOME% to equivalent of $HOME
42 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
43 |
44 | @REM Execute a user defined script before this one
45 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
46 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending
47 | if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
48 | if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
49 | :skipRcPre
50 |
51 | @setlocal
52 |
53 | set ERROR_CODE=0
54 |
55 | @REM To isolate internal variables from possible post scripts, we use another setlocal
56 | @setlocal
57 |
58 | @REM ==== START VALIDATION ====
59 | if not "%JAVA_HOME%" == "" goto OkJHome
60 |
61 | echo.
62 | echo Error: JAVA_HOME not found in your environment. >&2
63 | echo Please set the JAVA_HOME variable in your environment to match the >&2
64 | echo location of your Java installation. >&2
65 | echo.
66 | goto error
67 |
68 | :OkJHome
69 | if exist "%JAVA_HOME%\bin\java.exe" goto init
70 |
71 | echo.
72 | echo Error: JAVA_HOME is set to an invalid directory. >&2
73 | echo JAVA_HOME = "%JAVA_HOME%" >&2
74 | echo Please set the JAVA_HOME variable in your environment to match the >&2
75 | echo location of your Java installation. >&2
76 | echo.
77 | goto error
78 |
79 | @REM ==== END VALIDATION ====
80 |
81 | :init
82 |
83 | set MAVEN_CMD_LINE_ARGS=%MAVEN_CONFIG% %*
84 |
85 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
86 | @REM Fallback to current working directory if not found.
87 |
88 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
89 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
90 |
91 | set EXEC_DIR=%CD%
92 | set WDIR=%EXEC_DIR%
93 | :findBaseDir
94 | IF EXIST "%WDIR%"\.mvn goto baseDirFound
95 | cd ..
96 | IF "%WDIR%"=="%CD%" goto baseDirNotFound
97 | set WDIR=%CD%
98 | goto findBaseDir
99 |
100 | :baseDirFound
101 | set MAVEN_PROJECTBASEDIR=%WDIR%
102 | cd "%EXEC_DIR%"
103 | goto endDetectBaseDir
104 |
105 | :baseDirNotFound
106 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
107 | cd "%EXEC_DIR%"
108 |
109 | :endDetectBaseDir
110 |
111 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
112 |
113 | @setlocal EnableExtensions EnableDelayedExpansion
114 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
115 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
116 |
117 | :endReadAdditionalConfig
118 |
119 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
120 |
121 | set WRAPPER_JAR=""%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar""
122 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
123 |
124 | # avoid using MAVEN_CMD_LINE_ARGS below since that would loose parameter escaping in %*
125 | %MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
126 | if ERRORLEVEL 1 goto error
127 | goto end
128 |
129 | :error
130 | set ERROR_CODE=1
131 |
132 | :end
133 | @endlocal & set ERROR_CODE=%ERROR_CODE%
134 |
135 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
136 | @REM check for post script, once with legacy .bat ending and once with .cmd ending
137 | if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
138 | if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
139 | :skipRcPost
140 |
141 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
142 | if "%MAVEN_BATCH_PAUSE%" == "on" pause
143 |
144 | if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
145 |
146 | exit /B %ERROR_CODE%
147 |
--------------------------------------------------------------------------------
/jenkins-ci/Jenkinsfile:
--------------------------------------------------------------------------------
1 | pipeline {
2 | agent any
3 |
4 | options {
5 | disableConcurrentBuilds()
6 | timeout(time: 1, unit: 'HOURS')
7 | }
8 | tools {
9 | maven 'maven-3.5.3'
10 | jdk 'jdk8'
11 | }
12 | environment {
13 | JAEGER_QUERY_HOST="jaeger-query"
14 | JAEGER_AGENT_HOST="jaeger-agent"
15 | JAEGER_COLLECTOR_HOST="jaeger-collector"
16 | JAEGER_PORT_QUERY_HTTP=80
17 | JAEGER_PORT_AGENT_ZIPKIN_THRIFT=5775
18 | JAEGER_PORT_AGENT_COMPACT=6831
19 | JAEGER_PORT_AGENT_BINARY=6832
20 | JAEGER_PORT_ZIPKIN_COLLECTOR=14268
21 | }
22 | stages {
23 | stage('Clean all') {
24 | steps {
25 | sh '''
26 | cat << EOF > cleanup.sh
27 | oc delete -f https://raw.githubusercontent.com/RHsyseng/docker-rhel-elasticsearch/5.x/es-cluster-deployment.yml --grace-period=1 || true
28 | oc delete all,template,daemonset,configmap -l jaeger-infra
29 | EOF
30 | chmod +x cleanup.sh
31 | ./cleanup.sh
32 | '''
33 |
34 | }
35 | }
36 | stage('all-in-one: deploy Jaeger') {
37 | steps {
38 | checkout scm
39 | sh 'oc process -f all-in-one/jaeger-all-in-one-template.yml | oc create -f -'
40 | openshiftVerifyService apiURL: '', authToken: '', namespace: '', svcName: 'jaeger-query', verbose: 'false'
41 | openshiftVerifyService apiURL: '', authToken: '', namespace: '', svcName: 'jaeger-collector', verbose: 'false'
42 | }
43 | }
44 | stage('all-in-one: functional test'){
45 | steps{
46 | sh '''
47 | export USE_COLLECTOR_OR_AGENT=agent
48 | rm ./jaeger-java-test -rf
49 | git clone https://github.com/Kiali-QE/jaeger-java-test.git
50 | cd jaeger-java-test
51 | mvn -Dsurefire.rerunFailingTestsCount=2 clean test
52 | '''
53 | }
54 | }
55 | stage('all-in-one: delete all') {
56 | steps {
57 | sh './cleanup.sh'
58 | }
59 | }
60 | stage('production-cassandra: deploy Cassandra') {
61 | steps {
62 | sh 'oc create -f production/cassandra.yml'
63 | }
64 | }
65 | /* TODO if possible verify Cassandra deployment before proceeding */
66 | stage('production-cassandra: deploy Jaeger') {
67 | steps {
68 | sh 'oc create -f production/configmap-cassandra.yml'
69 | sh 'oc process -f production/jaeger-production-template.yml | oc create -f -'
70 | openshiftVerifyService apiURL: '', authToken: '', namespace: '', svcName: 'jaeger-collector', verbose: 'false'
71 | openshiftVerifyService apiURL: '', authToken: '', namespace: '', svcName: 'jaeger-query', verbose: 'false'
72 | }
73 | }
74 | stage('production-cassandra: functional test'){
75 | steps{
76 | sh '''
77 | export USE_COLLECTOR_OR_AGENT=collector
78 | cd jaeger-java-test
79 | mvn -Dsurefire.rerunFailingTestsCount=2 clean test
80 | '''
81 | }
82 | }
83 | stage('production-cassandra: delete all') {
84 | steps {
85 | sh './cleanup.sh'
86 | }
87 | }
88 | /* TODO get namespace from environment */
89 | stage('production-elastic: deploy elasticsearch') {
90 | steps {
91 | sh 'oc create -f https://raw.githubusercontent.com/RHsyseng/docker-rhel-elasticsearch/5.x/es-cluster-deployment.yml'
92 | sh '''
93 | while true; do
94 | replicas=$(oc get statefulset/elasticsearch -o=jsonpath='{.status.readyReplicas}')
95 | ((replicas > 1)) && break
96 | sleep 1
97 | done
98 | '''
99 | }
100 | }
101 | stage('production-elastic: deploy Jaeger') {
102 | steps {
103 | sh 'oc create -f production/configmap-elasticsearch.yml'
104 | sh 'oc process -f production/jaeger-production-template.yml | oc create -f -'
105 | openshiftVerifyService apiURL: '', authToken: '', namespace: '', svcName: 'jaeger-collector', verbose: 'false'
106 | openshiftVerifyService apiURL: '', authToken: '', namespace: '', svcName: 'jaeger-query', verbose: 'false'
107 | }
108 | }
109 | stage('production-elastic: functional test'){
110 | steps {
111 | sh '''
112 | export USE_COLLECTOR_OR_AGENT=collector
113 | cd jaeger-java-test
114 | mvn -Dsurefire.rerunFailingTestsCount=2 clean test
115 | '''
116 | }
117 | }
118 | stage('production-elastic: functional test with edge route'){
119 | steps{
120 | sh '''
121 | export USE_COLLECTOR_OR_AGENT=collector
122 | oc create route edge --service=jaeger-collector --port jaeger-collector-http --insecure-policy=Allow
123 | export JAEGER_COLLECTOR_HOST=`oc get route jaeger-collector --output=go-template={{.spec.host}}`
124 | export JAEGER_PORT_ZIPKIN_COLLECTOR=80
125 | cd jaeger-java-test
126 | mvn -Dsurefire.rerunFailingTestsCount=2 clean test
127 | '''
128 | }
129 | }
130 | stage('production-elastic: delete all') {
131 | steps {
132 | sh './cleanup.sh'
133 | }
134 | }
135 | }
136 |
137 | post {
138 | always {
139 | sh '''
140 | ./cleanup.sh
141 | chmod +x jenkins-ci/push-logs.sh
142 | '''
143 | }
144 | failure {
145 | withCredentials([usernameColonPassword(credentialsId: 'jaegertracing_gh_token', variable: 'AUTHTOKEN')]) {
146 | sh '''
147 | cd jenkins-ci
148 | ./push-logs.sh "FAILURE"
149 | '''
150 | }
151 | }
152 | success {
153 | withCredentials([usernameColonPassword(credentialsId: 'jaegertracing_gh_token', variable: 'AUTHTOKEN')]) {
154 | sh '''
155 | cd jenkins-ci
156 | ./push-logs.sh "SUCCESS"
157 | '''
158 | }
159 | }
160 | }
161 | }
162 |
--------------------------------------------------------------------------------
/production/cassandra-template.yml:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2017-2018 The Jaeger Authors
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | # in compliance with the License. You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software distributed under the License
10 | # is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11 | # or implied. See the License for the specific language governing permissions and limitations under
12 | # the License.
13 | #
14 |
15 | parameters:
16 | - description: The name of the storage class for the Cassandra data PVC
17 | displayName: Cassandra data volume Storage Class Name
18 | name: DATA_STORAGE_CLASS
19 | - description: Size of each Cassandra data PVC. Must end with Mi, Gi, Ti
20 | displayName: Cassandra data volume size
21 | name: DATA_STORAGE_REQUEST_SIZE
22 | required: false
23 | value: "200Mi"
24 | - description: The name of the storage class for the Cassandra logs PVC
25 | displayName: Cassandra logs volume Storage Class Name
26 | name: LOGS_STORAGE_CLASS
27 | - description: Size of each Cassandra log PVC. Must end with Mi, Gi, Ti
28 | displayName: Cassandra log volume size
29 | name: LOGS_STORAGE_REQUEST_SIZE
30 | required: false
31 | value: "200Mi"
32 | - description: The name of the Cassandra Service
33 | displayName: Cassandra Service Name
34 | name: CASSANDRA_SERVICE_NAME
35 | required: true
36 | value: cassandra
37 | - description: Size of Java max heap size (must end with M or G)
38 | displayName: Cassandra Java max heap size
39 | name: CASSANDRA_MAX_HEAP_SIZE
40 | required: true
41 | value: 2048M
42 | - description: Size of new heaps in Java for Cassandra (must end with M or G)
43 | displayName: Cassandra Java heap new size
44 | name: CASSANDRA_HEAP_NEWSIZE
45 | required: true
46 | value: 512M
47 | - description: Name of the cluster
48 | displayName: Cassandra cluster name
49 | name: CASSANDRA_CLUSTER_NAME
50 | required: true
51 | value: "jaeger"
52 | - description: Name of the DC in Cassandra
53 | displayName: Cassandra DC name
54 | name: CASSANDRA_DC
55 | required: true
56 | value: "dc1"
57 | - description: Name of the rack in Cassandra
58 | displayName: Cassandra Rack name
59 | name: CASSANDRA_RACK
60 | required: true
61 | value: "rack1"
62 | - description: Number of Cassandra replicas
63 | displayName: Cassandra Replica count
64 | name: REPLICA_COUNT
65 | required: true
66 | value: "3"
67 |
68 | apiVersion: v1
69 | kind: Template
70 | metadata:
71 | creationTimestamp: null
72 | name: cassandra
73 | objects:
74 | - apiVersion: v1
75 | kind: Service
76 | metadata:
77 | name: ${CASSANDRA_SERVICE_NAME}
78 | labels:
79 | app: jaeger
80 | name: jaeger-cassandra-service
81 | jaeger-infra: cassandra-service
82 | spec:
83 | ports:
84 | - port: 7000
85 | name: intra-node
86 | - port: 7001
87 | name: tls-intra-node
88 | - port: 7199
89 | name: jmx
90 | - port: 9042
91 | name: cql
92 | - port: 9160
93 | name: thrift
94 | clusterIP: None
95 | selector:
96 | app: cassandra
97 | - apiVersion: "apps/v1beta1"
98 | kind: StatefulSet
99 | metadata:
100 | name: ${CASSANDRA_SERVICE_NAME}
101 | labels:
102 | app: jaeger
103 | jaeger-infra: cassandra-statefulset
104 | spec:
105 | serviceName: ${CASSANDRA_SERVICE_NAME}
106 | replicas: ${REPLICA_COUNT}
107 | revisionHistoryLimit: 10
108 | selector:
109 | matchLabels:
110 | app: cassandra
111 | jaeger-infra: cassandra-replica
112 | template:
113 | metadata:
114 | labels:
115 | app: cassandra
116 | jaeger-infra: cassandra-replica
117 | spec:
118 | terminationGracePeriodSeconds: 1800
119 | containers:
120 | - name: ${CASSANDRA_SERVICE_NAME}
121 | image: cassandra:3.11
122 | command:
123 | - /docker-entrypoint.sh
124 | - "-R"
125 | ports:
126 | - containerPort: 7000
127 | name: intra-node
128 | - containerPort: 7001
129 | name: tls-intra-node
130 | - containerPort: 7199
131 | name: jmx
132 | - containerPort: 9042
133 | name: cql
134 | - containerPort: 9160
135 | name: thrift
136 | lifecycle:
137 | preStop:
138 | exec:
139 | command: ["/bin/sh", "-c", "nodetool drain"]
140 | env:
141 | - name: MAX_HEAP_SIZE
142 | value: ${CASSANDRA_MAX_HEAP_SIZE}
143 | - name: HEAP_NEWSIZE
144 | value: ${CASSANDRA_HEAP_NEWSIZE}
145 | - name: CASSANDRA_LISTEN_ADDRESS
146 | valueFrom:
147 | fieldRef:
148 | fieldPath: status.podIP
149 | - name: CASSANDRA_CLUSTER_NAME
150 | value: "${CASSANDRA_CLUSTER_NAME}"
151 | - name: CASSANDRA_DC
152 | value: "${CASSANDRA_DC}"
153 | - name: CASSANDRA_RACK
154 | value: "${CASSANDRA_RACK}"
155 | - name: CASSANDRA_ENDPOINT_SNITCH
156 | value: "GossipingPropertyFileSnitch"
157 | - name: CASSANDRA_SEEDS
158 | value: cassandra-0.cassandra
159 | volumeMounts:
160 | - name: ${CASSANDRA_SERVICE_NAME}-data
161 | mountPath: /var/lib/cassandra
162 | - name: ${CASSANDRA_SERVICE_NAME}-logs
163 | mountPath: /var/log/cassandra
164 | volumeClaimTemplates:
165 | - metadata:
166 | name: ${CASSANDRA_SERVICE_NAME}-data
167 | spec:
168 | accessModes:
169 | - ReadWriteOnce
170 | storageClassName: ${DATA_STORAGE_CLASS}
171 | resources:
172 | requests:
173 | storage: ${DATA_STORAGE_REQUEST_SIZE}
174 | status:
175 | phase: Pending
176 | - metadata:
177 | name: ${CASSANDRA_SERVICE_NAME}-logs
178 | spec:
179 | accessModes:
180 | - ReadWriteOnce
181 | storageClassName: ${LOGS_STORAGE_CLASS}
182 | resources:
183 | requests:
184 | storage: ${LOGS_STORAGE_REQUEST_SIZE}
185 | - apiVersion: batch/v1
186 | kind: Job
187 | metadata:
188 | name: jaeger-cassandra-schema-job
189 | labels:
190 | app: jaeger
191 | jaeger-infra: cassandra-schema-job
192 | spec:
193 | activeDeadlineSeconds: 120
194 | template:
195 | metadata:
196 | name: cassandra-schema
197 | spec:
198 | containers:
199 | - name: jaeger-cassandra-schema
200 | image: jaegertracing/jaeger-cassandra-schema:1.6
201 | env:
202 | - name: MODE
203 | value: "prod"
204 | - name: DATACENTER
205 | value: "dc1"
206 | restartPolicy: OnFailure
207 |
--------------------------------------------------------------------------------
/production/jaeger-production-template.yml:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2017-2018 The Jaeger Authors
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | # in compliance with the License. You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software distributed under the License
10 | # is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11 | # or implied. See the License for the specific language governing permissions and limitations under
12 | # the License.
13 | #
14 |
15 | parameters:
16 | - description: The name of the Jaeger Service.
17 | displayName: Jaeger Service Name
18 | name: JAEGER_SERVICE_NAME
19 | required: true
20 | value: jaeger
21 | - description: The Jaeger image version to use
22 | displayName: Image version
23 | name: IMAGE_VERSION
24 | required: false
25 | value: "1.8"
26 | - description: The name of the Jaeger Zipkin Service.
27 | displayName: Jaeger Zipkin Service Name
28 | name: JAEGER_ZIPKIN_SERVICE_NAME
29 | required: true
30 | value: zipkin
31 |
32 | apiVersion: v1
33 | kind: Template
34 | labels:
35 | app: jaeger
36 | template: jaeger-template
37 | jaeger-infra: template
38 | metadata:
39 | name: jaeger-template
40 | annotations:
41 | description: Jaeger Distributed Tracing Server
42 | iconClass: icon-go-gopher
43 | openshift.io/display-name: Jaeger (production)
44 | tags: instant-app,tracing,opentracing,jaeger
45 | labels:
46 | app: jaeger
47 | name: jaeger-infra
48 | jaeger-infra: template-production
49 | objects:
50 | - apiVersion: extensions/v1beta1
51 | kind: Deployment
52 | metadata:
53 | name: ${JAEGER_SERVICE_NAME}-collector
54 | labels:
55 | app: jaeger
56 | jaeger-infra: collector-deployment
57 | spec:
58 | replicas: 1
59 | strategy:
60 | type: Recreate
61 | template:
62 | metadata:
63 | labels:
64 | app: jaeger
65 | jaeger-infra: collector-pod
66 | annotations:
67 | prometheus.io/scrape: "true"
68 | prometheus.io/port: "14268"
69 | spec:
70 | containers:
71 | - image: jaegertracing/jaeger-collector:${IMAGE_VERSION}
72 | name: ${JAEGER_SERVICE_NAME}-collector
73 | args: ["--config-file=/conf/collector.yaml"]
74 | ports:
75 | - containerPort: 14250
76 | protocol: TCP
77 | - containerPort: 14267
78 | protocol: TCP
79 | - containerPort: 14268
80 | protocol: TCP
81 | - containerPort: 9411
82 | protocol: TCP
83 | readinessProbe:
84 | httpGet:
85 | path: "/"
86 | port: 14269
87 | volumeMounts:
88 | - name: jaeger-configuration-volume
89 | mountPath: /conf
90 | env:
91 | - name: SPAN_STORAGE_TYPE
92 | valueFrom:
93 | configMapKeyRef:
94 | name: jaeger-configuration
95 | key: span-storage-type
96 | volumes:
97 | - configMap:
98 | name: jaeger-configuration
99 | items:
100 | - key: collector
101 | path: collector.yaml
102 | name: jaeger-configuration-volume
103 | - apiVersion: v1
104 | kind: Service
105 | metadata:
106 | name: ${JAEGER_SERVICE_NAME}-collector
107 | labels:
108 | app: jaeger
109 | jaeger-infra: collector-service
110 | spec:
111 | ports:
112 | - name: jaeger-collector-grpc
113 | port: 14250
114 | protocol: TCP
115 | targetPort: 14250
116 | - name: jaeger-collector-tchannel
117 | port: 14267
118 | protocol: TCP
119 | targetPort: 14267
120 | - name: jaeger-collector-http
121 | port: 14268
122 | protocol: TCP
123 | targetPort: 14268
124 | - name: jaeger-collector-zipkin
125 | port: 9411
126 | protocol: TCP
127 | targetPort: 9411
128 | selector:
129 | jaeger-infra: collector-pod
130 | type: ClusterIP
131 | - apiVersion: v1
132 | kind: Service
133 | metadata:
134 | name: ${JAEGER_ZIPKIN_SERVICE_NAME}
135 | labels:
136 | app: jaeger
137 | jaeger-infra: zipkin-service
138 | spec:
139 | ports:
140 | - name: jaeger-zipkin-http
141 | port: 9411
142 | protocol: TCP
143 | targetPort: 9411
144 | selector:
145 | jaeger-infra: collector-pod
146 | type: ClusterIP
147 | - apiVersion: extensions/v1beta1
148 | kind: Deployment
149 | metadata:
150 | name: ${JAEGER_SERVICE_NAME}-query
151 | labels:
152 | app: jaeger
153 | jaeger-infra: query-deployment
154 | spec:
155 | replicas: 1
156 | strategy:
157 | type: Recreate
158 | template:
159 | metadata:
160 | labels:
161 | app: jaeger
162 | jaeger-infra: query-pod
163 | annotations:
164 | prometheus.io/scrape: "true"
165 | prometheus.io/port: "16686"
166 | spec:
167 | containers:
168 | - image: jaegertracing/jaeger-query:${IMAGE_VERSION}
169 | name: jaeger-query
170 | args: ["--config-file=/conf/query.yaml"]
171 | ports:
172 | - containerPort: 16686
173 | protocol: TCP
174 | readinessProbe:
175 | httpGet:
176 | path: "/"
177 | port: 16687
178 | volumeMounts:
179 | - name: jaeger-configuration-volume
180 | mountPath: /conf
181 | env:
182 | - name: SPAN_STORAGE_TYPE
183 | valueFrom:
184 | configMapKeyRef:
185 | name: jaeger-configuration
186 | key: span-storage-type
187 | - image: jaegertracing/jaeger-agent:${IMAGE_VERSION}
188 | name: jaeger-agent
189 | args: ["--reporter.tchannel.host-port=jaeger-collector:14267"]
190 | ports:
191 | - containerPort: 6831
192 | protocol: UDP
193 | volumes:
194 | - configMap:
195 | name: jaeger-configuration
196 | items:
197 | - key: query
198 | path: query.yaml
199 | name: jaeger-configuration-volume
200 | - apiVersion: v1
201 | kind: Service
202 | metadata:
203 | name: ${JAEGER_SERVICE_NAME}-query
204 | labels:
205 | app: jaeger
206 | jaeger-infra: query-service
207 | spec:
208 | ports:
209 | - name: jaeger-query
210 | port: 80
211 | protocol: TCP
212 | targetPort: 16686
213 | selector:
214 | jaeger-infra: query-pod
215 | type: LoadBalancer
216 | - apiVersion: v1
217 | kind: Route
218 | metadata:
219 | name: ${JAEGER_SERVICE_NAME}-query
220 | labels:
221 | app: jaeger
222 | jaeger-infra: query-route
223 | spec:
224 | tls:
225 | insecureEdgeTerminationPolicy: Allow
226 | termination: edge
227 | to:
228 | kind: Service
229 | name: ${JAEGER_SERVICE_NAME}-query
230 |
--------------------------------------------------------------------------------
/all-in-one/jaeger-all-in-one-template.yml:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2017-2019 The Jaeger Authors
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | # in compliance with the License. You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software distributed under the License
10 | # is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11 | # or implied. See the License for the specific language governing permissions and limitations under
12 | # the License.
13 | #
14 |
15 | parameters:
16 | - description: The name of the Jaeger Service.
17 | displayName: Jaeger Service Name
18 | name: JAEGER_SERVICE_NAME
19 | required: true
20 | value: jaeger
21 | - description: The Jaeger image version to use
22 | displayName: Image version
23 | name: IMAGE_VERSION
24 | required: false
25 | value: "latest"
26 | - description: The name of the Jaeger Zipkin Service.
27 | displayName: Jaeger Zipkin Service Name
28 | name: JAEGER_ZIPKIN_SERVICE_NAME
29 | required: true
30 | value: zipkin
31 | - description: Limit the number of traces stored in-memory, see https://www.jaegertracing.io/docs/latest/deployment/#memory
32 | displayName: Max Traces
33 | name: MAX_TRACES
34 | required: true
35 | value: "50000"
36 | # See https://docs.okd.io/latest/dev_guide/compute_resources.html for the CPU/Memory Request/Limit parameters below
37 | - description: CPU request represents a minimum amount of CPU that your container may consume, but if there is no contention for CPU, it can use all available CPU on the node.
38 | displayName: CPU Request
39 | name: CPU_REQUEST
40 | required: true
41 | value: "100m"
42 | - description: CPU limits control the maximum amount of CPU that your container may use independent of contention on the node.
43 | displayName: CPU Limit
44 | name: CPU_LIMIT
45 | required: true
46 | value: "500m"
47 | - description: In order to improve placement of pods in the cluster, specify the amount of memory required for a container to run.
48 | displayName: Memory Request
49 | name: MEMORY_REQUEST
50 | required: true
51 | value: "100Mi"
52 | - description: Constrain the amount of memory the container can use.
53 | displayName: Memory Limit
54 | name: MEMORY_LIMIT
55 | required: true
56 | value: "2Gi"
57 |
58 | apiVersion: v1
59 | kind: Template
60 | labels:
61 | template: jaeger-template-all-in-one
62 | jaeger-infra: template-all-in-one
63 | metadata:
64 | name: jaeger-template-all-in-one
65 | annotations:
66 | description: Jaeger Distributed Tracing Server (all-in-one)
67 | iconClass: icon-go-gopher
68 | openshift.io/display-name: Jaeger (all-in-one)
69 | tags: instant-app,tracing,opentracing,jaeger
70 | labels:
71 | name: jaeger-infra
72 | jaeger-infra: jaeger-template-all-in-one
73 | objects:
74 | - apiVersion: extensions/v1beta1
75 | kind: Deployment
76 | metadata:
77 | name: ${JAEGER_SERVICE_NAME}
78 | labels:
79 | app: jaeger
80 | jaeger-infra: jaeger-deployment
81 | spec:
82 | replicas: 1
83 | strategy:
84 | type: Recreate
85 | template:
86 | metadata:
87 | labels:
88 | app: jaeger
89 | jaeger-infra: jaeger-pod
90 | annotations:
91 | prometheus.io/scrape: "true"
92 | prometheus.io/port: "16686"
93 | spec:
94 | containers:
95 | - env:
96 | - name: COLLECTOR_ZIPKIN_HTTP_PORT
97 | value: "9411"
98 | image: jaegertracing/all-in-one:${IMAGE_VERSION}
99 | name: ${JAEGER_SERVICE_NAME}
100 | args: ["--memory.max-traces=${MAX_TRACES}"]
101 | ports:
102 | - containerPort: 5775
103 | protocol: UDP
104 | - containerPort: 6831
105 | protocol: UDP
106 | - containerPort: 6832
107 | protocol: UDP
108 | - containerPort: 16686
109 | protocol: TCP
110 | - containerPort: 9411
111 | protocol: TCP
112 | - containerPort: 5778
113 | protocol: TCP
114 | readinessProbe:
115 | httpGet:
116 | path: "/"
117 | port: 14269
118 | initialDelaySeconds: 5
119 | resources:
120 | requests:
121 | cpu: ${CPU_REQUEST}
122 | memory: ${MEMORY_REQUEST}
123 | limits:
124 | cpu: ${CPU_LIMIT}
125 | memory: ${MEMORY_LIMIT}
126 | - apiVersion: v1
127 | kind: Service
128 | metadata:
129 | name: ${JAEGER_SERVICE_NAME}-query
130 | labels:
131 | app: jaeger
132 | jaeger-infra: jaeger-service
133 | spec:
134 | ports:
135 | - name: query-http
136 | port: 80
137 | protocol: TCP
138 | targetPort: 16686
139 | selector:
140 | jaeger-infra: jaeger-pod
141 | type: LoadBalancer
142 | - apiVersion: v1
143 | kind: Service
144 | metadata:
145 | name: ${JAEGER_SERVICE_NAME}-collector
146 | labels:
147 | app: jaeger
148 | jaeger-infra: collector-service
149 | spec:
150 | ports:
151 | - name: jaeger-collector-grpc
152 | port: 14250
153 | protocol: TCP
154 | targetPort: 14250
155 | - name: jaeger-collector-tchannel
156 | port: 14267
157 | protocol: TCP
158 | targetPort: 14267
159 | - name: jaeger-collector-http
160 | port: 14268
161 | protocol: TCP
162 | targetPort: 14268
163 | - name: jaeger-collector-zipkin
164 | port: 9411
165 | protocol: TCP
166 | targetPort: 9411
167 | selector:
168 | jaeger-infra: jaeger-pod
169 | type: ClusterIP
170 | - apiVersion: v1
171 | kind: Service
172 | metadata:
173 | name: ${JAEGER_SERVICE_NAME}-agent
174 | labels:
175 | app: jaeger
176 | jaeger-infra: agent-service
177 | spec:
178 | ports:
179 | - name: agent-zipkin-thrift
180 | port: 5775
181 | protocol: UDP
182 | targetPort: 5775
183 | - name: agent-compact
184 | port: 6831
185 | protocol: UDP
186 | targetPort: 6831
187 | - name: agent-binary
188 | port: 6832
189 | protocol: UDP
190 | targetPort: 6832
191 | - name: agent-sampler-manager
192 | port: 5778
193 | protocol: TCP
194 | targetPort: 5778
195 | clusterIP: None
196 | selector:
197 | jaeger-infra: jaeger-pod
198 | - apiVersion: v1
199 | kind: Service
200 | metadata:
201 | name: ${JAEGER_ZIPKIN_SERVICE_NAME}
202 | labels:
203 | app: jaeger
204 | jaeger-infra: zipkin-service
205 | spec:
206 | ports:
207 | - name: jaeger-zipkin-http
208 | port: 9411
209 | protocol: TCP
210 | targetPort: 9411
211 | selector:
212 | jaeger-infra: jaeger-pod
213 | type: ClusterIP
214 | - apiVersion: v1
215 | kind: Route
216 | metadata:
217 | name: ${JAEGER_SERVICE_NAME}-query
218 | labels:
219 | jaeger-infra: query-route
220 | spec:
221 | to:
222 | kind: Service
223 | name: ${JAEGER_SERVICE_NAME}-query
224 | port:
225 | targetPort: query-http
226 | tls:
227 | termination: edge
228 | insecureEdgeTerminationPolicy: Allow
229 |
--------------------------------------------------------------------------------
/mvnw:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # ----------------------------------------------------------------------------
3 | # Licensed to the Apache Software Foundation (ASF) under one
4 | # or more contributor license agreements. See the NOTICE file
5 | # distributed with this work for additional information
6 | # regarding copyright ownership. The ASF licenses this file
7 | # to you under the Apache License, Version 2.0 (the
8 | # "License"); you may not use this file except in compliance
9 | # with the License. You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing,
14 | # software distributed under the License is distributed on an
15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 | # KIND, either express or implied. See the License for the
17 | # specific language governing permissions and limitations
18 | # under the License.
19 | # ----------------------------------------------------------------------------
20 |
21 | # ----------------------------------------------------------------------------
22 | # Maven2 Start Up Batch script
23 | #
24 | # Required ENV vars:
25 | # ------------------
26 | # JAVA_HOME - location of a JDK home dir
27 | #
28 | # Optional ENV vars
29 | # -----------------
30 | # M2_HOME - location of maven2's installed home dir
31 | # MAVEN_OPTS - parameters passed to the Java VM when running Maven
32 | # e.g. to debug Maven itself, use
33 | # set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
34 | # MAVEN_SKIP_RC - flag to disable loading of mavenrc files
35 | # ----------------------------------------------------------------------------
36 |
37 | if [ -z "$MAVEN_SKIP_RC" ] ; then
38 |
39 | if [ -f /etc/mavenrc ] ; then
40 | . /etc/mavenrc
41 | fi
42 |
43 | if [ -f "$HOME/.mavenrc" ] ; then
44 | . "$HOME/.mavenrc"
45 | fi
46 |
47 | fi
48 |
49 | # OS specific support. $var _must_ be set to either true or false.
50 | cygwin=false;
51 | darwin=false;
52 | mingw=false
53 | case "`uname`" in
54 | CYGWIN*) cygwin=true ;;
55 | MINGW*) mingw=true;;
56 | Darwin*) darwin=true
57 | #
58 | # Look for the Apple JDKs first to preserve the existing behaviour, and then look
59 | # for the new JDKs provided by Oracle.
60 | #
61 | if [ -z "$JAVA_HOME" ] && [ -L /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK ] ; then
62 | #
63 | # Apple JDKs
64 | #
65 | export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home
66 | fi
67 |
68 | if [ -z "$JAVA_HOME" ] && [ -L /System/Library/Java/JavaVirtualMachines/CurrentJDK ] ; then
69 | #
70 | # Apple JDKs
71 | #
72 | export JAVA_HOME=/System/Library/Java/JavaVirtualMachines/CurrentJDK/Contents/Home
73 | fi
74 |
75 | if [ -z "$JAVA_HOME" ] && [ -L "/Library/Java/JavaVirtualMachines/CurrentJDK" ] ; then
76 | #
77 | # Oracle JDKs
78 | #
79 | export JAVA_HOME=/Library/Java/JavaVirtualMachines/CurrentJDK/Contents/Home
80 | fi
81 |
82 | if [ -z "$JAVA_HOME" ] && [ -x "/usr/libexec/java_home" ]; then
83 | #
84 | # Apple JDKs
85 | #
86 | export JAVA_HOME=`/usr/libexec/java_home`
87 | fi
88 | ;;
89 | esac
90 |
91 | if [ -z "$JAVA_HOME" ] ; then
92 | if [ -r /etc/gentoo-release ] ; then
93 | JAVA_HOME=`java-config --jre-home`
94 | fi
95 | fi
96 |
97 | if [ -z "$M2_HOME" ] ; then
98 | ## resolve links - $0 may be a link to maven's home
99 | PRG="$0"
100 |
101 | # need this for relative symlinks
102 | while [ -h "$PRG" ] ; do
103 | ls=`ls -ld "$PRG"`
104 | link=`expr "$ls" : '.*-> \(.*\)$'`
105 | if expr "$link" : '/.*' > /dev/null; then
106 | PRG="$link"
107 | else
108 | PRG="`dirname "$PRG"`/$link"
109 | fi
110 | done
111 |
112 | saveddir=`pwd`
113 |
114 | M2_HOME=`dirname "$PRG"`/..
115 |
116 | # make it fully qualified
117 | M2_HOME=`cd "$M2_HOME" && pwd`
118 |
119 | cd "$saveddir"
120 | # echo Using m2 at $M2_HOME
121 | fi
122 |
123 | # For Cygwin, ensure paths are in UNIX format before anything is touched
124 | if $cygwin ; then
125 | [ -n "$M2_HOME" ] &&
126 | M2_HOME=`cygpath --unix "$M2_HOME"`
127 | [ -n "$JAVA_HOME" ] &&
128 | JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
129 | [ -n "$CLASSPATH" ] &&
130 | CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
131 | fi
132 |
133 | # For Migwn, ensure paths are in UNIX format before anything is touched
134 | if $mingw ; then
135 | [ -n "$M2_HOME" ] &&
136 | M2_HOME="`(cd "$M2_HOME"; pwd)`"
137 | [ -n "$JAVA_HOME" ] &&
138 | JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
139 | # TODO classpath?
140 | fi
141 |
142 | if [ -z "$JAVA_HOME" ]; then
143 | javaExecutable="`which javac`"
144 | if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
145 | # readlink(1) is not available as standard on Solaris 10.
146 | readLink=`which readlink`
147 | if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
148 | if $darwin ; then
149 | javaHome="`dirname \"$javaExecutable\"`"
150 | javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
151 | else
152 | javaExecutable="`readlink -f \"$javaExecutable\"`"
153 | fi
154 | javaHome="`dirname \"$javaExecutable\"`"
155 | javaHome=`expr "$javaHome" : '\(.*\)/bin'`
156 | JAVA_HOME="$javaHome"
157 | export JAVA_HOME
158 | fi
159 | fi
160 | fi
161 |
162 | if [ -z "$JAVACMD" ] ; then
163 | if [ -n "$JAVA_HOME" ] ; then
164 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
165 | # IBM's JDK on AIX uses strange locations for the executables
166 | JAVACMD="$JAVA_HOME/jre/sh/java"
167 | else
168 | JAVACMD="$JAVA_HOME/bin/java"
169 | fi
170 | else
171 | JAVACMD="`which java`"
172 | fi
173 | fi
174 |
175 | if [ ! -x "$JAVACMD" ] ; then
176 | echo "Error: JAVA_HOME is not defined correctly." >&2
177 | echo " We cannot execute $JAVACMD" >&2
178 | exit 1
179 | fi
180 |
181 | if [ -z "$JAVA_HOME" ] ; then
182 | echo "Warning: JAVA_HOME environment variable is not set."
183 | fi
184 |
185 | CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
186 |
187 | # traverses directory structure from process work directory to filesystem root
188 | # first directory with .mvn subdirectory is considered project base directory
189 | find_maven_basedir() {
190 | local basedir=$(pwd)
191 | local wdir=$(pwd)
192 | while [ "$wdir" != '/' ] ; do
193 | if [ -d "$wdir"/.mvn ] ; then
194 | basedir=$wdir
195 | break
196 | fi
197 | wdir=$(cd "$wdir/.."; pwd)
198 | done
199 | echo "${basedir}"
200 | }
201 |
202 | # concatenates all lines of a file
203 | concat_lines() {
204 | if [ -f "$1" ]; then
205 | echo "$(tr -s '\n' ' ' < "$1")"
206 | fi
207 | }
208 |
209 | export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-$(find_maven_basedir)}
210 | MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
211 |
212 | # For Cygwin, switch paths to Windows format before running java
213 | if $cygwin; then
214 | [ -n "$M2_HOME" ] &&
215 | M2_HOME=`cygpath --path --windows "$M2_HOME"`
216 | [ -n "$JAVA_HOME" ] &&
217 | JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
218 | [ -n "$CLASSPATH" ] &&
219 | CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
220 | [ -n "$MAVEN_PROJECTBASEDIR" ] &&
221 | MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
222 | fi
223 |
224 | # Provide a "standardized" way to retrieve the CLI args that will
225 | # work with both Windows and non-Windows executions.
226 | MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
227 | export MAVEN_CMD_LINE_ARGS
228 |
229 | WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
230 |
231 | # avoid using MAVEN_CMD_LINE_ARGS below since that would loose parameter escaping in $@
232 | exec "$JAVACMD" \
233 | $MAVEN_OPTS \
234 | -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
235 | "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
236 | ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
237 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Jaeger OpenShift Templates
2 |
3 | ## This repository is deprecated
4 |
5 | The current recommended way of installing and managing Jaeger in a production OpenShift cluster is via the [Jaeger Operator](https://github.com/jaegertracing/jaeger-operator).
6 |
7 | You can still use, report issues and send pull-requests against this repository, but not all features from the Operator are possible or will be backported to the templates from this repository here.
8 |
9 | Use the [Kubernetes templates](https://github.com/jaegertracing/jaeger-kubernetes) if you need a quick start and don't want to install the Operator.
10 |
11 | ## Development setup
12 | This template uses an in-memory storage with a limited functionality for local testing and development.
13 | Do not use this template in production environments, although there are a number of parameters in the
14 | template to constrain the maximum number of traces and the amount of CPU/Memory consumed to prevent
15 | node instability.
16 |
17 | Install everything in the current namespace:
18 | ```bash
19 | oc process -f https://raw.githubusercontent.com/jaegertracing/jaeger-openshift/master/all-in-one/jaeger-all-in-one-template.yml | oc create -f -
20 | ```
21 |
22 | Once everything is ready, `oc status` tells you where to find Jaeger URL.
23 |
24 | ## Production setup
25 |
26 | ### Backing storage
27 | The Jaeger Collector and Query require a backing storage to exist before being started up. As a starting point for your own
28 | templates, we provide a basic template to deploy Cassandra. It is not ready for production and should be adapted before any
29 | real usage.
30 |
31 | #### Cassandra
32 | To use our Cassandra template:
33 |
34 | oc create -f production/cassandra.yml
35 | oc create -f production/configmap-cassandra.yml
36 |
37 | The Cassandra template includes also a Kubernetes `Job` that creates the schema required by the Jaeger components. It's advisable
38 | to wait for this job to finish before deploying the Jaeger components. To check the status of the job, run:
39 |
40 | oc get job jaeger-cassandra-schema-job
41 |
42 | The job should have `1` in the `SUCCESSFUL` column.
43 |
44 | #### Elasticsearch
45 | To use our Elasticsearch template:
46 |
47 | oc create -f production/elasticsearch.yml
48 | oc create -f production/configmap-elasticsearch.yml
49 |
50 | The Elasticsearch template in this repository deploys only one node and overall it's not production quality!
51 | We encourage you to use other templates, for example [docker-rhel-elasticsearch](https://github.com/RHsyseng/docker-rhel-elasticsearch).
52 | This Elasticsearch deployment is also used by integration tests for this repository.
53 |
54 | ### Jaeger configuration
55 | The Jaeger Collector, Query and Agent require a `ConfigMap` to exist on the same namespace, named `jaeger-configuration`.
56 | This `ConfigMap` is included in the storage templates, as each backing storage have their own specific configuration entries,
57 | but in your environment, you'll probably manage it differently.
58 |
59 | If changes are required for the configuration, the `edit` command can be used:
60 |
61 | oc edit configmap jaeger-configuration
62 |
63 | ### Jaeger components
64 | The main production template deploys the Collector and the Query Service (with UI) as separate individually scalable services.
65 |
66 | oc process -f production/jaeger-production-template.yml | oc create -f -
67 |
68 | If the backing storage is not ready by the time the Collector/Agent start, they will fail and Kubernetes will reschedule the
69 | pod. It's advisable to either wait for the backing storage to estabilize, or to ignore such failures for the first few minutes.
70 |
71 | Once everything is ready, the Jaeger Query service location can be discovered by running:
72 |
73 | oc get route jaeger-query
74 |
75 | It should be similar to: https://jaeger-query-myproject.127.0.0.1.nip.io
76 |
77 | ### Deploying the agent as sidecar
78 | The Jaeger Agent is designed to be deployed local to your service, so that it can receive traces via UDP keeping your
79 | application's load minimal. As such, it's ideal to have the Agent to be deployed as a sidecar to your application's component,
80 | just add it as a container within any struct that supports `spec.containers`, like a `Pod`, `Deployment` and so on.
81 |
82 | For instance, assuming that your application is named `myapp` and the image is for it is `openshift/hello-openshift`, your
83 | `Deployment` descriptor would be something like:
84 |
85 | ```yaml
86 | - apiVersion: extensions/v1beta1
87 | kind: Deployment
88 | metadata:
89 | name: myapp
90 | spec:
91 | template:
92 | metadata:
93 | labels:
94 | app: myapp
95 | spec:
96 | containers:
97 | - image: openshift/hello-openshift
98 | name: myapp
99 | ports:
100 | - containerPort: 8080
101 | - image: jaegertracing/jaeger-agent
102 | name: jaeger-agent
103 | ports:
104 | - containerPort: 5775
105 | protocol: UDP
106 | - containerPort: 5778
107 | - containerPort: 6831
108 | protocol: UDP
109 | - containerPort: 6832
110 | protocol: UDP
111 | args:
112 | - "--collector.host-port=jaeger-collector.jaeger-infra.svc:14267"
113 | ```
114 |
115 | The Jaeger Agent will then be available to your application at `localhost:5775`/`localhost:6831`/`localhost:6832`.
116 | In most cases, you don't need to specify a hostname or port to your Jaeger Tracer, as it will default to the right
117 | values already.
118 |
119 | ### Persistent storage
120 | Even though this template uses a stateful Cassandra, backing storage is set to `emptyDir`. It's more
121 | appropriate to create a `PersistentVolumeClaim`/`PersistentVolume` and use it instead. Note that this
122 | Cassandra deployment does not support deleting pods or scaling down, as this might require
123 | administrative tasks that are dependent on the final deployment architecture.
124 |
125 | ## Exposing Jaeger-Collector outside of Cluster
126 | Collector is by default accessible only to services running inside the cluster.
127 | The easiest approach to expose the collector outside of the cluster is via the `jaeger-collector-http`
128 | HTTP port using an OpenShift Route:
129 |
130 | ```bash
131 | oc create route edge --service=jaeger-collector --port jaeger-collector-http --insecure-policy=Allow
132 | ```
133 |
134 | This allows clients to send data directly to Collector via HTTP senders. If you want to use the Agent then use
135 | [ExternalIP or NodePort](https://docs.openshift.com/container-platform/3.3/dev_guide/getting_traffic_into_cluster.html)
136 | to expose the Collector service.
137 |
138 | Note that doing so will open the collector to be used by any external party, who will then
139 | be able to create arbitrary spans.
140 | It's advisable to put an OAuth Security Proxy in front of the collector and expose this proxy instead.
141 |
142 | ## Using a different version
143 | The templates are using a specific version and `latest` in `all-in-one` template. If you need to
144 | use a different Docker image version, specify it via the template parameter `IMAGE_VERSION`, as follows:
145 |
146 | ```bash
147 | oc process -f -p IMAGE_VERSION= | oc create -n jaeger-infra -f -
148 | ```
149 |
150 | A list of tags can be found here:
151 | https://hub.docker.com/r/jaegertracing/
152 |
153 | ## Getting an OpenShift cluster running
154 | As a developer looking to try this out locally, the easiest is to use the `oc cluster up` command. Getting
155 | this command might be as easy as running `dnf install origin-clients` on a recent Fedora desktop. Refer to
156 | the OpenShift [installation guide or quick start guide](https://install.openshift.com/) for more information.
157 | Another alternative is to use [`minishift`](https://github.com/minishift/minishift).
158 |
159 | ## OpenShift Service Catalog
160 |
161 | The templates available in this repository are also suitable to be added to the OpenShift Service Catalog.
162 | To do so, run `oc create -n openshift -f ` and wait for the Template Service Broker to pick it up,
163 | which might take a couple of minutes.
164 |
165 | ```
166 | oc create -n openshift -f https://raw.githubusercontent.com/jaegertracing/jaeger-openshift/master/all-in-one/jaeger-all-in-one-template.yml
167 | oc create -n openshift -f https://raw.githubusercontent.com/jaegertracing/jaeger-openshift/master/production/jaeger-production-template.yml
168 | ```
169 |
170 | Before provisioning a production instance, however, your users will need to provision a backing storage and install an appropriate `ConfigMap`,
171 | as described previously in this document.
172 |
173 | ## Uninstalling
174 | If you need to remove the all Jaeger components created by this template, run:
175 |
176 | ```bash
177 | oc delete all,template,configmap -l jaeger-infra
178 | ```
179 |
180 | ## Testing
181 | Tests are based on [Arquillian Cube](http://arquillian.org/arquillian-cube/) which require an active connection to
182 | openshift cluster (via `oc`). Currently all templates are tested on minishift or local all-in-one cluster (`oc cluster
183 | up`).
184 |
185 | ```bash
186 | minishift start // or oc cluster up
187 | mvn clean verify -Pe2e
188 | ```
189 |
190 | ## Troubleshooting
191 | Tracer may sometimes fail to resolve Jaeger's address. In such case run the following command and restart the affected applications.:
192 | ```bash
193 | sudo iptables -F
194 | ```
195 |
196 | ## License
197 | [Apache-2.0 License](./LICENSE)
198 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "{}"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright {yyyy} {name of copyright owner}
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------