Skip to content
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 50 commits into from
Feb 26, 2020
Merged
Show file tree
Hide file tree
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 Jan 19, 2020
6eba3da
add tracing add-on helm chart
Pothulapati Jan 20, 2020
a428e96
Updated Install path to also install add-ons
Pothulapati Jan 20, 2020
a4db942
Updates Linkerd install path to also install add-ons
Pothulapati Jan 20, 2020
9827600
Updates the upgrade path about add-ons.
Pothulapati Jan 20, 2020
d6eb6db
Refactor linkerd-values and re-update tests
Pothulapati Jan 20, 2020
c303d02
Refactor code to fix linting issues
Pothulapati Jan 20, 2020
1bb5fa4
Fixes an error with linkerd-config global values
Pothulapati Jan 23, 2020
b8f7182
Fix a nil pointer issue for tests
Pothulapati Jan 23, 2020
b72b7f8
Merge branch 'master' into addon-tracing
Pothulapati Jan 23, 2020
df90cb3
Updated Tracing add-on chart meta-data
Pothulapati Jan 26, 2020
6f3fa94
Add add-on/charts to gitignore
Pothulapati Jan 27, 2020
89fc1df
refactor gitignore for chart deps
Pothulapati Jan 28, 2020
94f2340
Moves sub-charts to /charts directly
Pothulapati Jan 29, 2020
1347e12
Refactor linkerd values cm
Pothulapati Jan 29, 2020
b0e013d
Add comment in linkerd-values
Pothulapati Jan 29, 2020
27347ab
Merge branch 'master' into addon-tracing
Pothulapati Feb 8, 2020
048e696
remove extra controlplanetracing flag
Pothulapati Feb 8, 2020
42bffa9
Support Stages deployment for add-ons along with tests
Pothulapati Feb 10, 2020
d8bb871
linting fix
Pothulapati Feb 10, 2020
72d1c0d
update tracing rbac
Pothulapati Feb 12, 2020
544660e
Removes the need for add-on Interface
Pothulapati Feb 19, 2020
86e17bf
disable tracing flag
Pothulapati Feb 19, 2020
0e316bb
Remove dep on forked mergo
Pothulapati Feb 19, 2020
1bfcfc6
Re-use helm's merge
Pothulapati Feb 19, 2020
6fb3f1e
Merge branch 'master' into addon-tracing
Pothulapati Feb 19, 2020
19be7f7
Override the chartDir path during tests
Pothulapati Feb 20, 2020
e8629b6
add error check
Pothulapati Feb 20, 2020
e28efdd
Updated the dependency iteration code
Pothulapati Feb 20, 2020
b5f3882
Hard Code add-ons name
Pothulapati Feb 21, 2020
faed2d0
Remove struct details for add-ons
Pothulapati Feb 21, 2020
a7acaad
update unit tests
Pothulapati Feb 21, 2020
ab8965e
linting fix
Pothulapati Feb 21, 2020
b1fc765
Rename flag to addon-config
Pothulapati Feb 22, 2020
2b90e20
Use Chart loading logic
Pothulapati Feb 22, 2020
216fdaa
Go fmt fix
Pothulapati Feb 22, 2020
bc5829f
Update the linkerd-values cm to use second level field
Pothulapati Feb 22, 2020
262287d
Add relevant unit tests for mergeRaw
Pothulapati Feb 23, 2020
b9d941b
linting fix
Pothulapati Feb 24, 2020
721b5b4
Move addon tests to a new file
Pothulapati Feb 24, 2020
2f50ee7
Fix golden files
Pothulapati Feb 24, 2020
8461251
remove addon install unit test
Pothulapati Feb 24, 2020
250e0e2
Refactor sub-chart load logic
Pothulapati Feb 25, 2020
bc32082
Add install tracing unit test
Pothulapati Feb 25, 2020
12f7b1a
golden file update for tracing install
Pothulapati Feb 25, 2020
a669666
Merge branch 'master' into addon-tracing
Pothulapati Feb 25, 2020
cb8b486
Update golden files to reflect another pr changes
Pothulapati Feb 25, 2020
829ba04
Move addon-config flag to recordFlagSet
Pothulapati Feb 25, 2020
8ef593c
add relevant tracing enabled checks
Pothulapati Feb 26, 2020
26b28ad
linting fix
Pothulapati Feb 26, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ web/app/yarn-error.log
.gorun
**/*.gogen*
**/*.swp
charts/*/charts/
charts/**/add-ons/*/charts
2 changes: 1 addition & 1 deletion Dockerfile-proxy
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ RUN (proxy=$(bin/fetch-proxy $(cat proxy-version)) && \
mv "$proxy" linkerd2-proxy)

## compile proxy-identity agent
FROM gcr.io/linkerd-io/go-deps:8d2ce4bf as golang
FROM gcr.io/linkerd-io/go-deps:57ec36a4 as golang
WORKDIR /linkerd-build
COPY pkg/flags pkg/flags
COPY pkg/tls pkg/tls
Expand Down
22 changes: 22 additions & 0 deletions charts/linkerd2/add-ons/tracing/.helmignore
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/
9 changes: 9 additions & 0 deletions charts/linkerd2/add-ons/tracing/Chart.yaml
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/
6 changes: 6 additions & 0 deletions charts/linkerd2/add-ons/tracing/requirements.lock
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"
4 changes: 4 additions & 0 deletions charts/linkerd2/add-ons/tracing/requirements.yaml
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 charts/linkerd2/add-ons/tracing/templates/tracing-rbac.yaml
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}}
223 changes: 223 additions & 0 deletions charts/linkerd2/add-ons/tracing/templates/tracing.yaml
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 " ") }}
1 change: 1 addition & 0 deletions charts/linkerd2/add-ons/tracing/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Default values for tracing.
7 changes: 5 additions & 2 deletions charts/linkerd2/requirements.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@ dependencies:
- name: partials
repository: file://../partials
version: 0.1.0
digest: sha256:3a86b96a2966f03ba04518723838b49719a3277dfb9bea0b3f067e83d370e0b3
generated: 2019-07-24T19:51:15.04322926-07:00
- name: tracing
repository: file://add-ons/tracing
version: 0.1.0
digest: sha256:01278c1b1d9f03e895f8701ec35444fadaa8c3b655f7d43c0a44ff2ca7e59cbf
generated: "2020-01-20T11:12:56.141361729+05:30"
4 changes: 4 additions & 0 deletions charts/linkerd2/requirements.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@ dependencies:
- name: partials
version: 0.1.0
repository: file://../partials
- name: tracing
version: 0.1.0
repository: file://add-ons/tracing
condition: tracing.enabled
33 changes: 33 additions & 0 deletions charts/linkerd2/templates/linkerd-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{{ if or (.Values.tracing.enabled) -}}
Copy link
Member

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?

Copy link
Contributor Author

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, the or condition but once we make the linkerd-values common for all config, then we should be able to remove this if condition.

{{- $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
Copy link
Contributor

Choose a reason for hiding this comment

The 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:

This configmap is used to store add-ons' configuration.
See the 'linkerd-config' configmap for the control and data plane configuration.

###
---
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 }}
Loading