-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Moves Common templates needed to partials As add-ons re-use the partials helm chart, all the templates needed by multiple charts should be present in partials This commit also updates the helm tests Signed-off-by: Tarun Pothulapati <[email protected]> * add tracing add-on helm chart Tracing sub-chart includes open-census and jaeger components as a sub-chart which can be enabled as needed * Updated Install path to also install add-ons This includes new interface for add-ons to implement, with example tracing implementation * Updates Linkerd install path to also install add-ons Changes include: - Adds an optional Linkerd Values configmap which stores add-on configuration when add-ons are present. - Updates Linkerd install path to check for add-ons and render their sub-charts. - Adds a install Option called config, which is used to pass confiugration for add-ons. - Uses a fork of mergo, to over-write default Values with the Values struct generated from config. * Updates the upgrade path about add-ons. Upgrade path now checks for the linkerd-values cm, and overwrites the default values with it, if present. It then checks the config option, for any further overwrites * Refactor linkerd-values and re-update tests also adds relevant nil checks * Refactor code to fix linting issues * Fixes an error with linkerd-config global values Also refactors the linkerd-values cm to work the same with helm * Fix a nil pointer issue for tests * Updated Tracing add-on chart meta-data Also introduced a defaultGetFiles method for add-ons * Add add-on/charts to gitignore * refactor gitignore for chart deps * Moves sub-charts to /charts directly * Refactor linkerd values cm * Add comment in linkerd-values * remove extra controlplanetracing flag * Support Stages deployment for add-ons along with tests * linting fix * update tracing rbac * Removes the need for add-on Interface - Uses helm loading capabiltiies to get info about add-ons - Uses reflection to not have to unnecessarily add checks for each add-on type * disable tracing flag * Remove dep on forked mergo - Re-use merge from helm * Re-use helm's merge * Override the chartDir path during tests * add error check * Updated the dependency iteration code Currently, the charts directory, will not have the deps in the repo. So, Code is updated to read the dependencies from requirements.yaml and use that info to read templates from the relevant add-ons directory. * Hard Code add-ons name * Remove struct details for add-ons - As we don't use fields of a add-on struct, we don't have them to be typed. Instead we can just use the `enabled` flag using reflection - Users can just use map[string]interface{} as the add-on type. * update unit tests * linting fix * Rename flag to addon-config * Use Chart loading logic - This code uses chart loading to read the files and keep in a vfs. - Once we have those files read we will then use them for generation of sub-charts. * Go fmt fix * Update the linkerd-values cm to use second level field * Add relevant unit tests for mergeRaw * linting fix * Move addon tests to a new file * Fix golden files * remove addon install unit test * Refactor sub-chart load logic * Add install tracing unit test * golden file update for tracing install * Update golden files to reflect another pr changes * Move addon-config flag to recordFlagSet * add relevant tracing enabled checks * linting fix Signed-off-by: Tarun Pothulapati <[email protected]>
- Loading branch information
1 parent
ae880f0
commit 948dc22
Showing
27 changed files
with
4,221 additions
and
9 deletions.
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/**/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
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:2202cf6f3783f79e78414e7a94b651589f322f3724ab220f0ea3bf8f31954de4 | ||
generated: "2020-01-30T00:01:30.861787731+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 |
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: {{.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}} |
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,29 @@ | ||
{{- /* | ||
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) -}} | ||
--- | ||
### | ||
### linkerd values | ||
### | ||
--- | ||
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 -}} |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.