├── .gitignore
├── Jenkinsfile
├── circle.yml
├── examples
├── hello-world
│ ├── pom.xml
│ └── src
│ │ └── main
│ │ ├── fabric8
│ │ ├── zipkin-hello-world-deployment.yml
│ │ └── zipkin-hello-world-svc.yml
│ │ ├── java
│ │ └── io
│ │ │ └── fabric8
│ │ │ └── zipkin
│ │ │ └── examples
│ │ │ └── helloworld
│ │ │ ├── HelloController.java
│ │ │ └── HelloWorldApplication.java
│ │ └── resources
│ │ └── application.yml
└── pom.xml
├── header.txt
├── images
└── zipkin-console.png
├── license.txt
├── mysql
├── pom.xml
└── src
│ └── main
│ └── fabric8
│ ├── zipkin-mysql-cnf-configmap.yml
│ ├── zipkin-mysql-deployment.yml
│ ├── zipkin-mysql-initdb-configmap.yml
│ ├── zipkin-mysql-pvc.yml
│ └── zipkin-mysql-svc.yml
├── packages
├── distro
│ ├── pom.xml
│ └── src
│ │ └── main
│ │ └── assembly
│ │ └── templates.xml
├── pom.xml
└── zipkin
│ └── pom.xml
├── pom.xml
├── readme.md
├── release.groovy
├── starter-minimal
├── pom.xml
└── src
│ ├── main
│ └── resources
│ │ └── kubernetes.json
│ └── test
│ └── java
│ └── io
│ └── fabric8
│ └── zipkin
│ └── starter
│ └── minimal
│ └── ZipkinMinimalKubernetesTest.java
├── starter-mysql
├── pom.xml
└── src
│ ├── main
│ └── resources
│ │ └── kubernetes.json
│ └── test
│ └── java
│ └── io
│ └── fabric8
│ └── zipkin
│ └── starter
│ └── mysql
│ └── ZipkinMysqlKubernetesTest.java
├── starter
├── pom.xml
└── src
│ └── main
│ └── resources
│ └── kubernetes.json
└── zipkin
├── pom.xml
└── src
└── main
└── fabric8
├── zipkin-deployment.yml
└── zipkin-svc.yml
/.gitignore:
--------------------------------------------------------------------------------
1 | # Created by .ignore support plugin (hsz.mobi)
2 | ### Maven template
3 | target/
4 | pom.xml.tag
5 | pom.xml.releaseBackup
6 | pom.xml.versionsBackup
7 | pom.xml.next
8 | release.properties
9 | dependency-reduced-pom.xml
10 | buildNumber.properties
11 | .mvn/timing.properties
12 |
13 |
14 | ### Java template
15 | *.class
16 |
17 | # Mobile Tools for Java (J2ME)
18 | .mtj.tmp/
19 |
20 | # Package Files #
21 | *.jar
22 | *.war
23 | *.ear
24 |
25 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
26 | hs_err_pid*
27 |
28 |
29 | ### JetBrains template
30 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion
31 |
32 | *.iml
33 |
34 | ## Directory-based project format:
35 | .idea/
36 | # if you remove the above rule, at least ignore the following:
37 |
38 | # User-specific stuff:
39 | # .idea/workspace.xml
40 | # .idea/tasks.xml
41 | # .idea/dictionaries
42 |
43 | # Sensitive or high-churn files:
44 | # .idea/dataSources.ids
45 | # .idea/dataSources.xml
46 | # .idea/sqlDataSources.xml
47 | # .idea/dynamic.xml
48 | # .idea/uiDesigner.xml
49 |
50 | # Gradle:
51 | # .idea/gradle.xml
52 | # .idea/libraries
53 |
54 | # Mongo Explorer plugin:
55 | # .idea/mongoSettings.xml
56 |
57 | ## File-based project format:
58 | *.ipr
59 | *.iws
60 |
61 | ## Plugin-specific files:
62 |
63 | # IntelliJ
64 | /out/
65 |
66 | # mpeltonen/sbt-idea plugin
67 | .idea_modules/
68 |
69 | # JIRA plugin
70 | atlassian-ide-plugin.xml
71 |
72 | # Crashlytics plugin (for Android Studio and IntelliJ)
73 | com_crashlytics_export_strings.xml
74 | crashlytics.properties
75 | crashlytics-build.properties
76 |
77 |
78 |
--------------------------------------------------------------------------------
/Jenkinsfile:
--------------------------------------------------------------------------------
1 | #!/usr/bin/groovy
2 | @Library('github.com/fabric8io/fabric8-pipeline-library@master')
3 | def dummy
4 | mavenNode {
5 | dockerNode {
6 | checkout scm
7 | sh "git remote set-url origin git@github.com:fabric8io/kubernetes-zipkin.git"
8 |
9 | def pipeline = load 'release.groovy'
10 |
11 | stage 'Updating dependencies'
12 | def prId = pipeline.updateDependencies('http://central.maven.org/maven2/')
13 |
14 | stage 'Stage'
15 | def stagedProject = pipeline.stage()
16 |
17 | stage 'Promote'
18 | pipeline.release(stagedProject)
19 | if (prId != null){
20 | pipeline.mergePullRequest(prId)
21 | }
22 |
23 | stage 'Update downstream dependencies'
24 | pipeline.updateDownstreamDependencies(stagedProject)
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/circle.yml:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2015 Red Hat, Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # 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
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | #
16 |
17 | machine:
18 | java:
19 | version: oraclejdk8
20 | environment:
21 | JAVA_OPTS: "-Xms256m -Xmx512m"
22 | dependencies:
23 | override:
24 | - mvn install -DskipTests -U
25 | test:
26 | post:
27 | - mkdir -p $CIRCLE_TEST_REPORTS/junit/
28 | - find . -type f -regex ".*/target/.*-reports/.*xml" -exec cp {} $CIRCLE_TEST_REPORTS/junit/ \;
29 |
--------------------------------------------------------------------------------
/examples/hello-world/pom.xml:
--------------------------------------------------------------------------------
1 |
16 |
17 | zipkin-examples
18 | io.fabric8
19 | 0.1-SNAPSHOT
20 |
21 | 4.0.0
22 |
23 | io.fabric8.zipkin.examples
24 | zipkin-hello-world
25 | Fabric8 :: Zipkin :: Examples :: Hello World
26 | Zipkin Hello World example
27 |
28 |
29 |
30 |
31 | org.springframework.cloud
32 | spring-cloud-dependencies
33 | ${spring-cloud.version}
34 | pom
35 | import
36 |
37 |
38 |
39 | org.springframework.cloud
40 | spring-cloud-netflix-dependencies
41 | ${spring-cloud-netflix.version}
42 | pom
43 | import
44 |
45 |
46 |
47 | org.springframework.cloud
48 | spring-cloud-sleuth-dependencies
49 | ${spring-cloud-sleuth.version}
50 | pom
51 | import
52 |
53 |
54 |
55 |
56 |
57 |
58 | docker.io/java:8u40
59 | fabric8/${project.artifactId}:${project.version}
60 |
61 | 3.2.28
62 | 1.4.14
63 |
64 | 1.4.0.RELEASE
65 | Brixton.SR5
66 | 1.1.1.RELEASE
67 | 0.0.16
68 | 1.1.5.RELEASE
69 | 1.0.6.RELEASE
70 |
71 |
72 | 9.3.7.v20160115
73 | 2.8.2
74 | 3.5
75 | 2.6
76 |
77 |
78 |
79 |
80 | io.fabric8
81 | spring-cloud-kubernetes-compat
82 | ${spring-cloud-kubernetes.version}
83 |
84 |
85 |
86 | io.fabric8
87 | spring-cloud-starter-kubernetes-all
88 | ${spring-cloud-kubernetes.version}
89 |
90 |
91 |
92 | org.springframework.boot
93 | spring-boot-starter-web
94 | ${spring-boot.version}
95 |
96 |
97 |
98 | org.springframework.boot
99 | spring-boot-autoconfigure
100 | ${spring-boot.version}
101 |
102 |
103 |
104 | org.springframework.cloud
105 | spring-cloud-commons
106 | ${spring-cloud-commons.version}
107 |
108 |
109 |
110 |
111 |
112 |
113 | spring-milestones
114 | Spring Milestones
115 | https://repo.spring.io/libs-milestone
116 |
117 | false
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 | org.springframework.boot
126 | spring-boot-maven-plugin
127 | ${spring-boot.version}
128 |
129 |
130 |
131 | repackage
132 |
133 |
134 |
135 |
136 |
137 |
138 | org.apache.maven.plugins
139 | maven-deploy-plugin
140 | ${maven-deploy-plugin.version}
141 |
142 | true
143 |
144 |
145 |
146 | org.apache.maven.plugins
147 | maven-compiler-plugin
148 | ${maven-compiler-plugin.version}
149 |
150 | 1.8
151 | 1.8
152 |
153 |
154 |
155 |
156 | io.fabric8
157 | fabric8-maven-plugin
158 | ${fabric8.maven.plugin.version}
159 |
160 |
161 | fmp
162 |
163 | resource
164 | helm
165 |
166 |
167 |
168 |
169 |
170 |
171 | ${docker.image}
172 |
173 | ${docker.from}
174 |
175 | /app
176 | artifact
177 |
178 |
179 | 8080
180 |
181 |
182 |
183 | java
184 | -jar
185 | /app/${project.build.finalName}.jar
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 | release
199 |
200 |
201 |
202 | io.fabric8
203 | fabric8-maven-plugin
204 | ${fabric8.maven.plugin.version}
205 |
206 |
207 | fmp
208 |
209 | resource
210 | helm
211 | build
212 | push
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 | docker
222 |
223 |
224 |
225 | io.fabric8
226 | fabric8-maven-plugin
227 | ${fabric8.maven.plugin.version}
228 |
229 |
230 | fmp
231 |
232 | resource
233 | helm
234 | build
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
--------------------------------------------------------------------------------
/examples/hello-world/src/main/fabric8/zipkin-hello-world-deployment.yml:
--------------------------------------------------------------------------------
1 | ---
2 | apiVersion: "extensions/v1beta1"
3 | kind: "Deployment"
4 | metadata:
5 | labels:
6 | project: "${project.artifactId}"
7 | provider: "fabric8"
8 | version: "${project.version}"
9 | group: "io.fabric8.zipkin.examples"
10 | name: "zipkin-hello-world"
11 | spec:
12 | replicas: 1
13 | selector:
14 | matchLabels:
15 | project: "${project.artifactId}"
16 | provider: "fabric8"
17 | group: "io.fabric8.zipkin.examples"
18 | template:
19 | metadata:
20 | labels:
21 | project: "${project.artifactId}"
22 | provider: "fabric8"
23 | version: "${project.version}"
24 | group: "io.fabric8.zipkin.examples"
25 | spec:
26 | containers:
27 | - env:
28 | - name: "KUBERNETES_NAMESPACE"
29 | valueFrom:
30 | fieldRef:
31 | fieldPath: "metadata.namespace"
32 | image: "fabric8/zipkin-hello-world:${project.version}"
33 | name: "zipkin-hello-world"
34 | serviceAccountName: "fabric8"
35 | ports:
36 | - containerPort: 8080
37 | name: "http"
38 |
--------------------------------------------------------------------------------
/examples/hello-world/src/main/fabric8/zipkin-hello-world-svc.yml:
--------------------------------------------------------------------------------
1 | ---
2 | apiVersion: "v1"
3 | kind: "Service"
4 | metadata:
5 | labels:
6 | project: "${project.artifactId}"
7 | provider: "fabric8"
8 | version: "${project.version}"
9 | group: "io.fabric8.zipkin.examples"
10 | name: "zipkin-hello-world"
11 | spec:
12 | ports:
13 | - port: 80
14 | protocol: "TCP"
15 | targetPort: 8080
16 | selector:
17 | project: "zipkin-hello-world"
18 | provider: "fabric8"
19 | group: "io.fabric8.zipkin.examples"
20 | type: "LoadBalancer"
21 |
--------------------------------------------------------------------------------
/examples/hello-world/src/main/java/io/fabric8/zipkin/examples/helloworld/HelloController.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 to origin authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * 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
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package io.fabric8.zipkin.examples.helloworld;
18 |
19 | import org.springframework.beans.factory.annotation.Autowired;
20 | import org.springframework.boot.context.embedded.EmbeddedServletContainerInitializedEvent;
21 | import org.springframework.cloud.sleuth.Tracer;
22 | import org.springframework.context.ApplicationListener;
23 | import org.springframework.web.bind.annotation.RequestMapping;
24 | import org.springframework.web.bind.annotation.RequestParam;
25 | import org.springframework.web.bind.annotation.RestController;
26 | import org.springframework.web.client.RestTemplate;
27 |
28 | import java.util.Random;
29 |
30 | @RestController
31 | public class HelloController implements ApplicationListener {
32 |
33 | private int port;
34 |
35 | @Autowired
36 | private RestTemplate restTemplate;
37 | @Autowired
38 | private Tracer tracer;
39 |
40 | @Autowired
41 | private Random random;
42 |
43 | @RequestMapping("/hello")
44 | public String hello(@RequestParam("name") String name) throws InterruptedException {
45 | Thread.sleep(this.random.nextInt(1000));
46 | String greeting = this.restTemplate.getForObject("http://localhost:" + this.port + "/greeting", String.class);
47 | return greeting + " " + name + "!";
48 | }
49 |
50 |
51 | @RequestMapping("/greeting")
52 | public String greeting() throws InterruptedException {
53 | int millis = this.random.nextInt(1000);
54 | Thread.sleep(millis);
55 | this.tracer.addTag("random-sleep-millis", String.valueOf(millis));
56 | return "Hello";
57 | }
58 |
59 | @Override
60 | public void onApplicationEvent(EmbeddedServletContainerInitializedEvent event) {
61 | this.port = event.getEmbeddedServletContainer().getPort();
62 | }
63 |
64 | }
65 |
--------------------------------------------------------------------------------
/examples/hello-world/src/main/java/io/fabric8/zipkin/examples/helloworld/HelloWorldApplication.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 to origin authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * 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
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package io.fabric8.zipkin.examples.helloworld;
18 |
19 | import org.apache.commons.logging.Log;
20 | import org.apache.commons.logging.LogFactory;
21 | import org.springframework.boot.SpringApplication;
22 | import org.springframework.boot.autoconfigure.SpringBootApplication;
23 | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
24 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
25 | import org.springframework.cloud.sleuth.zipkin.ZipkinSpanReporter;
26 | import org.springframework.context.annotation.Bean;
27 | import org.springframework.context.annotation.EnableAspectJAutoProxy;
28 | import org.springframework.web.client.RestTemplate;
29 |
30 | @SpringBootApplication
31 | @EnableAspectJAutoProxy(proxyTargetClass = true)
32 | @EnableDiscoveryClient
33 | public class HelloWorldApplication {
34 |
35 | private final Log log = LogFactory.getLog(HelloWorldApplication.class);
36 |
37 | public static void main(String[] args) {
38 | SpringApplication.run(HelloWorldApplication.class, args);
39 | }
40 |
41 | @Bean
42 | public RestTemplate restTemplate() {
43 | return new RestTemplate();
44 | }
45 |
46 | @Bean
47 | @ConditionalOnProperty(value = "sample.zipkin.enabled", havingValue = "false")
48 | public ZipkinSpanReporter spanCollector() {
49 | return new ZipkinSpanReporter() {
50 | @Override
51 | public void report(zipkin.Span span) {
52 | log.info(String.format("Reporting span [%s]", span));
53 | }
54 | };
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/examples/hello-world/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | spring:
2 | application:
3 | # This ends up as the service name in zipkin
4 | name: helloworld
5 | zipkin:
6 | # We don't need to specify the baseUrl of the zipkin-query-api as it will be discovered via DiscoveryClient.
7 | #baseUrl: http://172.30.204.154:9411/
8 | sleuth:
9 | sampler:
10 | percentage: 1.0
11 | cloud:
12 | kubernetes:
13 | zipkin:
14 | discovery:
15 | serviceName: zipkin
16 | sample:
17 | zipkin:
18 | # When enabled=false, traces log to the console. Comment to send to zipkin
19 | enabled: true
20 |
--------------------------------------------------------------------------------
/examples/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
21 |
22 | zipkin-project
23 | io.fabric8
24 | 0.1-SNAPSHOT
25 |
26 | 4.0.0
27 |
28 | io.fabric8
29 | zipkin-examples
30 | pom
31 | Fabric8 :: Zipkin :: Examples
32 |
33 |
34 | hello-world
35 |
36 |
37 |
--------------------------------------------------------------------------------
/header.txt:
--------------------------------------------------------------------------------
1 | Copyright (C) ${project.inceptionYear} ${owner}
2 |
3 | Licensed under the Apache License, Version 2.0 (the "License");
4 | you may not use this file except in compliance with the License.
5 | 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
10 | distributed under the License is distributed on an "AS IS" BASIS,
11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | See the License for the specific language governing permissions and
13 | limitations under the License.
14 |
--------------------------------------------------------------------------------
/images/zipkin-console.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fabric8io/kubernetes-zipkin/7aacf77b38e97b69705949069296fd4ac26556e1/images/zipkin-console.png
--------------------------------------------------------------------------------
/license.txt:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/mysql/pom.xml:
--------------------------------------------------------------------------------
1 |
16 |
17 | zipkin-project
18 | io.fabric8
19 | 0.1-SNAPSHOT
20 |
21 | 4.0.0
22 |
23 | io.fabric8.zipkin
24 | zipkin-mysql
25 | Fabric8 :: Zipkin :: MySQL
26 | Zipkin MySQL storage
27 |
28 |
29 | docker.io/openzipkin/zipkin-mysql:${zipkin.version}
30 | fabric8/zipkin-mysql:${project.version}
31 |
32 |
33 |
34 |
35 |
36 |
37 | io.fabric8
38 | fabric8-maven-plugin
39 | ${fabric8.maven.plugin.version}
40 |
41 |
42 | fmp
43 |
44 | resource
45 | helm
46 | build
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 | release
57 |
58 |
59 |
60 | io.fabric8
61 | fabric8-maven-plugin
62 | ${fabric8.maven.plugin.version}
63 |
64 |
65 | fmp
66 |
67 | resource
68 | helm
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
--------------------------------------------------------------------------------
/mysql/src/main/fabric8/zipkin-mysql-cnf-configmap.yml:
--------------------------------------------------------------------------------
1 | ---
2 | apiVersion: "v1"
3 | kind: "ConfigMap"
4 | metadata:
5 | labels:
6 | provider: "fabric8"
7 | project: "${project.artifactId}"
8 | version: "${project.version}"
9 | group: "io.fabric8.zipkin"
10 | name: "zipkin-mysql-cnf"
11 | data:
12 | custom.cnf: |
13 | [mysqld]
14 | sql-mode=""
15 |
--------------------------------------------------------------------------------
/mysql/src/main/fabric8/zipkin-mysql-deployment.yml:
--------------------------------------------------------------------------------
1 | ---
2 | apiVersion: "extensions/v1beta1"
3 | kind: "Deployment"
4 | metadata:
5 | labels:
6 | provider: "fabric8"
7 | project: "${project.artifactId}"
8 | version: "${project.version}"
9 | group: "io.fabric8.zipkin"
10 | name: "zipkin-mysql"
11 | spec:
12 | replicas: 1
13 | selector:
14 | matchLabels:
15 | provider: "fabric8"
16 | project: "${project.artifactId}"
17 | group: "io.fabric8.zipkin"
18 | template:
19 | metadata:
20 | labels:
21 | provider: "fabric8"
22 | project: "${project.artifactId}"
23 | version: "${project.version}"
24 | group: "io.fabric8.zipkin"
25 | spec:
26 | containers:
27 | - env:
28 | - name: "MYSQL_USER"
29 | value: "zipkin"
30 | - name: "MYSQL_PASSWORD"
31 | value: "zipkin"
32 | - name: "MYSQL_ROOT_PASSWORD"
33 | value: "zipkin"
34 | - name: "MYSQL_DATABASE"
35 | value: "zipkin"
36 | - name: "KUBERNETES_NAMESPACE"
37 | valueFrom:
38 | fieldRef:
39 | fieldPath: "metadata.namespace"
40 | image: "mysql:5.7"
41 | name: "zipkin-mysql"
42 | readinessProbe:
43 | initialDelaySeconds: 5
44 | tcpSocket:
45 | port: 3306
46 | resources:
47 | limits:
48 | cpu: "0"
49 | memory: "0"
50 | requests:
51 | cpu: "0"
52 | memory: "0"
53 | volumeMounts:
54 | - name: mysql-data
55 | mountPath: /var/lib/mysql
56 | - name: mysql-init-script
57 | mountPath: /docker-entrypoint-initdb.d/
58 | - name: mysql-confd
59 | mountPath: /etc/mysql/conf.d/
60 | volumes:
61 | - name: mysql-data
62 | persistentVolumeClaim:
63 | claimName: mysql-data
64 | - name: mysql-init-script
65 | configMap:
66 | name: zipkin-mysql-initdb
67 | - name: mysql-confd
68 | configMap:
69 | name: zipkin-mysql-cnf
--------------------------------------------------------------------------------
/mysql/src/main/fabric8/zipkin-mysql-initdb-configmap.yml:
--------------------------------------------------------------------------------
1 | ---
2 | apiVersion: "v1"
3 | kind: "ConfigMap"
4 | metadata:
5 | labels:
6 | provider: "fabric8"
7 | project: "${project.artifactId}"
8 | version: "${project.version}"
9 | group: "io.fabric8.zipkin"
10 | name: "zipkin-mysql-initdb"
11 | data:
12 | init.sql: |
13 | CREATE TABLE IF NOT EXISTS zipkin_spans (
14 | `trace_id` BIGINT NOT NULL,
15 | `id` BIGINT NOT NULL,
16 | `name` VARCHAR(255) NOT NULL,
17 | `parent_id` BIGINT,
18 | `debug` BIT(1),
19 | `start_ts` BIGINT COMMENT 'Span.timestamp(): epoch micros used for endTs query and to implement TTL',
20 | `duration` BIGINT COMMENT 'Span.duration(): micros used for minDuration and maxDuration query'
21 | ) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
22 |
23 | ALTER TABLE zipkin_spans ADD UNIQUE KEY(`trace_id`, `id`) COMMENT 'ignore insert on duplicate';
24 | ALTER TABLE zipkin_spans ADD INDEX(`trace_id`, `id`) COMMENT 'for joining with zipkin_annotations';
25 | ALTER TABLE zipkin_spans ADD INDEX(`trace_id`) COMMENT 'for getTracesByIds';
26 | ALTER TABLE zipkin_spans ADD INDEX(`name`) COMMENT 'for getTraces and getSpanNames';
27 | ALTER TABLE zipkin_spans ADD INDEX(`start_ts`) COMMENT 'for getTraces ordering and range';
28 |
29 | CREATE TABLE IF NOT EXISTS zipkin_annotations (
30 | `trace_id` BIGINT NOT NULL COMMENT 'coincides with zipkin_spans.trace_id',
31 | `span_id` BIGINT NOT NULL COMMENT 'coincides with zipkin_spans.id',
32 | `a_key` VARCHAR(255) NOT NULL COMMENT 'BinaryAnnotation.key or Annotation.value if type == -1',
33 | `a_value` BLOB COMMENT 'BinaryAnnotation.value(), which must be smaller than 64KB',
34 | `a_type` INT NOT NULL COMMENT 'BinaryAnnotation.type() or -1 if Annotation',
35 | `a_timestamp` BIGINT COMMENT 'Used to implement TTL; Annotation.timestamp or zipkin_spans.timestamp',
36 | `endpoint_ipv4` INT COMMENT 'Null when Binary/Annotation.endpoint is null',
37 | `endpoint_ipv6` BINARY(16) COMMENT 'Null when Binary/Annotation.endpoint is null, or no IPv6 address',
38 | `endpoint_port` SMALLINT COMMENT 'Null when Binary/Annotation.endpoint is null',
39 | `endpoint_service_name` VARCHAR(255) COMMENT 'Null when Binary/Annotation.endpoint is null'
40 | ) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
41 |
42 | ALTER TABLE zipkin_annotations ADD UNIQUE KEY(`trace_id`, `span_id`, `a_key`, `a_timestamp`) COMMENT 'Ignore insert on duplicate';
43 | ALTER TABLE zipkin_annotations ADD INDEX(`trace_id`, `span_id`) COMMENT 'for joining with zipkin_spans';
44 | ALTER TABLE zipkin_annotations ADD INDEX(`trace_id`) COMMENT 'for getTraces/ByIds';
45 | ALTER TABLE zipkin_annotations ADD INDEX(`endpoint_service_name`) COMMENT 'for getTraces and getServiceNames';
46 | ALTER TABLE zipkin_annotations ADD INDEX(`a_type`) COMMENT 'for getTraces';
47 | ALTER TABLE zipkin_annotations ADD INDEX(`a_key`) COMMENT 'for getTraces';
48 |
49 | CREATE TABLE IF NOT EXISTS zipkin_dependencies (
50 | `day` DATE NOT NULL,
51 | `parent` VARCHAR(255) NOT NULL,
52 | `child` VARCHAR(255) NOT NULL,
53 | `call_count` BIGINT
54 | ) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
55 |
56 | ALTER TABLE zipkin_dependencies ADD UNIQUE KEY(`day`, `parent`, `child`);
57 | GRANT SELECT, INSERT, UPDATE, DELETE ON zipkin.* TO zipkin@'%' IDENTIFIED BY 'zipkin' WITH GRANT OPTION ;
58 | FLUSH PRIVILEGES;
59 |
--------------------------------------------------------------------------------
/mysql/src/main/fabric8/zipkin-mysql-pvc.yml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: PersistentVolumeClaim
3 | metadata:
4 | name: mysql-data
5 | spec:
6 | accessModes:
7 | - ReadWriteOnce
8 | resources:
9 | requests:
10 | storage: 100Mi
11 | volumeName: mysql-data
--------------------------------------------------------------------------------
/mysql/src/main/fabric8/zipkin-mysql-svc.yml:
--------------------------------------------------------------------------------
1 | ---
2 | apiVersion: "v1"
3 | kind: "Service"
4 | metadata:
5 | labels:
6 | provider: "fabric8"
7 | project: "${project.artifactId}"
8 | version: "${project.version}"
9 | group: "io.fabric8.zipkin"
10 | name: "zipkin-mysql"
11 | spec:
12 | ports:
13 | - port: 3306
14 | protocol: "TCP"
15 | targetPort: 3306
16 | selector:
17 | project: "zipkin-mysql"
18 | provider: "fabric8"
19 | group: "io.fabric8.zipkin"
20 | type: "LoadBalancer"
21 |
--------------------------------------------------------------------------------
/packages/distro/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
21 |
22 | packages
23 | io.fabric8.zipkin
24 | 0.1-SNAPSHOT
25 |
26 | 4.0.0
27 |
28 | io.fabric8.zipkin.packages
29 | distro
30 | pom
31 | Fabric8 :: Zipkin :: Packages :: Distro
32 | ZipKin components
33 |
34 |
35 |
36 | io.fabric8.zipkin.packages
37 | zipkin
38 | ${project.version}
39 | kubernetes
40 | json
41 |
42 |
43 |
44 |
45 |
46 |
47 | maven-assembly-plugin
48 | 2.5.4
49 |
50 |
51 | src/main/assembly/templates.xml
52 |
53 |
54 |
55 |
56 | make-assembly
57 |
58 | package
59 |
60 |
61 | single
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
--------------------------------------------------------------------------------
/packages/distro/src/main/assembly/templates.xml:
--------------------------------------------------------------------------------
1 |
16 |
17 |
20 | templates
21 |
22 | zip
23 |
24 | false
25 |
26 |
27 | true
28 |
29 |
30 | io.fabric8.zipkin.packages:*:json:kubernetes:*
31 |
32 | /main
33 | ${artifact.artifactId}-${artifact.version}.json
34 |
35 |
36 |
--------------------------------------------------------------------------------
/packages/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
21 |
22 | zipkin-project
23 | io.fabric8
24 | 0.1-SNAPSHOT
25 |
26 | 4.0.0
27 |
28 | io.fabric8.zipkin
29 | packages
30 | pom
31 | Fabric8 :: Zipkin :: Packages
32 |
33 |
34 | distro
35 | zipkin
36 |
37 |
38 |
--------------------------------------------------------------------------------
/packages/zipkin/pom.xml:
--------------------------------------------------------------------------------
1 |
16 |
17 | packages
18 | io.fabric8.zipkin
19 | 0.1-SNAPSHOT
20 |
21 | 4.0.0
22 |
23 | io.fabric8.zipkin.packages
24 | zipkin
25 | Fabric8 :: Zipkin :: Packages :: Zipkin
26 | Zipkin Package
27 |
28 |
29 | 2.2.153
30 |
31 |
32 |
33 |
34 |
35 | io.fabric8
36 | fabric8-maven-plugin
37 | ${fabric8.maven.plugin.version}
38 |
39 |
40 |
41 | fmp-controller
42 |
43 |
44 |
45 |
46 |
47 | fmp
48 |
49 | resource
50 | helm
51 |
52 |
53 |
54 |
55 |
56 | io.fabric8.zipkin
57 | zipkin
58 | ${project.version}
59 |
60 |
61 |
62 | io.fabric8.zipkin
63 | zipkin-mysql
64 | ${project.version}
65 |
66 |
67 |
68 |
69 | io.fabric8.ipaas.apps
70 | zookeeper
71 | ${ipaas.version}
72 |
73 |
74 |
75 | io.fabric8.ipaas.apps
76 | kafka
77 | ${ipaas.version}
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 | release
87 |
88 |
89 |
90 | io.fabric8
91 | fabric8-maven-plugin
92 | ${fabric8.maven.plugin.version}
93 |
94 |
95 | fmp
96 |
97 | resource
98 | helm
99 | build
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 | docker
109 |
110 |
111 |
112 | io.fabric8
113 | fabric8-maven-plugin
114 | ${fabric8.maven.plugin.version}
115 |
116 |
117 | fmp
118 |
119 | build
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
--------------------------------------------------------------------------------
/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 | 4.0.0
20 |
21 |
22 |
23 | org.sonatype.oss
24 | oss-parent
25 | 9
26 |
27 |
28 | io.fabric8
29 | zipkin-project
30 | 0.1-SNAPSHOT
31 | pom
32 | Fabric8 :: Zipkin :: Project
33 |
34 | http://fabric8.io/
35 | 2015
36 |
37 |
38 | Red Hat
39 | http://redhat.com
40 |
41 |
42 |
43 |
44 | Apache License, Version 2.0
45 | http://www.apache.org/licenses/LICENSE-2.0.txt
46 | repo
47 |
48 |
49 |
50 |
52 |
53 |
54 | geeks
55 | Fabric8 Development Team
56 | fabric8
57 | http://fabric8.io/
58 |
59 |
60 |
61 |
62 | scm:git:git@github.com:fabric8io/kubeflix.git
63 | scm:git:git@github.com:fabric8io/kubeflix.git
64 | http://github.com/fabric8io/kubeflix/
65 | ${project.version}
66 |
67 |
68 |
69 |
70 | oss-sonatype-staging
71 | Sonatype Staging Repository
72 | https://oss.sonatype.org/service/local/staging/deploy/maven2
73 |
74 |
75 |
76 |
77 |
78 | kubernetes
79 |
80 |
81 | 3.0.12
82 | 1.25.0
83 | 4.12
84 |
85 | 3.2.28
86 | 2.6
87 | 3.5
88 | 2.18.1
89 |
90 | true
91 | **/*KubernetesTest*.java
92 |
93 |
94 |
95 |
96 | zipkin
97 | mysql
98 | starter
99 | starter-mysql
100 | starter-minimal
101 | examples
102 | packages
103 |
104 |
105 |
106 |
107 |
108 |
109 | io.fabric8
110 | fabric8-project-bom-with-platform-deps
111 | ${fabric8.version}
112 | pom
113 | import
114 |
115 |
116 |
117 | junit
118 | junit
119 | ${junit.version}
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 | org.apache.maven.plugins
128 | maven-compiler-plugin
129 | ${maven-compiler-plugin.version}
130 | true
131 |
132 | 1.8
133 | 1.8
134 |
135 |
136 |
137 | io.fabric8
138 | fabric8-maven-plugin
139 | ${fabric8.maven.plugin.version}
140 |
141 |
142 | org.apache.maven.plugins
143 | maven-surefire-plugin
144 | ${maven-surefire-plugin.version}
145 | true
146 |
147 |
148 | ${k8s.test.pattern}
149 |
150 |
151 |
152 |
153 | k8s-test
154 |
155 | test
156 |
157 |
158 | ${k8s.skip.test}
159 |
160 | none
161 |
162 |
163 | ${k8s.test.pattern}
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 | release
175 |
176 |
177 |
178 | org.apache.maven.plugins
179 | maven-gpg-plugin
180 |
181 |
182 | sign-artifacts
183 | verify
184 |
185 | sign
186 |
187 |
188 |
189 |
190 |
191 | org.apache.maven.plugins
192 | maven-enforcer-plugin
193 | 1.3.1
194 |
195 |
196 | enforce-no-snapshots
197 |
198 | enforce
199 |
200 |
201 |
202 |
203 | No Snapshots Allowed!
204 |
205 |
206 | false
207 |
208 |
209 |
210 |
211 |
212 | org.apache.maven.plugins
213 | maven-javadoc-plugin
214 | 2.10.3
215 |
216 | ${javadoc.include.deps}
217 |
218 | ${javadoc.source.includes}
219 |
220 | ${javadoc.package.excludes}
221 |
222 |
223 |
224 | attach-javadocs
225 |
226 | jar
227 |
228 |
229 | ${javadoc.opts}
230 |
231 |
232 |
233 |
234 |
235 | org.apache.maven.plugins
236 | maven-source-plugin
237 | 2.4
238 |
239 |
240 | attach-sources
241 |
242 | jar
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 | f8-build
252 |
253 | clean install fabric8:resource fabric8:build
254 |
255 |
256 |
257 | f8-deploy
258 |
259 | Always
260 | true
261 |
262 |
263 | clean install fabric8:resource fabric8:build fabric8:push fabric8:apply
264 |
265 |
266 |
267 | f8-local-deploy
268 |
269 | true
270 |
271 |
272 | clean package fabric8:resource fabric8:build fabric8:apply
273 |
274 |
275 |
276 | doclint-java8-disable
277 |
278 | [1.8,)
279 |
280 |
281 | -Xdoclint:none
282 |
283 |
284 |
285 |
286 |
--------------------------------------------------------------------------------
/readme.md:
--------------------------------------------------------------------------------
1 | Kubernetes ZipKin
2 | -----------------
3 |
4 | The project provides all the required resources to start the required [ZipKin](http://zipkin.io/) components in [Kubernetes](http://kubernetes.io/) and [Openshift](https://www.openshift.com) to trace your microservices.
5 |
6 | It has been also tested against [Minikube](https://github.com/kubernetes/minikube) and [Minishift](https://github.com/jimmidyson/minishift).
7 |
8 | [](https://maven-badges.herokuapp.com/maven-central/io.fabric8.zipkin/zipkin-starter-minimal/) 
9 |
10 | **Table of Contents**
11 |
12 | - [Getting Started](#getting-started)
13 | - [Installation](#installation)
14 | - [Direct Installation](#direct-installation)
15 | - [Installation using Maven](#installation-using-maven)
16 | - [Mysql Starter](#mysql-starter)
17 | - [Minimal Starter](#minimal-starter)
18 | - [Running the integration tests](#running-the-integration-tests)
19 | - [Using the console](#using-the-console)
20 | - [Minikube](#minikube)
21 | - [Minishift](#minishift)
22 | - [Using port forward](#using-port-forward)
23 | - [Assigning externally reachable URLs](#assigning-externally-reachable-urls)
24 | - [Prometheus Integration](#prometheus-integration)
25 | - [Community](#community)
26 | - [Zipkin](#zipkin)
27 | - [Kubernetes](#kubernetes)
28 | - [Fabric8](#fabric8)
29 |
30 | ### Getting Started
31 |
32 | To install ZipKin in kubernetes you need to create the deployment and services that corresponds to the ZipKin components and their requirements.
33 |
34 | There are 2 ways of doing that:
35 |
36 | - Direct installation
37 | - Generating and installing via Maven
38 |
39 | ### Installation
40 |
41 | #### Direct installation
42 |
43 | To directly install everything you need:
44 |
45 | kubectl create -f http://repo1.maven.org/maven2/io/fabric8/zipkin/zipkin-starter/0.1.5/zipkin-starter-0.1.5-kubernetes.yml
46 |
47 | or if you are using openshift:
48 |
49 | oc create -f http://repo1.maven.org/maven2/io/fabric8/zipkin/zipkin-starter/0.1.5/zipkin-starter-0.1.5-openshift.yml
50 |
51 | To directly install a minimal ZipKin *(just storage and query)*:
52 |
53 | kubectl create -f http://repo1.maven.org/maven2/io/fabric8/zipkin/zipkin-starter-minimal/0.1.5/zipkin-starter-minimal-0.1.5-kubernetes.yml
54 |
55 | or if you are using openshift:
56 |
57 | oc create -f http://repo1.maven.org/maven2/io/fabric8/zipkin/zipkin-starter-minimal/0.1.5/zipkin-starter-minimal-0.1.5-openshift.yml
58 |
59 | Both of the above are released in json format too.
60 |
61 | Zipkin uses a storage backend (it can be mysql, cassandra or elastic search, but currently this project only supports mysql). The storage requires a persistence volume.
62 | So the next step is to create it. So you either need to create a persistence volume named `mysql-data`.
63 |
64 | Or if you are using [gofabric8](https://github.com/fabric8io/gofabric8), it can automatically create it for you:
65 |
66 | gofabric8 volumes
67 |
68 |
69 | #### Installation using Maven
70 |
71 | The configuration that was downloaded from the internet in the previous step can also be generated using the starter modules.
72 | The starter module are plain maven projects that generate and apply kubernetes/openshift configuration using the [Fabric8 Maven Plugin](http://fabric8.io/guide/mavenPlugin.html)
73 |
74 | Currently the available starters are:
75 |
76 | - starter-mysql
77 | - starter-minimal
78 |
79 | ##### MySQL Starter
80 |
81 | The mysql starter will generate and install Zipkin using MySQL as a storage module.
82 |
83 | mvn clean install
84 | mvn fabric8:deploy -pl starter-mysql
85 |
86 | The first command will build the whole project and the second will apply the resources to kubernetes (including its dependencies).
87 | So after using the above in a clean workspace, your workspace should look like this:
88 |
89 |
90 | kubectl get pods
91 |
92 | NAME | READY|STATUS|RESTARTS|AGE
93 | -----|------|------|--------|---
94 | kafka-qw13r|1/1|Running|0|8m
95 | zipkin-mysql-ygm1g|1/1|Running|0|8m
96 | zipkin-roxae|1/1|Running|0|8m
97 | zookeeper-1-my183|1/1|Running|0|8m
98 | zookeeper-2-jx8eq|1/1|Running|0|8m
99 | zookeeper-3-d1icz|1/1|Running|0|8m
100 |
101 | ##### Minimal Starter
102 |
103 | The minimal starter will generate and install a Zipkin without a collector and using MySQL as a storage module. This can be also "considered" a dev mode.
104 |
105 | mvn clean install
106 | mvn fabric8:deploy -pl starter-minimal
107 |
108 | This time kafka and zookeeper will not be installed at all.
109 |
110 | NAME | READY|STATUS|RESTARTS|AGE
111 | -----|------|------|--------|---
112 | zipkin-mysql-d4msa|1/1|Running|0|8m
113 | zipkin-rpxfw|1/1|Running|0|8m
114 |
115 | ### Running the integration tests
116 |
117 | Some really basic integration tests have been added. The purpose of those tests is to check that configuration and images are working.
118 | The integration tests are based on [Fabric8 Arquillian](http://fabric8.io/guide/testing.html) and require an existing Kubernetes/Openshift environment.
119 | So they are disabled by default. To enabled and run them:
120 |
121 | mvn clean install -Dk8s.skip.test=false
122 |
123 | ### Using the console
124 |
125 | Once the zipkin pod is ready, you will be able to access the console using the zipkin service.
126 |
127 | 
128 |
129 | Depending on the Kubernetes flavor, cloud provider etc, the way to access the console may vary, but for dev time, this should work:
130 |
131 |
132 | #### Minikube
133 |
134 | With minikube you can just use:
135 |
136 | minikube service zipkin
137 |
138 | and the console should pop right up in your browser.
139 |
140 | #### Minishift
141 |
142 | Similarly with minishift:
143 |
144 | minishift service zipkin
145 |
146 | #### Using port forward
147 |
148 | A more generic approach that should work everywhere is, using port forwarding.
149 |
150 | You can grab the list of pods and detect the zipkin pod:
151 |
152 | kubectl get pods
153 |
154 | It should be something like:
155 |
156 | zipkin-1623767123-g3j00 1/1 Running 1 1d
157 |
158 | Then you can use port-forward so that you can access the service locally.
159 |
160 | kubectl port-forward zipkin-1623767123-g3j00 9411 9411
161 |
162 | or if I'd like to use a random local port:
163 |
164 | kubectl port-forward zipkin-1623767123-g3j00 :9411
165 |
166 | #### Assigning externally reachable URLs
167 |
168 | To see how can assign externally reachable url to Kubernetes services, you may want to have a look at [Ingress](https://kubernetes.io/docs/user-guide/ingress/).
169 |
170 | Or for Openshift services, you may want to have a look at [Routes](https://docs.openshift.com/enterprise/3.0/architecture/core_concepts/routes.html).
171 |
172 | ### Prometheus integration
173 |
174 | As of 0.1.5 kubernetes-zipkin comes with prometheus annotations, so that the the zipkin server is monitored by prometheus.
175 | You can easily try out this feature by installing prometheus:
176 |
177 | kubectl create -f http://repo1.maven.org/maven2/io/fabric8/devops/apps/prometheus/2.2.259/prometheus-2.2.259-kubernetes.yml
178 |
179 | or on openshift:
180 |
181 | oc create -f http://repo1.maven.org/maven2/io/fabric8/devops/apps/prometheus/2.2.259/prometheus-2.2.259-openshift.yml
182 |
183 |
184 | ### Community
185 |
186 | If you want to get involved, get help or contribute, please find below some useful links
187 |
188 | #### Zipkin
189 |
190 | Some useful links:
191 |
192 | - [Zipkin Organization on Github](https://github.com/openzipkin)
193 | - [Zipkin channel on Gitter](https://gitter.im/openzipkin/zipkin)
194 |
195 | #### Kubernetes
196 |
197 | - [Kubernetes Organization on Github](https://github.com/kubernetes)
198 | - [Kubernetes Community Page](https://kubernetes.io/community/)
199 | - [Kubernetes on Slack](http://slack.k8s.io/)
200 |
201 | #### Fabric8
202 |
203 | - [Fabric8 Organization on Github](https://github.com/fabric8io)
204 | - [Fabric8 Community Page](http://fabric8.io/community/)
205 |
--------------------------------------------------------------------------------
/release.groovy:
--------------------------------------------------------------------------------
1 | #!/usr/bin/groovy
2 | def updateDependencies(source){
3 |
4 | def properties = []
5 | // the FIS releases breaks this logic
6 | // properties << ['','io/fabric8/kubernetes-generator']
7 | // properties << ['','io/fabric8/fabric8-maven-plugin']
8 |
9 | updatePropertyVersion{
10 | updates = properties
11 | repository = source
12 | project = 'fabric8io/kubernetes-zipkin'
13 | }
14 | }
15 |
16 | def stage(){
17 | return stageProject{
18 | project = 'fabric8io/kubernetes-zipkin'
19 | useGitTagForNextVersion = true
20 | }
21 | }
22 |
23 | def approveRelease(project){
24 | def releaseVersion = project[1]
25 | approve{
26 | room = null
27 | version = releaseVersion
28 | console = null
29 | environment = 'fabric8'
30 | }
31 | }
32 |
33 | def release(project){
34 | releaseProject{
35 | stagedProject = project
36 | useGitTagForNextVersion = true
37 | helmPush = false
38 | groupId = 'io.fabric8.zipkin'
39 | githubOrganisation = 'fabric8io'
40 | artifactIdToWatchInCentral = 'zipkin-starter'
41 | artifactExtensionToWatchInCentral = 'jar'
42 | promoteToDockerRegistry = 'docker.io'
43 | dockerOrganisation = 'fabric8'
44 | imagesToPromoteToDockerHub = []
45 | extraImagesToTag = null
46 | }
47 | }
48 |
49 | def updateDownstreamDependencies(stagedProject) {
50 | pushPomPropertyChangePR {
51 | propertyName = 'kubernetes.zipkin.version'
52 | projects = [
53 | 'fabric8io/fabric8-platform',
54 | 'fabric8io/fabric8-maven-dependencies',
55 | 'fabric8io/ipaas-platform'
56 | ]
57 | version = stagedProject[1]
58 | }
59 | }
60 |
61 | def mergePullRequest(prId){
62 | mergeAndWaitForPullRequest{
63 | project = 'fabric8io/kubernetes-zipkin'
64 | pullRequestId = prId
65 | }
66 |
67 | }
68 | return this;
69 |
--------------------------------------------------------------------------------
/starter-minimal/pom.xml:
--------------------------------------------------------------------------------
1 |
16 |
17 | zipkin-project
18 | io.fabric8
19 | 0.1-SNAPSHOT
20 |
21 | 4.0.0
22 |
23 | io.fabric8.zipkin
24 | zipkin-starter-minimal
25 | Fabric8 :: Zipkin :: Starter :: Minimal
26 | Starter module for installing Zipkin (minimal) into Kubernetes.
27 |
28 |
29 |
30 |
31 |
32 |
33 | io.fabric8.zipkin
34 | zipkin
35 | ${project.version}
36 |
37 |
38 |
39 | io.fabric8.zipkin
40 | zipkin-mysql
41 | ${project.version}
42 |
43 |
44 |
45 |
46 | org.jboss.arquillian.junit
47 | arquillian-junit-container
48 | test
49 |
50 |
51 |
52 | io.fabric8
53 | fabric8-arquillian
54 | test
55 |
56 |
57 |
58 | io.fabric8
59 | kubernetes-assertions
60 | test
61 |
62 |
63 |
64 | junit
65 | junit
66 | test
67 |
68 |
69 |
70 |
71 |
72 |
73 | io.fabric8
74 | fabric8-maven-plugin
75 | ${fabric8.maven.plugin.version}
76 |
77 |
78 |
79 | fmp-controller
80 |
81 |
82 |
83 |
84 |
85 | fmp
86 |
87 | resource
88 | helm
89 |
90 |
91 |
92 |
93 |
94 | org.apache.maven.plugins
95 | maven-jar-plugin
96 | ${maven-jar-plugin.version}
97 |
98 |
99 |
100 | test-jar
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
--------------------------------------------------------------------------------
/starter-minimal/src/main/resources/kubernetes.json:
--------------------------------------------------------------------------------
1 | {
2 | "kind" : "List",
3 | "apiVersion" : "v1",
4 | "items" : [ ]
5 | }
--------------------------------------------------------------------------------
/starter-minimal/src/test/java/io/fabric8/zipkin/starter/minimal/ZipkinMinimalKubernetesTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 to origin authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * 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
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package io.fabric8.zipkin.starter.minimal;
18 |
19 |
20 | import okhttp3.OkHttpClient;
21 | import okhttp3.Request;
22 | import okhttp3.Response;
23 | import io.fabric8.annotations.ServiceName;
24 | import io.fabric8.arquillian.kubernetes.Session;
25 | import io.fabric8.kubernetes.api.KubernetesHelper;
26 | import io.fabric8.kubernetes.api.model.Service;
27 | import io.fabric8.kubernetes.client.utils.URLUtils;
28 | import org.jboss.arquillian.container.test.api.RunAsClient;
29 | import org.jboss.arquillian.junit.Arquillian;
30 | import org.jboss.arquillian.test.api.ArquillianResource;
31 | import org.junit.Assert;
32 | import org.junit.Test;
33 | import org.junit.runner.RunWith;
34 |
35 | @RunWith(Arquillian.class)
36 | public class ZipkinMinimalKubernetesTest {
37 |
38 | @ArquillianResource
39 | Session session;
40 |
41 | @ServiceName("zipkin")
42 | @ArquillianResource
43 | Service service;
44 |
45 | @Test
46 | @RunAsClient
47 | public void testConnectionToZipkinQuery() throws Exception {
48 | String url = URLUtils.join(KubernetesHelper.getServiceURL(service), "/api/v1/services");
49 | OkHttpClient httpClient = new OkHttpClient();
50 | try {
51 | Request request = new Request.Builder().get().url(url).build();
52 | Response response = httpClient.newCall(request).execute();
53 | Assert.assertNotNull(response);
54 | Assert.assertEquals(200, response.code());
55 | } finally {
56 | close(httpClient);
57 | }
58 | }
59 |
60 | private void close(OkHttpClient httpClient) {
61 | if (httpClient.connectionPool() != null) {
62 | httpClient.connectionPool().evictAll();
63 | }
64 | if (httpClient.dispatcher() != null &&
65 | httpClient.dispatcher().executorService() != null &&
66 | !httpClient.dispatcher().executorService().isShutdown()
67 | ) {
68 | httpClient.dispatcher().executorService().shutdown();
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/starter-mysql/pom.xml:
--------------------------------------------------------------------------------
1 |
16 |
17 | zipkin-project
18 | io.fabric8
19 | 0.1-SNAPSHOT
20 |
21 | 4.0.0
22 |
23 | io.fabric8.zipkin
24 | zipkin-starter-mysql
25 | Fabric8 :: Zipkin :: Starter :: MySQL
26 | Starter module for installing Zipkin into Kubernetes
27 |
28 |
29 | 2.2.153
30 |
31 |
32 |
33 |
34 | io.fabric8.zipkin
35 | zipkin
36 | ${project.version}
37 |
38 |
39 |
40 | io.fabric8.zipkin
41 | zipkin-mysql
42 | ${project.version}
43 |
44 |
45 |
46 |
47 | io.fabric8.ipaas.apps
48 | zookeeper
49 | ${ipaas.version}
50 |
51 |
52 |
53 | io.fabric8.ipaas.apps
54 | kafka
55 | ${ipaas.version}
56 |
57 |
58 |
59 |
60 | io.fabric8.zipkin
61 | zipkin-starter-minimal
62 | ${project.version}
63 | test-jar
64 |
65 |
66 |
67 | org.jboss.arquillian.junit
68 | arquillian-junit-container
69 | test
70 |
71 |
72 |
73 | io.fabric8
74 | fabric8-arquillian
75 | test
76 |
77 |
78 |
79 | io.fabric8
80 | kubernetes-assertions
81 | test
82 |
83 |
84 |
85 | junit
86 | junit
87 | test
88 |
89 |
90 |
91 |
92 |
93 |
94 | io.fabric8
95 | fabric8-maven-plugin
96 | ${fabric8.maven.plugin.version}
97 |
98 |
99 |
100 | fmp-controller
101 |
102 |
103 |
104 |
105 |
106 | fmp
107 |
108 | resource
109 | helm
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
--------------------------------------------------------------------------------
/starter-mysql/src/main/resources/kubernetes.json:
--------------------------------------------------------------------------------
1 | {
2 | "kind" : "List",
3 | "apiVersion" : "v1",
4 | "items" : [ ]
5 | }
--------------------------------------------------------------------------------
/starter-mysql/src/test/java/io/fabric8/zipkin/starter/mysql/ZipkinMysqlKubernetesTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 to origin authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * 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
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package io.fabric8.zipkin.starter.mysql;
18 |
19 |
20 | import io.fabric8.zipkin.starter.minimal.ZipkinMinimalKubernetesTest;
21 | import org.jboss.arquillian.junit.Arquillian;
22 | import org.junit.runner.RunWith;
23 |
24 | @RunWith(Arquillian.class)
25 | public class ZipkinMysqlKubernetesTest extends ZipkinMinimalKubernetesTest {
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/starter/pom.xml:
--------------------------------------------------------------------------------
1 |
16 |
17 | zipkin-project
18 | io.fabric8
19 | 0.1-SNAPSHOT
20 |
21 | 4.0.0
22 |
23 | io.fabric8.zipkin
24 | zipkin-starter
25 | Fabric8 :: Zipkin :: Starter (Default)
26 | Starter module for installing Zipkin into Kubernetes. Its pretty much a copy of starter-mysql
27 |
28 |
29 | 2.2.153
30 |
31 |
32 |
33 |
34 | io.fabric8.zipkin
35 | zipkin
36 | ${project.version}
37 |
38 |
39 |
40 | io.fabric8.zipkin
41 | zipkin-mysql
42 | ${project.version}
43 |
44 |
45 |
46 |
47 | io.fabric8.ipaas.apps
48 | zookeeper
49 | ${ipaas.version}
50 |
51 |
52 | *
53 | *
54 |
55 |
56 |
57 |
58 |
59 | io.fabric8.ipaas.apps
60 | kafka
61 | ${ipaas.version}
62 |
63 |
64 | *
65 | *
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 | io.fabric8
75 | fabric8-maven-plugin
76 | ${fabric8.maven.plugin.version}
77 |
78 |
79 |
80 | fmp-controller
81 |
82 |
83 |
84 |
85 |
86 | fmp
87 |
88 | resource
89 | helm
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
--------------------------------------------------------------------------------
/starter/src/main/resources/kubernetes.json:
--------------------------------------------------------------------------------
1 | {
2 | "kind" : "List",
3 | "apiVersion" : "v1",
4 | "items" : [ ]
5 | }
--------------------------------------------------------------------------------
/zipkin/pom.xml:
--------------------------------------------------------------------------------
1 |
16 |
17 | zipkin-project
18 | io.fabric8
19 | 0.1-SNAPSHOT
20 |
21 | 4.0.0
22 |
23 | io.fabric8.zipkin
24 | zipkin
25 | Fabric8 :: Zipkin :: Query
26 | Zipkin query service
27 |
28 |
29 | openzipkin/zipkin:${zipkin.version}
30 |
31 |
32 |
33 |
34 |
35 |
36 | io.fabric8.zipkin
37 | zipkin-mysql
38 | ${project.version}
39 | kubernetes
40 | json
41 |
42 |
43 |
44 |
45 |
46 |
47 | io.fabric8
48 | fabric8-maven-plugin
49 | ${fabric8.maven.plugin.version}
50 |
51 |
52 | fmp
53 |
54 | resource
55 | helm
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/zipkin/src/main/fabric8/zipkin-deployment.yml:
--------------------------------------------------------------------------------
1 | ---
2 | apiVersion: "extensions/v1beta1"
3 | kind: "Deployment"
4 | metadata:
5 | labels:
6 | provider: "fabric8"
7 | project: "${project.artifactId}"
8 | version: "${project.version}"
9 | group: "io.fabric8.zipkin"
10 | name: "zipkin"
11 | spec:
12 | replicas: 1
13 | selector:
14 | matchLabels:
15 | provider: "fabric8"
16 | project: "${project.artifactId}"
17 | group: "io.fabric8.zipkin"
18 | template:
19 | metadata:
20 | labels:
21 | provider: "fabric8"
22 | project: "${project.artifactId}"
23 | version: "${project.version}"
24 | group: "io.fabric8.zipkin"
25 | spec:
26 | containers:
27 | - env:
28 | - name: "STORAGE_PORT_9042_TCP_ADDR"
29 | value: "zipkin-cassandra:9411"
30 | - name: "STORAGE_PORT_3306_TCP_ADDR"
31 | value: "zipkin-mysql:3306"
32 | - name: "STORAGE_TYPE"
33 | value: "mysql"
34 | - name: "TRANSPORT_TYPE"
35 | value: "http"
36 | - name: "KUBERNETES_NAMESPACE"
37 | valueFrom:
38 | fieldRef:
39 | fieldPath: "metadata.namespace"
40 | image: "openzipkin/zipkin:${zipkin.version}"
41 | name: "zipkin"
42 | readinessProbe:
43 | httpGet:
44 | path: "/api/v1/services"
45 | port: 9411
46 | initialDelaySeconds: 5
47 | resources:
48 | limits:
49 | cpu: "0"
50 | memory: "0"
51 | requests:
52 | cpu: "0"
53 | memory: "0"
54 |
--------------------------------------------------------------------------------
/zipkin/src/main/fabric8/zipkin-svc.yml:
--------------------------------------------------------------------------------
1 | ---
2 | apiVersion: "v1"
3 | kind: "Service"
4 | metadata:
5 | annotations:
6 | prometheus.io/scrape: 'true'
7 | prometheus.io/path: /prometheus
8 | prometheus.io/port: '9411'
9 | fabric8.io/app-menu: management
10 | labels:
11 | provider: "fabric8"
12 | project: "${project.artifactId}"
13 | version: "${project.version}"
14 | group: "io.fabric8.zipkin"
15 | name: "zipkin"
16 | spec:
17 | ports:
18 | - port: 80
19 | protocol: "TCP"
20 | targetPort: 9411
21 | selector:
22 | project: "zipkin"
23 | provider: "fabric8"
24 | group: "io.fabric8.zipkin"
25 | type: "LoadBalancer"
26 |
--------------------------------------------------------------------------------