-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds dependencies test #17
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
global: | ||
testDependencies: true | ||
|
||
# extra containers are in the same pod, so this means zipkin is accessible to | ||
# the example services by localhost (default) | ||
extraContainers: | ||
- name: frontend | ||
image: 'ghcr.io/openzipkin/brave-example:armeria' | ||
command: ['start-frontend'] | ||
ports: | ||
- containerPort: 8081 | ||
env: | ||
- name: 'ZIPKIN_BASEURL' | ||
value: 'http://localhost:9411/' | ||
- name: 'BACKEND_ENDPOINT' | ||
value: 'http://localhost:9000/api' | ||
readinessProbe: | ||
httpGet: | ||
path: /health | ||
port: 8081 | ||
initialDelaySeconds: 5 | ||
periodSeconds: 5 | ||
- name: backend | ||
image: 'ghcr.io/openzipkin/brave-example:armeria' | ||
command: ['start-backend'] | ||
ports: | ||
- containerPort: 9000 | ||
env: | ||
- name: 'ZIPKIN_BASEURL' | ||
value: 'http://localhost:9411/' | ||
readinessProbe: | ||
httpGet: | ||
path: /health | ||
port: 9000 | ||
initialDelaySeconds: 5 | ||
periodSeconds: 5 | ||
|
||
# test-connection runs in a different pod, so it can't hit the frontend unless | ||
# we expose a service port. | ||
extraServicePorts: | ||
- port: 8081 | ||
targetPort: 8081 | ||
protocol: TCP | ||
name: frontend |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -16,13 +16,31 @@ spec: | |||||
# Make sure zipkin registered in Eureka at startup | ||||||
args: [ 'wget -q --spider http://{{ include "zipkin.fullname" . }}:8761/eureka/v2/apps/ZIPKIN' ] | ||||||
{{- end }} | ||||||
{{ if .Values.global.testDependencies }} | ||||||
- name: get-frontend | ||||||
image: "ghcr.io/openzipkin/alpine:3.19.1" | ||||||
command: [ '/bin/sh', '-c' ] | ||||||
args: # Get the frontend service 3 times, after it is ready | ||||||
- > | ||||||
while ! wget -q --spider http://{{ include "zipkin.fullname" . }}:8081/health;do sleep 1; done && | ||||||
for i in 1 2 3;do wget -q --spider http://{{ include "zipkin.fullname" . }}:8081; done | ||||||
- name: get-dependencies | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The follow-up is.. we'll need a conditional here to invoke the dependencies cron job synchronously, when elasticsearch. |
||||||
image: 'ghcr.io/openzipkin/alpine:3.19.1' | ||||||
command: [ '/bin/sh', '-c' ] | ||||||
args: # Sleep for the trace to process, then get dependencies based on it | ||||||
- > | ||||||
echo '[{"parent":"frontend","child":"backend","callCount":3}]' > want.json && | ||||||
sleep 3 && | ||||||
wget -qO have.json --header "b3: 0" http://{{ include "zipkin.fullname" . }}:{{ .Values.service.port }}/api/v2/dependencies?endTs=$(( $(date +%s) * 1000 )) && | ||||||
diff -b want.json have.json | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes I code go ;) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Just kidding There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. haha true.. I'm not that go ;) |
||||||
{{ end }} | ||||||
- name: get-api | ||||||
image: "ghcr.io/openzipkin/alpine:3.19.1" | ||||||
command: [ '/bin/sh', '-c' ] | ||||||
# Get an arbitrary API endpoint using the ClusterIP and service port | ||||||
args: [ 'wget -q --spider --header "b3: cafebabecafebabe-cafebabecafebabe-1" http://{{ include "zipkin.fullname" . }}:{{ .Values.service.port }}/api/v2/services' ] | ||||||
{{- if .Values.zipkin.selfTracing.enabled }} | ||||||
- name: get-trace | ||||||
- name: get-self-trace | ||||||
image: 'ghcr.io/openzipkin/alpine:3.19.1' | ||||||
command: [ '/bin/sh', '-c' ] | ||||||
# If self-tracing, sleep for the trace to process. Then, get it by the constant ID passed above. | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
used a global here as cycling through a list of objects to pick if "frontend" is there, is quite complicated in helm. maps are easier than lists