-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Tracing Add-on For Linkerd #3955
Merged
Merged
Changes from 13 commits
Commits
Show all changes
50 commits
Select commit
Hold shift + click to select a range
442c787
Moves Common templates needed to partials
Pothulapati 6eba3da
add tracing add-on helm chart
Pothulapati a428e96
Updated Install path to also install add-ons
Pothulapati a4db942
Updates Linkerd install path to also install add-ons
Pothulapati 9827600
Updates the upgrade path about add-ons.
Pothulapati d6eb6db
Refactor linkerd-values and re-update tests
Pothulapati c303d02
Refactor code to fix linting issues
Pothulapati 1bb5fa4
Fixes an error with linkerd-config global values
Pothulapati b8f7182
Fix a nil pointer issue for tests
Pothulapati b72b7f8
Merge branch 'master' into addon-tracing
Pothulapati df90cb3
Updated Tracing add-on chart meta-data
Pothulapati 6f3fa94
Add add-on/charts to gitignore
Pothulapati 89fc1df
refactor gitignore for chart deps
Pothulapati 94f2340
Moves sub-charts to /charts directly
Pothulapati 1347e12
Refactor linkerd values cm
Pothulapati b0e013d
Add comment in linkerd-values
Pothulapati 27347ab
Merge branch 'master' into addon-tracing
Pothulapati 048e696
remove extra controlplanetracing flag
Pothulapati 42bffa9
Support Stages deployment for add-ons along with tests
Pothulapati d8bb871
linting fix
Pothulapati 72d1c0d
update tracing rbac
Pothulapati 544660e
Removes the need for add-on Interface
Pothulapati 86e17bf
disable tracing flag
Pothulapati 0e316bb
Remove dep on forked mergo
Pothulapati 1bfcfc6
Re-use helm's merge
Pothulapati 6fb3f1e
Merge branch 'master' into addon-tracing
Pothulapati 19be7f7
Override the chartDir path during tests
Pothulapati e8629b6
add error check
Pothulapati e28efdd
Updated the dependency iteration code
Pothulapati b5f3882
Hard Code add-ons name
Pothulapati faed2d0
Remove struct details for add-ons
Pothulapati a7acaad
update unit tests
Pothulapati ab8965e
linting fix
Pothulapati b1fc765
Rename flag to addon-config
Pothulapati 2b90e20
Use Chart loading logic
Pothulapati 216fdaa
Go fmt fix
Pothulapati bc5829f
Update the linkerd-values cm to use second level field
Pothulapati 262287d
Add relevant unit tests for mergeRaw
Pothulapati b9d941b
linting fix
Pothulapati 721b5b4
Move addon tests to a new file
Pothulapati 2f50ee7
Fix golden files
Pothulapati 8461251
remove addon install unit test
Pothulapati 250e0e2
Refactor sub-chart load logic
Pothulapati bc32082
Add install tracing unit test
Pothulapati 12f7b1a
golden file update for tracing install
Pothulapati a669666
Merge branch 'master' into addon-tracing
Pothulapati cb8b486
Update golden files to reflect another pr changes
Pothulapati 829ba04
Move addon-config flag to recordFlagSet
Pothulapati 8ef593c
add relevant tracing enabled checks
Pothulapati 26b28ad
linting fix
Pothulapati File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,4 @@ web/app/yarn-error.log | |
.gorun | ||
**/*.gogen* | ||
**/*.swp | ||
charts/*/charts/ | ||
charts/**/add-ons/*/charts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
apiVersion: v1 | ||
appVersion: "1.0" | ||
description: A Helm chart for the tracing add-on in Linkerd | ||
name: tracing | ||
version: 0.1.0 | ||
maintainers: | ||
- name: Linkerd authors | ||
email: [email protected] | ||
url: https://linkerd.io/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
dependencies: | ||
- name: partials | ||
repository: file://../../../partials | ||
version: 0.1.0 | ||
digest: sha256:5eedd268cf82aa72641060432d2edfd9b350a27e022d243e9b71ac34e1cd6f8d | ||
generated: "2020-01-20T11:13:11.118660681+05:30" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
dependencies: | ||
- name: partials | ||
version: 0.1.0 | ||
repository: file://../../../partials |
26 changes: 26 additions & 0 deletions
26
charts/linkerd2/add-ons/tracing/templates/tracing-rbac.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
### | ||
### linkerd-collector RBAC | ||
### | ||
--- | ||
kind: ServiceAccount | ||
apiVersion: v1 | ||
metadata: | ||
name: linkerd-collector | ||
namespace: linkerd | ||
labels: | ||
{{.Values.global.controllerComponentLabel}}: {{.Values.collector.name}} | ||
{{.Values.global.controllerNamespaceLabel}}: {{.Values.global.namespace}} | ||
--- | ||
### | ||
### linkerd-jaeger RBAC | ||
### | ||
--- | ||
kind: ServiceAccount | ||
apiVersion: v1 | ||
metadata: | ||
name: linkerd-jaeger | ||
namespace: linkerd | ||
labels: | ||
{{.Values.global.controllerComponentLabel}}: {{.Values.jaeger.name}} | ||
{{.Values.global.controllerNamespaceLabel}}: {{.Values.global.namespace}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,223 @@ | ||
--- | ||
### | ||
### Tracing Collector Service | ||
### | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{printf "%s-config" .Values.collector.name}} | ||
namespace: {{.Values.global.namespace}} | ||
labels: | ||
{{.Values.global.controllerComponentLabel}}: {{.Values.collector.name}} | ||
{{.Values.global.controllerNamespaceLabel}}: {{.Values.global.namespace}} | ||
annotations: | ||
{{.Values.global.createdByAnnotation}}: {{default (printf "linkerd/helm %s" .Values.global.linkerdVersion) .Values.global.cliVersion}} | ||
data: | ||
linkerd-collector-config: | | ||
receivers: | ||
opencensus: | ||
port: 55678 | ||
zipkin: | ||
port: 9411 | ||
queued-exporters: | ||
jaeger-all-in-one: | ||
num-workers: 4 | ||
queue-size: 100 | ||
retry-on-failure: true | ||
sender-type: jaeger-thrift-http | ||
jaeger-thrift-http: | ||
collector-endpoint: {{printf "http://%s.%s:14268/api/traces" .Values.jaeger.name .Values.global.namespace }} | ||
timeout: 5s | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{.Values.collector.name}} | ||
namespace: {{.Values.global.namespace}} | ||
labels: | ||
{{.Values.global.controllerComponentLabel}}: {{.Values.collector.name}} | ||
{{.Values.global.controllerNamespaceLabel}}: {{.Values.global.namespace}} | ||
annotations: | ||
{{.Values.global.createdByAnnotation}}: {{default (printf "linkerd/helm %s" .Values.global.linkerdVersion) .Values.global.cliVersion}} | ||
spec: | ||
type: ClusterIP | ||
ports: | ||
- name: opencensus | ||
port: 55678 | ||
protocol: TCP | ||
targetPort: 55678 | ||
- name: zipkin | ||
port: 9411 | ||
protocol: TCP | ||
targetPort: 9411 | ||
selector: | ||
{{.Values.global.controllerComponentLabel}}: {{.Values.collector.name}} | ||
--- | ||
{{ if empty .Values.global.proxy.image.version -}} | ||
{{ $_ := set .Values.global.proxy.image "Version" .Values.global.linkerdVersion -}} | ||
{{ end -}} | ||
{{ $_ := set .Values.global.proxy "workloadKind" "deployment" -}} | ||
{{ $_ := set .Values.global.proxy "component" .Values.collector.name -}} | ||
{{ include "linkerd.proxy.validation" .Values.global.proxy -}} | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
annotations: | ||
{{.Values.global.createdByAnnotation}}: {{default (printf "linkerd/helm %s" .Values.global.linkerdVersion) .Values.global.cliVersion}} | ||
labels: | ||
app.kubernetes.io/name: {{.Values.collector.name}} | ||
app.kubernetes.io/part-of: Linkerd | ||
app.kubernetes.io/version: {{default .Values.global.linkerdVersion .Values.controllerImageVersion}} | ||
{{.Values.global.controllerComponentLabel}}: {{.Values.collector.name}} | ||
{{.Values.global.controllerNamespaceLabel}}: {{.Values.global.namespace}} | ||
name: {{.Values.collector.name}} | ||
namespace: {{.Values.global.namespace}} | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
{{.Values.global.controllerComponentLabel}}: {{.Values.collector.name}} | ||
{{.Values.global.controllerNamespaceLabel}}: {{.Values.global.namespace}} | ||
{{- include "partials.proxy.labels" .Values.global.proxy | nindent 6}} | ||
minReadySeconds: 5 | ||
progressDeadlineSeconds: 120 | ||
template: | ||
metadata: | ||
annotations: | ||
{{.Values.global.createdByAnnotation}}: {{default (printf "linkerd/helm %s" .Values.global.linkerdVersion) .Values.global.cliVersion}} | ||
{{- include "partials.proxy.annotations" .Values.global.proxy| nindent 8}} | ||
prometheus.io/path: /metrics | ||
prometheus.io/port: "8888" | ||
prometheus.io/scrape: "true" | ||
labels: | ||
{{.Values.global.controllerComponentLabel}}: {{.Values.collector.name}} | ||
{{.Values.global.controllerNamespaceLabel}}: {{.Values.global.namespace}} | ||
{{- include "partials.proxy.labels" .Values.global.proxy | nindent 8}} | ||
spec: | ||
containers: | ||
- command: | ||
- /occollector_linux | ||
- --config=/conf/linkerd-collector-config.yaml | ||
env: | ||
- name: GOGC | ||
value: "80" | ||
image: {{.Values.collector.image}} | ||
imagePullPolicy: {{.Values.global.imagePullPolicy}} | ||
livenessProbe: | ||
httpGet: | ||
path: / | ||
port: 13133 | ||
name: oc-collector | ||
ports: | ||
- containerPort: 55678 | ||
- containerPort: 9411 | ||
readinessProbe: | ||
httpGet: | ||
path: / | ||
port: 13133 | ||
{{- if .Values.collector.resources -}} | ||
{{- include "partials.resources" .Values.collector.resources | nindent 8 }} | ||
{{- end }} | ||
volumeMounts: | ||
- mountPath: /conf | ||
name: {{ printf "%s-config-val" .Values.collector.name}} | ||
- {{- include "partials.proxy" . | indent 8 | trimPrefix (repeat 7 " ") }} | ||
{{ if not .Values.global.noInitContainer -}} | ||
initContainers: | ||
- {{- include "partials.proxy-init" . | indent 8 | trimPrefix (repeat 7 " ") }} | ||
{{ end -}} | ||
serviceAccountName: {{.Values.collector.name}} | ||
volumes: | ||
- configMap: | ||
items: | ||
- key: linkerd-collector-config | ||
path: linkerd-collector-config.yaml | ||
name: {{printf "%s-config" .Values.collector.name}} | ||
name: {{ printf "%s-config-val" .Values.collector.name}} | ||
- {{- include "partials.proxy.volumes.identity" . | indent 8 | trimPrefix (repeat 7 " ") }} | ||
--- | ||
### | ||
### Tracing Jaeger Service | ||
### | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{.Values.jaeger.name}} | ||
namespace: {{.Values.global.namespace}} | ||
labels: | ||
{{.Values.global.controllerComponentLabel}}: {{.Values.jaeger.name}} | ||
{{.Values.global.controllerNamespaceLabel}}: {{.Values.global.namespace}} | ||
annotations: | ||
{{.Values.global.createdByAnnotation}}: {{default (printf "linkerd/helm %s" .Values.global.linkerdVersion) .Values.global.cliVersion}} | ||
spec: | ||
type: ClusterIP | ||
selector: | ||
{{.Values.global.controllerComponentLabel}}: {{.Values.jaeger.name}} | ||
ports: | ||
- name: collection | ||
port: 14268 | ||
- name: ui | ||
port: 16686 | ||
--- | ||
{{ if empty .Values.global.proxy.image.version -}} | ||
{{ $_ := set .Values.global.proxy.image "Version" .Values.global.linkerdVersion -}} | ||
{{ end -}} | ||
{{ $_ := set .Values.global.proxy "workloadKind" "deployment" -}} | ||
{{ $_ := set .Values.global.proxy "component" .Values.jaeger.name -}} | ||
{{ include "linkerd.proxy.validation" .Values.global.proxy -}} | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
annotations: | ||
{{.Values.global.createdByAnnotation}}: {{default (printf "linkerd/helm %s" .Values.global.linkerdVersion) .Values.global.cliVersion}} | ||
labels: | ||
app.kubernetes.io/name: {{.Values.jaeger.name}} | ||
app.kubernetes.io/part-of: Linkerd | ||
app.kubernetes.io/version: {{default .Values.global.linkerdVersion .Values.controllerImageVersion}} | ||
{{.Values.global.controllerComponentLabel}}: {{.Values.jaeger.name}} | ||
{{.Values.global.controllerNamespaceLabel}}: {{.Values.global.namespace}} | ||
name: {{.Values.jaeger.name}} | ||
namespace: {{.Values.global.namespace}} | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
{{.Values.global.controllerComponentLabel}}: {{.Values.jaeger.name}} | ||
{{.Values.global.controllerNamespaceLabel}}: {{.Values.global.namespace}} | ||
{{- include "partials.proxy.labels" .Values.global.proxy | nindent 6}} | ||
template: | ||
metadata: | ||
annotations: | ||
{{.Values.global.createdByAnnotation}}: {{default (printf "linkerd/helm %s" .Values.global.linkerdVersion) .Values.global.cliVersion}} | ||
{{- include "partials.proxy.annotations" .Values.global.proxy| nindent 8}} | ||
prometheus.io/path: /metrics | ||
prometheus.io/port: "8888" | ||
prometheus.io/scrape: "true" | ||
labels: | ||
{{.Values.global.controllerComponentLabel}}: {{.Values.jaeger.name}} | ||
{{.Values.global.controllerNamespaceLabel}}: {{.Values.global.namespace}} | ||
{{- include "partials.proxy.labels" .Values.global.proxy | nindent 8}} | ||
spec: | ||
containers: | ||
- image: {{.Values.jaeger.image}} | ||
imagePullPolicy: {{.Values.global.imagePullPolicy}} | ||
name: jaeger | ||
ports: | ||
- containerPort: 14268 | ||
name: collection | ||
- containerPort: 16686 | ||
name: ui | ||
{{- if .Values.jaeger.resources -}} | ||
{{- include "partials.resources" .Values.jaeger.resources | nindent 8 }} | ||
{{- end }} | ||
- {{- include "partials.proxy" . | indent 8 | trimPrefix (repeat 7 " ") }} | ||
{{ if not .Values.global.noInitContainer -}} | ||
initContainers: | ||
- {{- include "partials.proxy-init" . | indent 8 | trimPrefix (repeat 7 " ") }} | ||
{{ end -}} | ||
dnsPolicy: ClusterFirst | ||
serviceAccountName: linkerd-jaeger | ||
volumes: | ||
- {{- include "partials.proxy.volumes.identity" . | indent 8 | trimPrefix (repeat 7 " ") }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Default values for tracing. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{{ if or (.Values.tracing.enabled) -}} | ||
{{- $dupValues := .Values -}} | ||
{{- $dupValues := omit $dupValues "partials" -}} | ||
Pothulapati marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{{- range $key, $value := $dupValues -}} | ||
{{- if kindIs "map" $value -}} | ||
{{- if and (hasKey $value "global") (ne $key "configs" ) -}} | ||
{{- $dupValues := set $dupValues $key (unset $value "global") -}} | ||
{{- end -}} | ||
{{- if hasKey $value "partials" -}} | ||
{{- $dupValues := set $dupValues $key (unset $value "partials") -}} | ||
{{- end -}} | ||
{{- end -}} | ||
{{- end -}} | ||
--- | ||
### | ||
### linkerd values | ||
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. Can we add a comment to specify the purpose of this configmap? Maybe something like:
|
||
### | ||
--- | ||
kind: ConfigMap | ||
apiVersion: v1 | ||
metadata: | ||
name: linkerd-values | ||
namespace: {{.Values.global.namespace}} | ||
labels: | ||
{{.Values.global.controllerComponentLabel}}: controller | ||
{{.Values.global.controllerNamespaceLabel}}: {{.Values.global.namespace}} | ||
annotations: | ||
{{.Values.global.createdByAnnotation}}: {{default (printf "linkerd/helm %s" .Values.global.linkerdVersion) .Values.global.cliVersion}} | ||
data: | ||
values: |- | ||
tracing: | ||
{{- toYaml $dupValues.tracing | trim | nindent 6}} | ||
{{ end }} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Seems like the
or
here is not needed?Also if tracing is not enabled then
$dupValues
won't be defined. Will that cause a problem down at the end of this file?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.
This if condition is to not have
linkerd-values
cm to be deployed, when there are zero add-ons enabled. Hence, theor
condition but once we make thelinkerd-values
common for all config, then we should be able to remove this if condition.