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 all 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/**/charts
22 changes: 22 additions & 0 deletions charts/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/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/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:2202cf6f3783f79e78414e7a94b651589f322f3724ab220f0ea3bf8f31954de4
generated: "2020-01-30T00:01:30.861787731+05:30"
4 changes: 4 additions & 0 deletions charts/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/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: {{.Values.collector.name}}
namespace: {{.Values.global.namespace}}
labels:
{{.Values.global.controllerComponentLabel}}: {{.Values.collector.name}}
{{.Values.global.controllerNamespaceLabel}}: {{.Values.global.namespace}}
---
###
### linkerd-jaeger RBAC
###
---
kind: ServiceAccount
apiVersion: v1
metadata:
name: {{.Values.jaeger.name}}
namespace: {{.Values.global.namespace}}
labels:
{{.Values.global.controllerComponentLabel}}: {{.Values.jaeger.name}}
{{.Values.global.controllerNamespaceLabel}}: {{.Values.global.namespace}}
223 changes: 223 additions & 0 deletions charts/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}}
ihcsim marked this conversation as resolved.
Show resolved Hide resolved
{{.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/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:e33d9505af13cd9a047d9a2d6094af4b4d62cdc9ee64970dc3d2bba6809066d0
generated: "2020-01-30T00:02:25.011181273+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
29 changes: 29 additions & 0 deletions charts/linkerd2/templates/linkerd-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{{- /*
Pothulapati marked this conversation as resolved.
Show resolved Hide resolved
This config-map is used to store the configuration of add-ons, which is useful during upgrades.
As fields like global, etc are added by helm and we would not want them in the data, second level fields should be used
instead of directly specifying the add-on field.
*/ -}}
{{ 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.

---
###
### 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.controllerNamespaceLabel}}: {{.Values.global.namespace}}
annotations:
{{.Values.global.createdByAnnotation}}: {{default (printf "linkerd/helm %s" .Values.global.linkerdVersion) .Values.global.cliVersion}}
data:
values: |-
tracing:
enabled: {{.Values.tracing.enabled}}
collector:
{{- toYaml .Values.tracing.collector | trim | nindent 8}}
jaeger:
{{- toYaml .Values.tracing.jaeger | trim | nindent 8}}
{{ end -}}
20 changes: 20 additions & 0 deletions charts/linkerd2/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -168,3 +168,23 @@ installNamespace: true
# https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector.
nodeSelector:
beta.kubernetes.io/os: linux


# Configuration for Add-ons
tracing:
enabled: false
collector:
name: linkerd-collector
image: omnition/opencensus-collector:0.1.10
resources:
cpu:
limit: 1
request: 200m
memory:
limit: 2Gi
request: 400Mi
jaeger:
name: linkerd-jaeger
image: jaegertracing/all-in-one:1.8
resources:

Loading